当前位置: 首页>>代码示例>>Java>>正文


Java ZKAssign.deleteNode方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.zookeeper.ZKAssign.deleteNode方法的典型用法代码示例。如果您正苦于以下问题:Java ZKAssign.deleteNode方法的具体用法?Java ZKAssign.deleteNode怎么用?Java ZKAssign.deleteNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.zookeeper.ZKAssign的用法示例。


在下文中一共展示了ZKAssign.deleteNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteNodeInStates

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private boolean deleteNodeInStates(String encodedName,
    String desc, ServerName sn, EventType... types) {
  try {
    for (EventType et: types) {
      if (ZKAssign.deleteNode(watcher, encodedName, et, sn)) {
        return true;
      }
    }
    LOG.info("Failed to delete the " + desc + " node for "
      + encodedName + ". The node type may not match");
  } catch (NoNodeException e) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("The " + desc + " node for " + encodedName + " already deleted");
    }
  } catch (KeeperException ke) {
    server.abort("Unexpected ZK exception deleting " + desc
      + " node for the region " + encodedName, ke);
  }
  return false;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:21,代码来源:AssignmentManager.java

示例2: OpenRegion

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private void OpenRegion(Server server, RegionServerServices rss,
    HTableDescriptor htd, HRegionInfo hri, OpenRegionCoordination coordination)
throws IOException, NodeExistsException, KeeperException, DeserializationException {
  // Create it OFFLINE node, which is what Master set before sending OPEN RPC
  ZKAssign.createNodeOffline(server.getZooKeeper(), hri, server.getServerName());

  OpenRegionCoordination.OpenRegionDetails ord =
    coordination.getDetailsForNonCoordinatedOpening();
  OpenRegionHandler openHandler =
    new OpenRegionHandler(server, rss, hri, htd, -1, coordination, ord);
  rss.getRegionsInTransitionInRS().put(hri.getEncodedNameAsBytes(), Boolean.TRUE);
  openHandler.process();
  // This parse is not used?
  RegionTransition.parseFrom(ZKAssign.getData(server.getZooKeeper(), hri.getEncodedName()));
  // delete the node, which is what Master do after the region is opened
  ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
    EventType.RS_ZK_REGION_OPENED, server.getServerName());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TestCloseRegionHandler.java

示例3: OpenRegion

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private void OpenRegion(Server server, RegionServerServices rss,
      HTableDescriptor htd, HRegionInfo hri)
      throws IOException, NodeExistsException, KeeperException {
      // Create it OFFLINE node, which is what Master set before sending OPEN RPC


  ZKAssign.createNodeOffline(server.getZooKeeper(), hri, server.getServerName());
  int version = ZKAssign.transitionNodeOpening(server.getZooKeeper(), hri, server.getServerName());
  OpenRegionHandler openHandler = new OpenRegionHandler(server, rss, hri, htd, version);
  openHandler.process();
  RegionTransitionData data = ZKAssign.getData(server.getZooKeeper(), hri.getEncodedName());

  // delete the node, which is what Master do after the region is opened
  ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
    EventType.RS_ZK_REGION_OPENED);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:17,代码来源:TestCloseRegionHandler.java

示例4: OpenRegion

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private void OpenRegion(Server server, RegionServerServices rss,
    HTableDescriptor htd, HRegionInfo hri, OpenRegionCoordination coordination)
throws IOException, NodeExistsException, KeeperException, DeserializationException {
  // Create it OFFLINE node, which is what Master set before sending OPEN RPC
  ZKAssign.createNodeOffline(server.getZooKeeper(), hri, server.getServerName());

  OpenRegionCoordination.OpenRegionDetails ord =
    coordination.getDetailsForNonCoordinatedOpening();
  OpenRegionHandler openHandler =
    new OpenRegionHandler(server, rss, hri, htd, coordination, ord);
  rss.getRegionsInTransitionInRS().put(hri.getEncodedNameAsBytes(), Boolean.TRUE);
  openHandler.process();
  // This parse is not used?
  RegionTransition.parseFrom(ZKAssign.getData(server.getZooKeeper(), hri.getEncodedName()));
  // delete the node, which is what Master do after the region is opened
  ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
    EventType.RS_ZK_REGION_OPENED, server.getServerName());
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:19,代码来源:TestCloseRegionHandler.java

示例5: process

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
@Override
public void process() {
  String encodedRegionName = this.parent.getEncodedName();
  LOG.debug("Handling SPLIT event for " + encodedRegionName +
    "; deleting node");
  // The below is for testing ONLY!  We can't do fault injection easily, so
  // resort to this kinda uglyness -- St.Ack 02/25/2011.
  if (TEST_SKIP) {
    LOG.warn("Skipping split message, TEST_SKIP is set");
    return;
  }
  this.assignmentManager.handleSplitReport(this.sn, this.parent,
    this.daughters.get(0), this.daughters.get(1));
  // Remove region from ZK
  try {

    boolean successful = false;
    while (!successful) {
      // It's possible that the RS tickles in between the reading of the
      // znode and the deleting, so it's safe to retry.
      successful = ZKAssign.deleteNode(this.server.getZooKeeper(),
        encodedRegionName,
        EventHandler.EventType.RS_ZK_REGION_SPLIT);
    }
  } catch (KeeperException e) {
    if (e instanceof NoNodeException) {
      String znodePath = ZKUtil.joinZNode(
          this.server.getZooKeeper().splitLogZNode, encodedRegionName);
      LOG.debug("The znode " + znodePath
          + " does not exist.  May be deleted already.");
    } else {
      server.abort("Error deleting SPLIT node in ZK for transition ZK node (" +
          parent.getEncodedName() + ")", e);
    }
  }
  LOG.info("Handled SPLIT event; parent=" +
    this.parent.getRegionNameAsString() +
    " daughter a=" + this.daughters.get(0).getRegionNameAsString() +
    "daughter b=" + this.daughters.get(1).getRegionNameAsString());
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:41,代码来源:SplitRegionHandler.java

示例6: cleanZK

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private static void cleanZK(final Server server, final HRegionInfo hri) {
  try {
    // Only delete if its in expected state; could have been hijacked.
    ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
      EventType.RS_ZK_REGION_SPLITTING);
  } catch (KeeperException e) {
    server.abort("Failed cleanup of " + hri.getRegionNameAsString(), e);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:10,代码来源:SplitTransaction.java

示例7: OpenRegion

import org.apache.hadoop.hbase.zookeeper.ZKAssign; //导入方法依赖的package包/类
private void OpenRegion(Server server, RegionServerServices rss,
    HTableDescriptor htd, HRegionInfo hri)
throws IOException, NodeExistsException, KeeperException, DeserializationException {
  // Create it OFFLINE node, which is what Master set before sending OPEN RPC
  ZKAssign.createNodeOffline(server.getZooKeeper(), hri, server.getServerName());
  OpenRegionHandler openHandler = new OpenRegionHandler(server, rss, hri, htd);
  rss.getRegionsInTransitionInRS().put(hri.getEncodedNameAsBytes(), Boolean.TRUE);
  openHandler.process();
  // This parse is not used?
  RegionTransition.parseFrom(ZKAssign.getData(server.getZooKeeper(), hri.getEncodedName()));
  // delete the node, which is what Master do after the region is opened
  ZKAssign.deleteNode(server.getZooKeeper(), hri.getEncodedName(),
    EventType.RS_ZK_REGION_OPENED, server.getServerName());
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:15,代码来源:TestCloseRegionHandler.java


注:本文中的org.apache.hadoop.hbase.zookeeper.ZKAssign.deleteNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。