org.apache.hadoop.hbase.zookeeper.ZKAssign.createNodeOffline()方法的使用及代码示例

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

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

ZKAssign.createNodeOffline介绍

[英]Creates a new unassigned node in the OFFLINE state for the specified region.

Does not transition nodes from other states. If a node already exists for this region, a org.apache.zookeeper.KeeperException.NodeExistsException will be thrown.

Sets a watcher on the unassigned region node if the method is successful.

This method should only be used during cluster startup and the enabling of a table.
[中]为指定区域创建处于脱机状态的新未分配节点。
不从其他状态转换节点。如果此区域已存在节点,则为组织。阿帕奇。动物园管理员。保持异常。将抛出NodeExistsException。
如果方法成功,则在未分配区域节点上设置观察者。
此方法只应在群集启动和启用表期间使用。

代码示例

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Creates a new unassigned node in the OFFLINE state for the specified region.
 *
 * <p>Does not transition nodes from other states.  If a node already exists
 * for this region, a {@link NodeExistsException} will be thrown.
 *
 * <p>Sets a watcher on the unassigned region node if the method is successful.
 *
 * <p>This method should only be used during cluster startup and the enabling
 * of a table.
 *
 * @param zkw zk reference
 * @param region region to be created as offline
 * @param serverName server event originates from
 * @throws KeeperException if unexpected zookeeper exception
 * @throws KeeperException.NodeExistsException if node already exists
 */
public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region,
  ServerName serverName)
throws KeeperException, KeeperException.NodeExistsException {
 createNodeOffline(zkw, region, serverName, EventType.M_ZK_REGION_OFFLINE);
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Creates a new unassigned node in the OFFLINE state for the specified region.
 *
 * <p>Does not transition nodes from other states.  If a node already exists
 * for this region, a {@link org.apache.zookeeper.KeeperException.NodeExistsException} 
 * will be thrown.
 *
 * <p>Sets a watcher on the unassigned region node if the method is successful.
 *
 * <p>This method should only be used during cluster startup and the enabling
 * of a table.
 *
 * @param zkw zk reference
 * @param region region to be created as offline
 * @param serverName server transition will happen on
 * @throws KeeperException if unexpected zookeeper exception
 * @throws KeeperException.NodeExistsException if node already exists
 */
public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region,
  ServerName serverName)
throws KeeperException, KeeperException.NodeExistsException {
 createNodeOffline(zkw, region, serverName, EventType.M_ZK_REGION_OFFLINE);
}

代码示例来源:origin: NGDATA/lilyproject

/**
 * Creates a znode with OPENED state.
 */
public static ZooKeeperWatcher createAndForceNodeToOpenedState(
    HBaseTestingUtility TEST_UTIL, HRegion region,
    ServerName serverName) throws ZooKeeperConnectionException,
    IOException, KeeperException, NodeExistsException {
  ZooKeeperWatcher zkw = getZooKeeperWatcher(TEST_UTIL);
  ZKAssign.createNodeOffline(zkw, region.getRegionInfo(), serverName);
  int version = ZKAssign.transitionNodeOpening(zkw, region
      .getRegionInfo(), serverName);
  ZKAssign.transitionNodeOpened(zkw, region.getRegionInfo(), serverName,
      version);
  return zkw;
}

相关文章