com.alibaba.wasp.zookeeper.ZooKeeperWatcher.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中com.alibaba.wasp.zookeeper.ZooKeeperWatcher.<init>()方法的一些代码示例,展示了ZooKeeperWatcher.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.<init>()方法的具体详情如下:
包路径:com.alibaba.wasp.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:<init>

ZooKeeperWatcher.<init>介绍

[英]Instantiate a ZooKeeper connection and watcher.
[中]实例化ZooKeeper连接和监视程序。

代码示例

代码示例来源:origin: alibaba/wasp

@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;
}

代码示例来源:origin: alibaba/wasp

zkw = new ZooKeeperWatcher(tempConf, "clean znode for master",
  new Abortable() {
   @Override

代码示例来源:origin: alibaba/wasp

/**
 * 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);
 }
}

代码示例来源:origin: alibaba/wasp

/**
 * 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;
}

代码示例来源:origin: alibaba/wasp

this.zooKeeper = new ZooKeeperWatcher(conf, MASTER + ":" + isa.getPort(),
  this, true);

代码示例来源:origin: alibaba/wasp

/**
 * @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;
}

代码示例来源:origin: alibaba/wasp

this.zooKeeper = new ZooKeeperWatcher(conf, FSERVER + ":"
  + this.isa.getPort(), this);

代码示例来源:origin: alibaba/wasp

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

代码示例来源:origin: alibaba/wasp

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

代码示例来源:origin: alibaba/wasp

ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
  "testActiveMasterManagerFromZK", null, true);
try {

代码示例来源:origin: alibaba/wasp

@Test
public void testRestartMaster() throws IOException, KeeperException {
 ZooKeeperWatcher zk = new ZooKeeperWatcher(TEST_UTIL.getConfiguration(),
   "testActiveMasterManagerFromZK", null, true);
 try {

相关文章