@JsonCreator public TestRealtimeTask( @JsonProperty("id") String id, @JsonProperty("resource") TaskResource taskResource, @JsonProperty("dataSource") String dataSource, @JsonProperty("taskStatus") TaskStatus status, @JacksonInject ObjectMapper mapper ) { super( id, taskResource, new FireDepartment( new DataSchema(dataSource, null, new AggregatorFactory[]{}, null, null, mapper), new RealtimeIOConfig( new LocalFirehoseFactory(new File("lol"), "rofl", null), (schema, config, metrics) -> null, null ), null ), null ); this.status = status; }
public Firehose connect() throws IOException { return ioConfig.getFirehoseFactory().connect(dataSchema.getParser(), null); }
public boolean checkFirehoseV2() { return ioConfig.getFirehoseFactoryV2() != null; }
new FireDepartment(dataSchema, new RealtimeIOConfig(null, null, null), null); final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
public Plumber findPlumber() { return ioConfig.getPlumberSchool().findPlumber(dataSchema, tuningConfig, metrics); }
dataSchema, new RealtimeIOConfig(null, null, null), null ); final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
public Plumber findPlumber() { return ioConfig.getPlumberSchool().findPlumber(dataSchema, tuningConfig, metrics); }
new RealtimeIOConfig(null, null, null), 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); } } }
public FirehoseV2 connect(Object metaData) throws IOException { return ioConfig.getFirehoseFactoryV2().connect(dataSchema.getParser(), metaData); }
new RealtimeIOConfig(null, null, null), 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); } } }
public boolean checkFirehoseV2() { return ioConfig.getFirehoseFactoryV2() != null; }
final GranularitySpec granularitySpec = dataSchema.getGranularitySpec(); final FireDepartment fireDepartmentForMetrics = new FireDepartment(dataSchema, new RealtimeIOConfig(null, null, null), null); final FireDepartmentMetrics fireDepartmentMetrics = fireDepartmentForMetrics.getMetrics();
final FirehoseFactory firehoseFactory = spec.getIOConfig().getFirehoseFactory(); final boolean firehoseDrainableByClosing = isFirehoseDrainableByClosing(firehoseFactory);
public FirehoseV2 connect(Object metaData) throws IOException { return ioConfig.getFirehoseFactoryV2().connect(dataSchema.getParser(), metaData); }
final RealtimeIOConfig ioConfig = new RealtimeIOConfig( new FirehoseFactory() null ); RealtimeIOConfig ioConfig2 = new RealtimeIOConfig( null, (schema, config, metrics) -> plumber2,
public Firehose connect() throws IOException { return ioConfig.getFirehoseFactory().connect(dataSchema.getParser(), null); }
new FireDepartment(dataSchema, new RealtimeIOConfig(null, null, null), null); buildSegmentsFireDepartmentMetrics = fireDepartmentForMetrics.getMetrics();
@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); } }