@Override public ZooKeeperWatcher getZooKeeperWatcher() throws ZooKeeperConnectionException { if (zooKeeper == null) { try { this.zooKeeper = new ZooKeeperWatcher(conf, "fconnection", this); } catch (ZooKeeperConnectionException zce) { throw zce; } catch (IOException e) { throw new ZooKeeperConnectionException("An error is preventing" + " Wasp from connecting to ZooKeeper", e); } } return zooKeeper; }
zkw = new ZooKeeperWatcher(tempConf, "clean znode for master", new Abortable() { @Override
/** * Default constructor. * * @param conf * configuration instance * @throws java.io.IOException */ public FClient(Configuration conf) throws IOException { if (conf == null) { this.connection = null; return; } this.connection = FConnectionManager.getConnection(conf); this.configuration = conf; this.zooKeeper = new ZooKeeperWatcher(configuration, FCLIENT + ":", this); this.fserverTracker = new FClientFServerTracker(zooKeeper); try { this.fserverTracker.start(); } catch (KeeperException e) { throw new IOException(e); } }
/** * Gets a ZooKeeperWatcher. * * @param TEST_UTIL */ public static ZooKeeperWatcher getZooKeeperWatcher( WaspTestingUtility TEST_UTIL) throws ZooKeeperConnectionException, IOException { ZooKeeperWatcher zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(), "unittest", new Abortable() { boolean aborted = false; @Override public void abort(String why, Throwable e) { aborted = true; throw new RuntimeException("Fatal ZK error, why=" + why, e); } @Override public boolean isAborted() { return aborted; } }); return zkw; }
this.zooKeeper = new ZooKeeperWatcher(conf, MASTER + ":" + isa.getPort(), this, true);
/** * @param htu Testing utility to use * @param zkw If true, create a zkw. * @throws com.alibaba.wasp.ZooKeeperConnectionException * @throws java.io.IOException */ public MockServer(final WaspTestingUtility htu, final boolean zkw) throws ZooKeeperConnectionException, IOException { this.htu = htu; this.zk = zkw ? new ZooKeeperWatcher(htu.getConfiguration(), NAME.toString(), this, true) : null; }
this.zooKeeper = new ZooKeeperWatcher(conf, FSERVER + ":" + this.isa.getPort(), this);
HTU.getConfiguration().set(FConstants.ZOOKEEPER_CLIENT_PORT, HTU.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT)); this.watcher = new ZooKeeperWatcher(HTU.getConfiguration(), "mockedServer", this.server, true); Mockito.when(server.getZooKeeper()).thenReturn(this.watcher);
private MiniWaspCluster createEntityGroups(String tableName) throws InterruptedException, ZooKeeperConnectionException, IOException, KeeperException { MiniWaspCluster cluster = TEST_UTIL.getWaspCluster(); log("Waiting for active/ready master"); cluster.waitForActiveAndReadyMaster(); zkw = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(), "testOpenedEntityGroupHandler", null); // Create a table with entityGroups byte[] table = Bytes.toBytes(tableName); byte[] family = Bytes.toBytes("family"); TEST_UTIL.createTable(table); // wait till the entityGroups are online log("Waiting for no more RIT"); ZKAssign.blockUntilNoRIT(zkw); return cluster; }
ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(), "testActiveMasterManagerFromZK", null, true); try {
@Test public void testRestartMaster() throws IOException, KeeperException { ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(), "testActiveMasterManagerFromZK", null, true); try {