@Override public void close() throws IOException { firehose.close(); } }
@Override public void close() throws IOException { synchronized (shutdownLock) { if (!shutdown) { shutdown = true; firehose.close(); } } } }
@Override public void close() throws IOException { currentFirehose.close(); } }
@Override public void close() throws IOException { delegateFirehose.close(); } };
private void nextFirehose() { if (firehoseFactoryIterator.hasNext()) { try { if (currentFirehose != null) { currentFirehose.close(); } currentFirehose = firehoseFactoryIterator.next().connect(parser, temporaryDirectory); } catch (IOException e) { if (currentFirehose != null) { try { currentFirehose.close(); } catch (IOException e2) { log.error(e, "Unable to close currentFirehose!"); throw Throwables.propagate(e2); } } throw Throwables.propagate(e); } } }
@Override public void run() { log.info("Closing delegate firehose."); shutdown = true; try { firehose.close(); } catch (IOException e) { log.warn(e, "Failed to close delegate firehose, ignoring."); } } },
@Override public void stopGracefully(TaskConfig taskConfig) { if (taskConfig.isRestoreTasksOnRestart()) { try { synchronized (this) { if (!gracefullyStopped) { gracefullyStopped = true; if (firehose == null) { log.info("stopGracefully: Firehose not started yet, so nothing to stop."); } else if (finishingJob) { log.info("stopGracefully: Interrupting finishJob."); runThread.interrupt(); } else if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { log.info("stopGracefully: Draining firehose."); firehose.close(); } else { log.info("stopGracefully: Cannot drain firehose by closing, interrupting run thread."); runThread.interrupt(); } } } } catch (Exception e) { throw Throwables.propagate(e); } } }
@Override public void stopGracefully(TaskConfig taskConfig) { if (taskConfig.isRestoreTasksOnRestart()) { try { synchronized (this) { if (!gracefullyStopped) { gracefullyStopped = true; if (firehose == null) { log.info("stopGracefully: Firehose not started yet, so nothing to stop."); } else if (finishingJob) { log.info("stopGracefully: Interrupting finishJob."); runThread.interrupt(); } else if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { log.info("stopGracefully: Draining firehose."); firehose.close(); } else { log.info("stopGracefully: Cannot drain firehose by closing, interrupting run thread."); runThread.interrupt(); } } } } catch (Exception e) { throw Throwables.propagate(e); } } }
@Override public void close() throws IOException { currentFirehose.close(); } }
@Override public void close() throws IOException { delegateFirehose.close(); } };
@Override public void close() throws IOException { firehose.close(); } }
@Override public void close() throws IOException { synchronized (shutdownLock) { if (!shutdown) { shutdown = true; firehose.close(); } } } }
private void nextFirehose() { if (firehoseFactoryIterator.hasNext()) { try { if (currentFirehose != null) { currentFirehose.close(); } currentFirehose = firehoseFactoryIterator.next().connect(parser, temporaryDirectory); } catch (IOException e) { if (currentFirehose != null) { try { currentFirehose.close(); } catch (IOException e2) { log.error(e, "Unable to close currentFirehose!"); throw Throwables.propagate(e2); } } throw Throwables.propagate(e); } } }
@Override public void run() { log.info("Closing delegate firehose."); shutdown = true; try { firehose.close(); } catch (IOException e) { log.warn(e, "Failed to close delegate firehose, ignoring."); } } },
@Override public void stopGracefully() { try { synchronized (this) { if (!gracefullyStopped) { gracefullyStopped = true; if (firehose == null) { log.info("stopGracefully: Firehose not started yet, so nothing to stop."); } else if (finishingJob) { log.info("stopGracefully: Interrupting finishJob."); runThread.interrupt(); } else if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { log.info("stopGracefully: Draining firehose."); firehose.close(); } else { log.info("stopGracefully: Cannot drain firehose by closing, interrupting run thread."); runThread.interrupt(); } } } } catch (Exception e) { throw Throwables.propagate(e); } }
@Override public void stopGracefully() { try { synchronized (this) { if (!gracefullyStopped) { gracefullyStopped = true; if (firehose == null) { log.info("stopGracefully: Firehose not started yet, so nothing to stop."); } else if (finishingJob) { log.info("stopGracefully: Interrupting finishJob."); runThread.interrupt(); } else if (isFirehoseDrainableByClosing(spec.getIOConfig().getFirehoseFactory())) { log.info("stopGracefully: Draining firehose."); firehose.close(); } else { log.info("stopGracefully: Cannot drain firehose by closing, interrupting run thread."); runThread.interrupt(); } } } } catch (Exception e) { throw Throwables.propagate(e); } }