Search in sources :

Example 1 with KafkaSupervisorTuningConfig

use of org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorTuningConfig in project druid by druid-io.

the class KafkaIndexTaskTuningConfigTest method testConvert.

@Test
public void testConvert() {
    KafkaSupervisorTuningConfig original = new KafkaSupervisorTuningConfig(null, 1, null, null, 2, 10L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, null, null, null, null, null, null, null, null, null, null, null, null);
    KafkaIndexTaskTuningConfig copy = (KafkaIndexTaskTuningConfig) original.convertToTaskTuningConfig();
    Assert.assertEquals(original.getAppendableIndexSpec(), copy.getAppendableIndexSpec());
    Assert.assertEquals(1, copy.getMaxRowsInMemory());
    Assert.assertEquals(2, copy.getMaxRowsPerSegment().intValue());
    Assert.assertNotEquals(null, copy.getMaxTotalRows());
    Assert.assertEquals(10L, copy.getMaxTotalRows().longValue());
    Assert.assertEquals(new Period("PT3S"), copy.getIntermediatePersistPeriod());
    Assert.assertEquals(new File("/tmp/xxx"), copy.getBasePersistDirectory());
    Assert.assertEquals(4, copy.getMaxPendingPersists());
    Assert.assertEquals(new IndexSpec(), copy.getIndexSpec());
    Assert.assertEquals(true, copy.isReportParseExceptions());
    Assert.assertEquals(5L, copy.getHandoffConditionTimeout());
}
Also used : KafkaSupervisorTuningConfig(org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorTuningConfig) IndexSpec(org.apache.druid.segment.IndexSpec) TestModifiedKafkaIndexTaskTuningConfig(org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig) Period(org.joda.time.Period) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 KafkaSupervisorTuningConfig (org.apache.druid.indexing.kafka.supervisor.KafkaSupervisorTuningConfig)1 TestModifiedKafkaIndexTaskTuningConfig (org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig)1 IndexSpec (org.apache.druid.segment.IndexSpec)1 Period (org.joda.time.Period)1 Test (org.junit.Test)1