use of io.druid.segment.loading.DataSegmentFinder in project druid by druid-io.
the class InsertSegment method run.
@Override
public void run() {
final Injector injector = makeInjector();
mapper = injector.getInstance(Key.get(ObjectMapper.class, Json.class));
indexerMetadataStorageCoordinator = injector.getInstance(IndexerMetadataStorageCoordinator.class);
final DataSegmentFinder dataSegmentFinder = injector.getInstance(DataSegmentFinder.class);
log.info("Start seraching segments under [%s]", workingDirPath);
Set<DataSegment> segments = null;
try {
segments = dataSegmentFinder.findSegments(workingDirPath, Boolean.valueOf(updateDescriptor));
} catch (SegmentLoadingException e) {
Throwables.propagate(e);
}
log.info("Done searching segments under [%s], [%d] segments were found", workingDirPath, segments.size());
try {
insertSegments(segments);
} catch (IOException e) {
Throwables.propagate(e);
}
log.info("Done processing [%d] segments", segments.size());
}
Aggregations