Search in sources :

Example 6 with PotentiallyGzippedCompressionProvider

use of org.apache.druid.curator.PotentiallyGzippedCompressionProvider in project druid by druid-io.

the class BatchDataSegmentAnnouncerTest method setUp.

@Before
public void setUp() throws Exception {
    testingCluster = new TestingCluster(1);
    testingCluster.start();
    cf = CuratorFrameworkFactory.builder().connectString(testingCluster.getConnectString()).retryPolicy(new ExponentialBackoffRetry(1, 10)).compressionProvider(new PotentiallyGzippedCompressionProvider(false)).build();
    cf.start();
    cf.blockUntilConnected();
    cf.create().creatingParentsIfNeeded().forPath(TEST_BASE_PATH);
    jsonMapper = TestHelper.makeJsonMapper();
    announcer = new TestAnnouncer(cf, Execs.directExecutor());
    announcer.start();
    segmentReader = new SegmentReader(cf, jsonMapper);
    skipDimensionsAndMetrics = false;
    skipLoadSpec = false;
    segmentAnnouncer = new BatchDataSegmentAnnouncer(new DruidServerMetadata("id", "host", null, Long.MAX_VALUE, ServerType.HISTORICAL, "tier", 0), new BatchDataSegmentAnnouncerConfig() {

        @Override
        public int getSegmentsPerNode() {
            return 50;
        }

        @Override
        public long getMaxBytesPerNode() {
            return maxBytesPerNode.get();
        }

        @Override
        public boolean isSkipDimensionsAndMetrics() {
            return skipDimensionsAndMetrics;
        }

        @Override
        public boolean isSkipLoadSpec() {
            return skipLoadSpec;
        }
    }, new ZkPathsConfig() {

        @Override
        public String getBase() {
            return TEST_BASE_PATH;
        }
    }, announcer, jsonMapper);
    testSegments = new HashSet<>();
    for (int i = 0; i < 100; i++) {
        testSegments.add(makeSegment(i));
    }
    exec = Execs.multiThreaded(NUM_THREADS, "BatchDataSegmentAnnouncerTest-%d");
}
Also used : TestingCluster(org.apache.curator.test.TestingCluster) ExponentialBackoffRetry(org.apache.curator.retry.ExponentialBackoffRetry) ZkPathsConfig(org.apache.druid.server.initialization.ZkPathsConfig) BatchDataSegmentAnnouncerConfig(org.apache.druid.server.initialization.BatchDataSegmentAnnouncerConfig) DruidServerMetadata(org.apache.druid.server.coordination.DruidServerMetadata) PotentiallyGzippedCompressionProvider(org.apache.druid.curator.PotentiallyGzippedCompressionProvider) BatchDataSegmentAnnouncer(org.apache.druid.server.coordination.BatchDataSegmentAnnouncer) Before(org.junit.Before)

Aggregations

PotentiallyGzippedCompressionProvider (org.apache.druid.curator.PotentiallyGzippedCompressionProvider)6 ExponentialBackoffRetry (org.apache.curator.retry.ExponentialBackoffRetry)5 TestingCluster (org.apache.curator.test.TestingCluster)5 ZkPathsConfig (org.apache.druid.server.initialization.ZkPathsConfig)4 Before (org.junit.Before)4 BatchDataSegmentAnnouncer (org.apache.druid.server.coordination.BatchDataSegmentAnnouncer)2 DruidServerMetadata (org.apache.druid.server.coordination.DruidServerMetadata)2 BatchDataSegmentAnnouncerConfig (org.apache.druid.server.initialization.BatchDataSegmentAnnouncerConfig)2 IndexerZkConfig (org.apache.druid.server.initialization.IndexerZkConfig)2 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)1 Predicate (com.google.common.base.Predicate)1 Nullable (javax.annotation.Nullable)1 RetryOneTime (org.apache.curator.retry.RetryOneTime)1 TestingServer (org.apache.curator.test.TestingServer)1 Timing (org.apache.curator.test.Timing)1 BatchServerInventoryView (org.apache.druid.client.BatchServerInventoryView)1 DruidServer (org.apache.druid.client.DruidServer)1 Announcer (org.apache.druid.curator.announcement.Announcer)1 TestRealtimeTask (org.apache.druid.indexing.common.TestRealtimeTask)1 TestRemoteTaskRunnerConfig (org.apache.druid.indexing.overlord.TestRemoteTaskRunnerConfig)1