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);
}
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)));
}
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);
}
Aggregations