Search in sources :

Example 1 with TestModifiedKafkaIndexTaskTuningConfig

use of org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig in project druid by druid-io.

the class KafkaIndexTaskTuningConfigTest method testSerdeWithModifiedTuningConfigAddedField.

@Test
public void testSerdeWithModifiedTuningConfigAddedField() throws IOException {
    KafkaIndexTaskTuningConfig base = new KafkaIndexTaskTuningConfig(null, 1, null, null, 2, 10L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, null, null, null, true, 42, 42);
    String serialized = mapper.writeValueAsString(base);
    TestModifiedKafkaIndexTaskTuningConfig deserialized = mapper.readValue(serialized, TestModifiedKafkaIndexTaskTuningConfig.class);
    Assert.assertEquals(null, deserialized.getExtra());
    Assert.assertEquals(base.getAppendableIndexSpec(), deserialized.getAppendableIndexSpec());
    Assert.assertEquals(base.getMaxRowsInMemory(), deserialized.getMaxRowsInMemory());
    Assert.assertEquals(base.getMaxBytesInMemory(), deserialized.getMaxBytesInMemory());
    Assert.assertEquals(base.getMaxRowsPerSegment(), deserialized.getMaxRowsPerSegment());
    Assert.assertEquals(base.getMaxTotalRows(), deserialized.getMaxTotalRows());
    Assert.assertEquals(base.getIntermediatePersistPeriod(), deserialized.getIntermediatePersistPeriod());
    Assert.assertEquals(base.getBasePersistDirectory(), deserialized.getBasePersistDirectory());
    Assert.assertEquals(base.getMaxPendingPersists(), deserialized.getMaxPendingPersists());
    Assert.assertEquals(base.getIndexSpec(), deserialized.getIndexSpec());
    Assert.assertEquals(base.isReportParseExceptions(), deserialized.isReportParseExceptions());
    Assert.assertEquals(base.getHandoffConditionTimeout(), deserialized.getHandoffConditionTimeout());
    Assert.assertEquals(base.isResetOffsetAutomatically(), deserialized.isResetOffsetAutomatically());
    Assert.assertEquals(base.getSegmentWriteOutMediumFactory(), deserialized.getSegmentWriteOutMediumFactory());
    Assert.assertEquals(base.getIntermediateHandoffPeriod(), deserialized.getIntermediateHandoffPeriod());
    Assert.assertEquals(base.isLogParseExceptions(), deserialized.isLogParseExceptions());
    Assert.assertEquals(base.getMaxParseExceptions(), deserialized.getMaxParseExceptions());
    Assert.assertEquals(base.getMaxSavedParseExceptions(), deserialized.getMaxSavedParseExceptions());
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) TestModifiedKafkaIndexTaskTuningConfig(org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig) Period(org.joda.time.Period) File(java.io.File) TestModifiedKafkaIndexTaskTuningConfig(org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig) Test(org.junit.Test)

Example 2 with TestModifiedKafkaIndexTaskTuningConfig

use of org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig in project druid by druid-io.

the class KafkaIndexTaskTuningConfigTest method testSerdeWithModifiedTuningConfigRemovedField.

@Test
public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException {
    TestModifiedKafkaIndexTaskTuningConfig base = new TestModifiedKafkaIndexTaskTuningConfig(null, 1, null, null, 2, 10L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, null, null, null, true, 42, 42, "extra string");
    String serialized = mapper.writeValueAsString(base);
    KafkaIndexTaskTuningConfig deserialized = mapper.readValue(serialized, KafkaIndexTaskTuningConfig.class);
    Assert.assertEquals(base.getAppendableIndexSpec(), deserialized.getAppendableIndexSpec());
    Assert.assertEquals(base.getMaxRowsInMemory(), deserialized.getMaxRowsInMemory());
    Assert.assertEquals(base.getMaxBytesInMemory(), deserialized.getMaxBytesInMemory());
    Assert.assertEquals(base.getMaxRowsPerSegment(), deserialized.getMaxRowsPerSegment());
    Assert.assertEquals(base.getMaxTotalRows(), deserialized.getMaxTotalRows());
    Assert.assertEquals(base.getIntermediatePersistPeriod(), deserialized.getIntermediatePersistPeriod());
    Assert.assertEquals(base.getBasePersistDirectory(), deserialized.getBasePersistDirectory());
    Assert.assertEquals(base.getMaxPendingPersists(), deserialized.getMaxPendingPersists());
    Assert.assertEquals(base.getIndexSpec(), deserialized.getIndexSpec());
    Assert.assertEquals(base.isReportParseExceptions(), deserialized.isReportParseExceptions());
    Assert.assertEquals(base.getHandoffConditionTimeout(), deserialized.getHandoffConditionTimeout());
    Assert.assertEquals(base.isResetOffsetAutomatically(), deserialized.isResetOffsetAutomatically());
    Assert.assertEquals(base.getSegmentWriteOutMediumFactory(), deserialized.getSegmentWriteOutMediumFactory());
    Assert.assertEquals(base.getIntermediateHandoffPeriod(), deserialized.getIntermediateHandoffPeriod());
    Assert.assertEquals(base.isLogParseExceptions(), deserialized.isLogParseExceptions());
    Assert.assertEquals(base.getMaxParseExceptions(), deserialized.getMaxParseExceptions());
    Assert.assertEquals(base.getMaxSavedParseExceptions(), deserialized.getMaxSavedParseExceptions());
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) TestModifiedKafkaIndexTaskTuningConfig(org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig) Period(org.joda.time.Period) File(java.io.File) TestModifiedKafkaIndexTaskTuningConfig(org.apache.druid.indexing.kafka.test.TestModifiedKafkaIndexTaskTuningConfig) Test(org.junit.Test)

Aggregations

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