@Test public void testCheckIfBookKeeperAlive_Negative() throws TException { final BookKeeperFactory mockBookKeeperFactory = mock(BookKeeperFactory.class); final BookKeeperHealth bookKeeperHealth = new BookKeeperHealth(conf, mockBookKeeperFactory); final RetryingPooledBookkeeperClient client = mock(RetryingPooledBookkeeperClient.class); when(mockBookKeeperFactory.createBookKeeperClient(conf)).thenReturn(client); when(client.isBookKeeperAlive()).thenThrow(TTransportException.class); boolean ifBookKeeperResponding = bookKeeperHealth.checkIfBookKeeperAlive(); assertEquals(ifBookKeeperResponding, false, "Bookkeeper health check should return false"); }
public boolean checkIfBookKeeperAlive() { boolean isBksAlive = false; try (RetryingPooledBookkeeperClient rclient = this.factory.createBookKeeperClient(conf)) { isBksAlive = rclient.isBookKeeperAlive(); } catch (Exception e) { log.error("Bookkeeper is not responding", e); } return isBksAlive; }
BookKeeperHealth extends Configured { public boolean checkIfBookKeeperAlive() { boolean isBksAlive = false; try (RetryingPooledBookkeeperClient rclient = this.factory.createBookKeeperClient(conf)) { isBksAlive = rclient.isBookKeeperAlive(); } catch (Exception e) { log.error("Bookkeeper is not responding", e); } return isBksAlive; } }
BookKeeperHealth extends Configured { public boolean checkIfBookKeeperAlive() { boolean isBksAlive = false; try (RetryingPooledBookkeeperClient rclient = this.factory.createBookKeeperClient(conf)) { isBksAlive = rclient.isBookKeeperAlive(); } catch (Exception e) { log.error("Bookkeeper is not responding", e); } return isBksAlive; } BookKeeperHealth(Configuration conf, BookKeeperFactory factory);  BookKeeperHealth(Configuration conf); }
BookKeeperHealth extends Configured { public boolean checkIfBookKeeperAlive() { boolean isBksAlive = false; try (RetryingPooledBookkeeperClient rclient = this.factory.createBookKeeperClient(conf)) { isBksAlive = rclient.isBookKeeperAlive(); } catch (Exception e) { log.error("Bookkeeper is not responding", e); } return isBksAlive; } BookKeeperHealth(Configuration conf, BookKeeperFactory factory);  BookKeeperHealth(Configuration conf); static void main(String[]args); boolean checkIfBookKeeperAlive(); }
BookKeeperHealth extends Configured { public boolean checkIfBookKeeperAlive() { boolean isBksAlive = false; try (RetryingPooledBookkeeperClient rclient = this.factory.createBookKeeperClient(conf)) { isBksAlive = rclient.isBookKeeperAlive(); } catch (Exception e) { log.error("Bookkeeper is not responding", e); } return isBksAlive; } BookKeeperHealth(Configuration conf, BookKeeperFactory factory);  BookKeeperHealth(Configuration conf); static void main(String[]args); boolean checkIfBookKeeperAlive();  }