public Firehose connect() throws IOException { return ioConfig.getFirehoseFactory().connect(dataSchema.getParser(), null); }
@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); } } }
final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
public Firehose connect() throws IOException { return ioConfig.getFirehoseFactory().connect(dataSchema.getParser(), null); }
@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); } }
final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);