Search in sources :

Example 1 with DataSegmentFinder

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());
}
Also used : IndexerMetadataStorageCoordinator(io.druid.indexing.overlord.IndexerMetadataStorageCoordinator) SegmentLoadingException(io.druid.segment.loading.SegmentLoadingException) Injector(com.google.inject.Injector) DataSegmentFinder(io.druid.segment.loading.DataSegmentFinder) IOException(java.io.IOException) DataSegment(io.druid.timeline.DataSegment)

Aggregations

Injector (com.google.inject.Injector)1 IndexerMetadataStorageCoordinator (io.druid.indexing.overlord.IndexerMetadataStorageCoordinator)1 DataSegmentFinder (io.druid.segment.loading.DataSegmentFinder)1 SegmentLoadingException (io.druid.segment.loading.SegmentLoadingException)1 DataSegment (io.druid.timeline.DataSegment)1 IOException (java.io.IOException)1