Search in sources :

Example 11 with DefaultZooKeeperClient

use of com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient in project helios by spotify.

the class TaskHistoryWriterTest method setUp.

@Before
public void setUp() throws Exception {
    zk = new ZooKeeperTestingServerManager();
    agentStateDirs = Files.createTempDirectory("helios-agents");
    client = new DefaultZooKeeperClient(zk.curatorWithSuperAuth());
    makeWriter(client);
    final ZooKeeperClientProvider zkProvider = new ZooKeeperClientProvider(client, ZooKeeperModelReporter.noop());
    final List<EventSender> eventSenders = Collections.emptyList();
    masterModel = new ZooKeeperMasterModel(zkProvider, "test", eventSenders, TaskStatusEvent.TASK_STATUS_EVENT_TOPIC);
    client.ensurePath(Paths.configJobs());
    client.ensurePath(Paths.configJobRefs());
    client.ensurePath(Paths.historyJobHostEvents(JOB_ID, HOSTNAME));
    masterModel.registerHost(HOSTNAME, "foo");
    masterModel.addJob(JOB);
}
Also used : ZooKeeperClientProvider(com.spotify.helios.servicescommon.coordination.ZooKeeperClientProvider) EventSender(com.spotify.helios.servicescommon.EventSender) ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) ZooKeeperMasterModel(com.spotify.helios.master.ZooKeeperMasterModel) DefaultZooKeeperClient(com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient) Before(org.junit.Before)

Example 12 with DefaultZooKeeperClient

use of com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient in project helios by spotify.

the class ZooKeeperRegistrarServiceUtilTest method setUp.

@Before
public void setUp() throws Exception {
    testingServerManager = new ZooKeeperTestingServerManager();
    testingServerManager.awaitUp(5, TimeUnit.SECONDS);
    zkClient = new DefaultZooKeeperClient(testingServerManager.curatorWithSuperAuth());
}
Also used : ZooKeeperTestingServerManager(com.spotify.helios.ZooKeeperTestingServerManager) DefaultZooKeeperClient(com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient) Before(org.junit.Before)

Aggregations

DefaultZooKeeperClient (com.spotify.helios.servicescommon.coordination.DefaultZooKeeperClient)12 ZooKeeperClient (com.spotify.helios.servicescommon.coordination.ZooKeeperClient)7 CuratorFramework (org.apache.curator.framework.CuratorFramework)6 ExponentialBackoffRetry (org.apache.curator.retry.ExponentialBackoffRetry)6 Before (org.junit.Before)5 ZooKeeperClientProvider (com.spotify.helios.servicescommon.coordination.ZooKeeperClientProvider)4 RetryPolicy (org.apache.curator.RetryPolicy)4 Test (org.junit.Test)4 ZooKeeperMasterModel (com.spotify.helios.master.ZooKeeperMasterModel)3 EventSender (com.spotify.helios.servicescommon.EventSender)3 AuthInfo (org.apache.curator.framework.AuthInfo)3 ACLProvider (org.apache.curator.framework.api.ACLProvider)3 ZooKeeperTestingServerManager (com.spotify.helios.ZooKeeperTestingServerManager)2 HeliosRuntimeException (com.spotify.helios.common.HeliosRuntimeException)2 JobId (com.spotify.helios.common.descriptors.JobId)2 JobDeleteResponse (com.spotify.helios.common.protocol.JobDeleteResponse)2 CuratorClientFactoryImpl (com.spotify.helios.servicescommon.coordination.CuratorClientFactoryImpl)2 ACL (org.apache.zookeeper.data.ACL)2 HeliosClient (com.spotify.helios.client.HeliosClient)1 SystemClock (com.spotify.helios.common.SystemClock)1