Search in sources :

Example 1 with StaticPathSpec

use of org.apache.druid.indexer.path.StaticPathSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListIfDatasourcePathSpecIsUsedWithMultiplePathSpec.

@Test
public void testUpdateSegmentListIfDatasourcePathSpecIsUsedWithMultiplePathSpec() throws Exception {
    PathSpec pathSpec = new MultiplePathSpec(ImmutableList.of(new StaticPathSpec("/xyz", null), new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE, TEST_DATA_SOURCE_INTERVAL, null, null, null, null, null, false, null), null, false), new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE2, TEST_DATA_SOURCE_INTERVAL2, null, null, null, null, null, false, null), null, false)));
    HadoopDruidIndexerConfig config = testRunUpdateSegmentListIfDatasourcePathSpecIsUsed(pathSpec, TEST_DATA_SOURCE_INTERVAL);
    Assert.assertEquals(ImmutableList.of(WindowedDataSegment.of(SEGMENT)), ((DatasourcePathSpec) ((MultiplePathSpec) config.getPathSpec()).getChildren().get(1)).getSegments());
    Assert.assertEquals(ImmutableList.of(new WindowedDataSegment(SEGMENT2, TEST_DATA_SOURCE_INTERVAL2)), ((DatasourcePathSpec) ((MultiplePathSpec) config.getPathSpec()).getChildren().get(2)).getSegments());
}
Also used : DatasourceIngestionSpec(org.apache.druid.indexer.hadoop.DatasourceIngestionSpec) WindowedDataSegment(org.apache.druid.indexer.hadoop.WindowedDataSegment) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) StaticPathSpec(org.apache.druid.indexer.path.StaticPathSpec) MultiplePathSpec(org.apache.druid.indexer.path.MultiplePathSpec) MultiplePathSpec(org.apache.druid.indexer.path.MultiplePathSpec) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) StaticPathSpec(org.apache.druid.indexer.path.StaticPathSpec) PathSpec(org.apache.druid.indexer.path.PathSpec) Test(org.junit.Test)

Example 2 with StaticPathSpec

use of org.apache.druid.indexer.path.StaticPathSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListIfDatasourcePathSpecIsUsedWithNoDatasourcePathSpec.

@Test
public void testUpdateSegmentListIfDatasourcePathSpecIsUsedWithNoDatasourcePathSpec() throws Exception {
    PathSpec pathSpec = new StaticPathSpec("/xyz", null);
    HadoopDruidIndexerConfig config = testRunUpdateSegmentListIfDatasourcePathSpecIsUsed(pathSpec, null);
    Assert.assertTrue(config.getPathSpec() instanceof StaticPathSpec);
}
Also used : StaticPathSpec(org.apache.druid.indexer.path.StaticPathSpec) MultiplePathSpec(org.apache.druid.indexer.path.MultiplePathSpec) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) StaticPathSpec(org.apache.druid.indexer.path.StaticPathSpec) PathSpec(org.apache.druid.indexer.path.PathSpec) Test(org.junit.Test)

Aggregations

DatasourcePathSpec (org.apache.druid.indexer.path.DatasourcePathSpec)2 MultiplePathSpec (org.apache.druid.indexer.path.MultiplePathSpec)2 PathSpec (org.apache.druid.indexer.path.PathSpec)2 StaticPathSpec (org.apache.druid.indexer.path.StaticPathSpec)2 Test (org.junit.Test)2 DatasourceIngestionSpec (org.apache.druid.indexer.hadoop.DatasourceIngestionSpec)1 WindowedDataSegment (org.apache.druid.indexer.hadoop.WindowedDataSegment)1