Search in sources :

Example 1 with ZooKeeperUtil

use of org.apache.bookkeeper.test.ZooKeeperUtil in project bookkeeper by apache.

the class TestLongZkLedgerIdGenerator method setUp.

@Override
@Before
public void setUp() throws Exception {
    LOG.info("Setting up test");
    super.setUp();
    zkutil = new ZooKeeperUtil();
    zkutil.startServer();
    zk = zkutil.getZooKeeperClient();
    ZkLedgerIdGenerator shortLedgerIdGenerator = new ZkLedgerIdGenerator(zk, "/test-zk-ledger-id-generator", "idgen", ZooDefs.Ids.OPEN_ACL_UNSAFE);
    ledgerIdGenerator = new LongZkLedgerIdGenerator(zk, "/test-zk-ledger-id-generator", "idgen-long", shortLedgerIdGenerator, ZooDefs.Ids.OPEN_ACL_UNSAFE);
}
Also used : ZooKeeperUtil(org.apache.bookkeeper.test.ZooKeeperUtil) Before(org.junit.Before)

Example 2 with ZooKeeperUtil

use of org.apache.bookkeeper.test.ZooKeeperUtil in project bookkeeper by apache.

the class TestLedgerUnderreplicationManager method setupZooKeeper.

@Before
public void setupZooKeeper() throws Exception {
    zkUtil = new ZooKeeperUtil();
    zkUtil.startServer();
    conf = TestBKConfiguration.newServerConfiguration();
    conf.setZkServers(zkUtil.getZooKeeperConnectString());
    executor = Executors.newCachedThreadPool();
    zkc1 = ZooKeeperClient.newBuilder().connectString(zkUtil.getZooKeeperConnectString()).sessionTimeoutMs(10000).build();
    zkc2 = ZooKeeperClient.newBuilder().connectString(zkUtil.getZooKeeperConnectString()).sessionTimeoutMs(10000).build();
    basePath = conf.getZkLedgersRootPath() + '/' + BookKeeperConstants.UNDER_REPLICATION_NODE;
    urLedgerPath = basePath + BookKeeperConstants.DEFAULT_ZK_LEDGERS_ROOT_PATH;
    lmf1 = AbstractZkLedgerManagerFactory.newLedgerManagerFactory(conf, new ZkLayoutManager(zkc1, conf.getZkLedgersRootPath(), ZkUtils.getACLs(conf)));
    lmf2 = AbstractZkLedgerManagerFactory.newLedgerManagerFactory(conf, new ZkLayoutManager(zkc2, conf.getZkLedgersRootPath(), ZkUtils.getACLs(conf)));
}
Also used : ZooKeeperUtil(org.apache.bookkeeper.test.ZooKeeperUtil) ZkLayoutManager(org.apache.bookkeeper.meta.ZkLayoutManager) Before(org.junit.Before)

Example 3 with ZooKeeperUtil

use of org.apache.bookkeeper.test.ZooKeeperUtil in project bookkeeper by apache.

the class TestZkLedgerIdGenerator method setUp.

@Override
@Before
public void setUp() throws Exception {
    LOG.info("Setting up test");
    super.setUp();
    zkutil = new ZooKeeperUtil();
    zkutil.startServer();
    zk = zkutil.getZooKeeperClient();
    ledgerIdGenerator = new ZkLedgerIdGenerator(zk, "/test-zk-ledger-id-generator", "idgen", ZooDefs.Ids.OPEN_ACL_UNSAFE);
}
Also used : ZooKeeperUtil(org.apache.bookkeeper.test.ZooKeeperUtil) Before(org.junit.Before)

Aggregations

ZooKeeperUtil (org.apache.bookkeeper.test.ZooKeeperUtil)3 Before (org.junit.Before)3 ZkLayoutManager (org.apache.bookkeeper.meta.ZkLayoutManager)1