Search in sources :

Example 1 with KinesisSupervisorTuningConfig

use of org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorTuningConfig in project druid by druid-io.

the class KinesisSamplerSpec method createRecordSupplier.

@Override
protected KinesisRecordSupplier createRecordSupplier() {
    KinesisSupervisorIOConfig ioConfig = (KinesisSupervisorIOConfig) KinesisSamplerSpec.this.ioConfig;
    KinesisSupervisorTuningConfig tuningConfig = ((KinesisSupervisorTuningConfig) KinesisSamplerSpec.this.tuningConfig);
    return new KinesisRecordSupplier(KinesisRecordSupplier.getAmazonKinesisClient(ioConfig.getEndpoint(), awsCredentialsConfig, ioConfig.getAwsAssumedRoleArn(), ioConfig.getAwsExternalId()), ioConfig.getRecordsPerFetch(), ioConfig.getFetchDelayMillis(), 1, ioConfig.isDeaggregate(), tuningConfig.getRecordBufferSize(), tuningConfig.getRecordBufferOfferTimeout(), tuningConfig.getRecordBufferFullWait(), tuningConfig.getFetchSequenceNumberTimeout(), tuningConfig.getMaxRecordsPerPoll(), ioConfig.isUseEarliestSequenceNumber());
}
Also used : KinesisSupervisorIOConfig(org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorIOConfig) KinesisSupervisorTuningConfig(org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorTuningConfig)

Example 2 with KinesisSupervisorTuningConfig

use of org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorTuningConfig in project druid by druid-io.

the class KinesisIndexTaskTuningConfigTest method testConvert.

@Test
public void testConvert() {
    KinesisSupervisorTuningConfig original = new KinesisSupervisorTuningConfig(null, 1, (long) 3, null, 2, 100L, new Period("PT3S"), new File("/tmp/xxx"), 4, new IndexSpec(), new IndexSpec(), true, 5L, true, false, null, null, null, null, null, null, 1000, 500, 500, 6000, 2, null, null, null, null, null, null, null, null);
    KinesisIndexTaskTuningConfig copy = (KinesisIndexTaskTuningConfig) original.convertToTaskTuningConfig();
    Assert.assertEquals(original.getAppendableIndexSpec(), copy.getAppendableIndexSpec());
    Assert.assertEquals(1, copy.getMaxRowsInMemory());
    Assert.assertEquals(3, copy.getMaxBytesInMemory());
    Assert.assertEquals(2, copy.getMaxRowsPerSegment().intValue());
    Assert.assertEquals(100L, (long) copy.getMaxTotalRows());
    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.assertTrue(copy.isReportParseExceptions());
    Assert.assertEquals(5L, copy.getHandoffConditionTimeout());
    Assert.assertEquals(1000, copy.getRecordBufferSize());
    Assert.assertEquals(500, copy.getRecordBufferOfferTimeout());
    Assert.assertEquals(500, copy.getRecordBufferFullWait());
    Assert.assertEquals(6000, copy.getFetchSequenceNumberTimeout());
    Assert.assertEquals(2, (int) copy.getFetchThreads());
    Assert.assertFalse(copy.isSkipSequenceNumberAvailabilityCheck());
    Assert.assertTrue(copy.isResetOffsetAutomatically());
    Assert.assertEquals(100, copy.getMaxRecordsPerPoll());
    Assert.assertEquals(new Period().withDays(Integer.MAX_VALUE), copy.getIntermediateHandoffPeriod());
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) KinesisSupervisorTuningConfig(org.apache.druid.indexing.kinesis.supervisor.KinesisSupervisorTuningConfig) Period(org.joda.time.Period) TestModifiedKinesisIndexTaskTuningConfig(org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig) File(java.io.File) Test(org.junit.Test)

Aggregations

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