Search in sources :

Example 1 with WorkerCuratorCoordinator

use of io.druid.indexing.worker.WorkerCuratorCoordinator in project druid by druid-io.

the class WorkerResourceTest 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(basePath);
    worker = new Worker("host", "ip", 3, "v1");
    curatorCoordinator = new WorkerCuratorCoordinator(jsonMapper, new IndexerZkConfig(new ZkPathsConfig() {

        @Override
        public String getBase() {
            return basePath;
        }
    }, null, null, null, null, null), new RemoteTaskRunnerConfig(), cf, worker);
    curatorCoordinator.start();
    workerResource = new WorkerResource(worker, curatorCoordinator, null);
}
Also used : IndexerZkConfig(io.druid.server.initialization.IndexerZkConfig) TestingCluster(org.apache.curator.test.TestingCluster) ExponentialBackoffRetry(org.apache.curator.retry.ExponentialBackoffRetry) WorkerCuratorCoordinator(io.druid.indexing.worker.WorkerCuratorCoordinator) ZkPathsConfig(io.druid.server.initialization.ZkPathsConfig) Worker(io.druid.indexing.worker.Worker) PotentiallyGzippedCompressionProvider(io.druid.curator.PotentiallyGzippedCompressionProvider) RemoteTaskRunnerConfig(io.druid.indexing.overlord.config.RemoteTaskRunnerConfig) Before(org.junit.Before)

Aggregations

PotentiallyGzippedCompressionProvider (io.druid.curator.PotentiallyGzippedCompressionProvider)1 RemoteTaskRunnerConfig (io.druid.indexing.overlord.config.RemoteTaskRunnerConfig)1 Worker (io.druid.indexing.worker.Worker)1 WorkerCuratorCoordinator (io.druid.indexing.worker.WorkerCuratorCoordinator)1 IndexerZkConfig (io.druid.server.initialization.IndexerZkConfig)1 ZkPathsConfig (io.druid.server.initialization.ZkPathsConfig)1 ExponentialBackoffRetry (org.apache.curator.retry.ExponentialBackoffRetry)1 TestingCluster (org.apache.curator.test.TestingCluster)1 Before (org.junit.Before)1