@Test public void testWriteWithZooKeeperDownAndInterveningCrash() throws Exception { zk.stop(); writer.saveHistoryItem(TASK_STATUS, TIMESTAMP); writer.stopAsync().awaitTerminated(); makeWriter(client); zk.start(); final TaskStatusEvent historyItem = Iterables.getOnlyElement(awaitHistoryItems()); assertEquals(JOB_ID, historyItem.getStatus().getJob().getId()); }
public void saveHistoryItem(final TaskStatus status) throws InterruptedException { saveHistoryItem(status, System.currentTimeMillis()); }
TaskHistoryWriter extends AbstractIdleService implements Runnable { public void saveHistoryItem(final TaskStatus status) throws InterruptedException { saveHistoryItem(status, System.currentTimeMillis()); } }
TaskHistoryWriter extends AbstractIdleService implements Runnable { public void saveHistoryItem(final TaskStatus status) throws InterruptedException { saveHistoryItem(status, System.currentTimeMillis()); } TaskHistoryWriter(final String hostname, final ZooKeeperClient client,
                           final Path backingFile); }
TaskHistoryWriter extends AbstractIdleService implements Runnable { public void saveHistoryItem(final TaskStatus status) throws InterruptedException { saveHistoryItem(status, System.currentTimeMillis()); } TaskHistoryWriter(final String hostname, final ZooKeeperClient client,
                           final Path backingFile); void saveHistoryItem(final TaskStatus status); void saveHistoryItem(final TaskStatus status, long timestamp); boolean isEmpty(); @Override void run(); }
TaskHistoryWriter extends AbstractIdleService implements Runnable { public void saveHistoryItem(final TaskStatus status) throws InterruptedException { saveHistoryItem(status, System.currentTimeMillis()); } TaskHistoryWriter(final String hostname, final ZooKeeperClient client,
                           final Path backingFile); void saveHistoryItem(final TaskStatus status); void saveHistoryItem(final TaskStatus status, long timestamp); boolean isEmpty(); @Override void run(); @VisibleForTesting
  static final int MAX_NUMBER_STATUS_EVENTS_TO_RETAIN; }