Search in sources :

Example 1 with TestModifiedKinesisIndexTaskTuningConfig

use of org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig in project druid by druid-io.

the class KinesisIndexTaskTuningConfigTest method testSerdeWithModifiedTuningConfigAddedField.

@Test
public void testSerdeWithModifiedTuningConfigAddedField() throws IOException {
    KinesisIndexTaskTuningConfig base = new KinesisIndexTaskTuningConfig(null, 1, 3L, null, 2, 100L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, true, false, 1000, 1000, 500, null, 42, null, false, 500, 500, 6000, new Period("P3D"));
    String serialized = mapper.writeValueAsString(base);
    TestModifiedKinesisIndexTaskTuningConfig deserialized = mapper.readValue(serialized, TestModifiedKinesisIndexTaskTuningConfig.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());
    Assert.assertEquals(base.getRecordBufferFullWait(), deserialized.getRecordBufferFullWait());
    Assert.assertEquals(base.getRecordBufferOfferTimeout(), deserialized.getRecordBufferOfferTimeout());
    Assert.assertEquals(base.getRecordBufferSize(), deserialized.getRecordBufferSize());
    Assert.assertEquals(base.getMaxRecordsPerPoll(), deserialized.getMaxRecordsPerPoll());
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) TestModifiedKinesisIndexTaskTuningConfig(org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig) Period(org.joda.time.Period) TestModifiedKinesisIndexTaskTuningConfig(org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig) File(java.io.File) Test(org.junit.Test)

Example 2 with TestModifiedKinesisIndexTaskTuningConfig

use of org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig in project druid by druid-io.

the class KinesisIndexTaskTuningConfigTest method testSerdeWithModifiedTuningConfigRemovedField.

@Test
public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException {
    KinesisIndexTaskTuningConfig base = new KinesisIndexTaskTuningConfig(null, 1, 3L, null, 2, 100L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, true, false, 1000, 1000, 500, null, 42, null, false, 500, 500, 6000, new Period("P3D"));
    String serialized = mapper.writeValueAsString(new TestModifiedKinesisIndexTaskTuningConfig(base, "loool"));
    KinesisIndexTaskTuningConfig deserialized = mapper.readValue(serialized, KinesisIndexTaskTuningConfig.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());
    Assert.assertEquals(base.getRecordBufferFullWait(), deserialized.getRecordBufferFullWait());
    Assert.assertEquals(base.getRecordBufferOfferTimeout(), deserialized.getRecordBufferOfferTimeout());
    Assert.assertEquals(base.getRecordBufferSize(), deserialized.getRecordBufferSize());
    Assert.assertEquals(base.getMaxRecordsPerPoll(), deserialized.getMaxRecordsPerPoll());
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) TestModifiedKinesisIndexTaskTuningConfig(org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig) Period(org.joda.time.Period) TestModifiedKinesisIndexTaskTuningConfig(org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

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