Search in sources :

Example 1 with DatasourceIngestionSpec

use of org.apache.druid.indexer.hadoop.DatasourceIngestionSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListThrowsExceptionWithUserSegmentsMismatch.

@Test(expected = IOException.class)
public void testUpdateSegmentListThrowsExceptionWithUserSegmentsMismatch() throws Exception {
    PathSpec pathSpec = new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE, TEST_DATA_SOURCE_INTERVAL, null, ImmutableList.of(SEGMENT.withVersion("v2")), null, null, null, false, null), null, false);
    testRunUpdateSegmentListIfDatasourcePathSpecIsUsed(pathSpec, TEST_DATA_SOURCE_INTERVAL);
}
Also used : DatasourceIngestionSpec(org.apache.druid.indexer.hadoop.DatasourceIngestionSpec) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) 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 DatasourceIngestionSpec

use of org.apache.druid.indexer.hadoop.DatasourceIngestionSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListIfDatasourcePathSpecIsUsedWithJustDatasourcePathSpecAndPartialInterval.

@Test
public void testUpdateSegmentListIfDatasourcePathSpecIsUsedWithJustDatasourcePathSpecAndPartialInterval() throws Exception {
    PathSpec pathSpec = new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE, TEST_DATA_SOURCE_INTERVAL_PARTIAL, null, null, null, null, null, false, null), null, false);
    HadoopDruidIndexerConfig config = testRunUpdateSegmentListIfDatasourcePathSpecIsUsed(pathSpec, TEST_DATA_SOURCE_INTERVAL_PARTIAL);
    Assert.assertEquals(ImmutableList.of(new WindowedDataSegment(SEGMENT, TEST_DATA_SOURCE_INTERVAL_PARTIAL)), ((DatasourcePathSpec) config.getPathSpec()).getSegments());
}
Also used : DatasourceIngestionSpec(org.apache.druid.indexer.hadoop.DatasourceIngestionSpec) WindowedDataSegment(org.apache.druid.indexer.hadoop.WindowedDataSegment) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) 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 3 with DatasourceIngestionSpec

use of org.apache.druid.indexer.hadoop.DatasourceIngestionSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListIfDatasourcePathSpecIsUsedWithJustDatasourcePathSpec.

@Test
public void testUpdateSegmentListIfDatasourcePathSpecIsUsedWithJustDatasourcePathSpec() throws Exception {
    PathSpec pathSpec = new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE, TEST_DATA_SOURCE_INTERVAL, 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) config.getPathSpec()).getSegments());
}
Also used : DatasourceIngestionSpec(org.apache.druid.indexer.hadoop.DatasourceIngestionSpec) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) 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 4 with DatasourceIngestionSpec

use of org.apache.druid.indexer.hadoop.DatasourceIngestionSpec in project druid by druid-io.

the class HadoopIngestionSpecUpdateDatasourcePathSpecSegmentsTest method testUpdateSegmentListIfDatasourcePathSpecWithMatchingUserSegments.

@Test
public void testUpdateSegmentListIfDatasourcePathSpecWithMatchingUserSegments() throws Exception {
    PathSpec pathSpec = new DatasourcePathSpec(null, new DatasourceIngestionSpec(TEST_DATA_SOURCE, TEST_DATA_SOURCE_INTERVAL, null, ImmutableList.of(SEGMENT), null, null, null, false, null), null, false);
    HadoopDruidIndexerConfig config = testRunUpdateSegmentListIfDatasourcePathSpecIsUsed(pathSpec, TEST_DATA_SOURCE_INTERVAL);
    Assert.assertEquals(ImmutableList.of(WindowedDataSegment.of(SEGMENT)), ((DatasourcePathSpec) config.getPathSpec()).getSegments());
}
Also used : DatasourceIngestionSpec(org.apache.druid.indexer.hadoop.DatasourceIngestionSpec) DatasourcePathSpec(org.apache.druid.indexer.path.DatasourcePathSpec) 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 5 with DatasourceIngestionSpec

use of org.apache.druid.indexer.hadoop.DatasourceIngestionSpec 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)

Aggregations

DatasourceIngestionSpec (org.apache.druid.indexer.hadoop.DatasourceIngestionSpec)8 DatasourcePathSpec (org.apache.druid.indexer.path.DatasourcePathSpec)5 MultiplePathSpec (org.apache.druid.indexer.path.MultiplePathSpec)5 PathSpec (org.apache.druid.indexer.path.PathSpec)5 StaticPathSpec (org.apache.druid.indexer.path.StaticPathSpec)5 Test (org.junit.Test)5 WindowedDataSegment (org.apache.druid.indexer.hadoop.WindowedDataSegment)4 HashSet (java.util.HashSet)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 HadoopIOConfig (org.apache.druid.indexer.HadoopIOConfig)1 HadoopIngestionSpec (org.apache.druid.indexer.HadoopIngestionSpec)1 HadoopTuningConfig (org.apache.druid.indexer.HadoopTuningConfig)1 HadoopIndexTask (org.apache.druid.indexing.common.task.HadoopIndexTask)1 ISE (org.apache.druid.java.util.common.ISE)1 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)1 DataSchema (org.apache.druid.segment.indexing.DataSchema)1