Examples of RegionTransitionData


Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

    // adding region in pending close.
    am.regionsInTransition.put(REGIONINFO.getEncodedName(), new RegionState(REGIONINFO,
        State.SPLITTING, System.currentTimeMillis(), SERVERNAME_A));
    am.getZKTable().setEnabledTable(REGIONINFO.getTableNameAsString());

    RegionTransitionData data = new RegionTransitionData(EventType.RS_ZK_REGION_SPLITTING,
        REGIONINFO.getRegionName(), SERVERNAME_A);
    String node = ZKAssign.getNodeName(this.watcher, REGIONINFO.getEncodedName());
    // create znode in M_ZK_REGION_CLOSING state.
    ZKUtil.createAndWatch(this.watcher, node, data.getBytes());

    try {
      processServerShutdownHandler(ct, am, regionSplitDone, null);
      // check znode deleted or not.
      // In both cases the znode should be deleted.
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

    if (state == TableState.DISABLING) {
      am.getZKTable().setDisablingTable(REGIONINFO.getTableNameAsString());
    } else {
      am.getZKTable().setDisabledTable(REGIONINFO.getTableNameAsString());
    }
    RegionTransitionData data = null;
    if (opening) {
      data =
          new RegionTransitionData(EventType.RS_ZK_REGION_OPENING, REGIONINFO.getRegionName(),
              SERVERNAME_A);

    } else {
      data =
          new RegionTransitionData(EventType.M_ZK_REGION_CLOSING, REGIONINFO.getRegionName(),
              SERVERNAME_A);
    }
    String node = ZKAssign.getNodeName(this.watcher, REGIONINFO.getEncodedName());
    // create znode in M_ZK_REGION_CLOSING state.
    ZKUtil.createAndWatch(this.watcher, node, data.getBytes());

    try {
      processServerShutdownHandler(ct, am, false, null);
      // check znode deleted or not.
      // In both cases the znode should be deleted.
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

  // Copied from SplitTransaction rather than open the method over there in
  // the regionserver package.
  private static int createNodeSplitting(final ZooKeeperWatcher zkw,
      final HRegionInfo region, final ServerName serverName)
  throws KeeperException, IOException {
    RegionTransitionData data =
      new RegionTransitionData(EventType.RS_ZK_REGION_SPLITTING,
        region.getRegionName(), serverName);

    String node = ZKAssign.getNodeName(zkw, region.getEncodedName());
    if (!ZKUtil.createEphemeralNodeAndWatch(zkw, node, data.getBytes())) {
      throw new IOException("Failed create of ephemeral " + node);
    }
    // Transition node from SPLITTING to SPLITTING and pick up version so we
    // can be sure this znode is ours; version is needed deleting.
    return transitionNodeSplitting(zkw, region, serverName, -1);
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

  boolean processRegionInTransition(final String encodedRegionName,
      final HRegionInfo regionInfo,
      final Map<ServerName,List<Pair<HRegionInfo,Result>>> deadServers)
  throws KeeperException, IOException {
    Stat stat = new Stat();
    RegionTransitionData data = ZKAssign.getDataAndWatch(watcher,
        encodedRegionName, stat);
    if (data == null) return false;
    HRegionInfo hri = regionInfo;
    if (hri == null) {
      if ((hri = getHRegionInfo(data)) == null) return false;
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

  @Override
  public void nodeCreated(String path) {
    if(path.startsWith(watcher.assignmentZNode)) {
      try {
        Stat stat = new Stat();
        RegionTransitionData data = ZKAssign.getDataAndWatch(watcher, path, stat);
        if (data == null) {
          return;
        }
        handleRegion(data, stat.getVersion());
      } catch (KeeperException e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

  @Override
  public void nodeDataChanged(String path) {
    if(path.startsWith(watcher.assignmentZNode)) {
      try {
        Stat stat = new Stat();
        RegionTransitionData data = ZKAssign.getDataAndWatch(watcher, path, stat);
        if (data == null) {
          return;
        }
        handleRegion(data, stat.getVersion());
      } catch (KeeperException e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

            watcher.assignmentZNode);
        if (children != null) {
          Stat stat = new Stat();
          for (String child : children) {
            stat.setVersion(0);
            RegionTransitionData data = ZKAssign.getDataAndWatch(watcher,
                ZKUtil.joinZNode(watcher.assignmentZNode, child), stat);
            // See HBASE-7551, handle splitting here as well, in case we miss the node change event
            if (stat.getVersion() > 0 && data.getEventType() == EventType.RS_ZK_REGION_SPLITTING) {
              handleRegion(data, stat.getVersion());
            }
          }
        }
      } catch(KeeperException e) {
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

   */
  private boolean isSplitOrSplitting(final String path) throws KeeperException {
    boolean result = false;
    // This may fail if the SPLIT or SPLITTING znode gets cleaned up before we
    // can get data from it.
    RegionTransitionData data = ZKAssign.getData(master.getZooKeeper(), path);
    EventType evt = data.getEventType();
    switch (evt) {
    case RS_ZK_REGION_SPLIT:
    case RS_ZK_REGION_SPLITTING:
      result = true;
      break;
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

          HRegionInfo regionInfo = region.getFirst();
          Result result = region.getSecond();
          // If region was in transition (was in zk) force it offline for
          // reassign
          try {
            RegionTransitionData data = ZKAssign.getData(watcher,
                regionInfo.getEncodedName());

            // If zk node of this region has been updated by a live server,
            // we consider that this region is being handled.
            // So we should skip it and process it in
            // processRegionsInTransition.
            if (data != null && data.getOrigin() != null &&
                serverManager.isServerOnline(data.getOrigin())) {
              LOG.info("The region " + regionInfo.getEncodedName()
                  + "is being handled on " + data.getOrigin());
              continue;
            }
            // Process with existing RS shutdown code
            boolean assign = ServerShutdownHandler.processDeadRegion(
                regionInfo, result, this, this.catalogTracker);
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.RegionTransitionData

        + regionInfo.getRegionNameAsString());
    // Should have a ZK node in OPENING state
    try {
      String node = ZKAssign.getNodeName(watcher, regionInfo.getEncodedName());
      Stat stat = new Stat();
      RegionTransitionData dataInZNode = ZKAssign.getDataNoWatch(watcher, node,
          stat);
      if (dataInZNode == null) {
        LOG.warn("Data is null, node " + node + " no longer exists");
        return;
      }
      if (dataInZNode.getEventType() == EventType.RS_ZK_REGION_OPENED) {
        LOG.debug("Region has transitioned to OPENED, allowing "
            + "watched event handlers to process");
        return;
      } else if (dataInZNode.getEventType() != EventType.RS_ZK_REGION_OPENING &&
          dataInZNode.getEventType() != EventType.RS_ZK_REGION_FAILED_OPEN ) {
        LOG.warn("While timing out a region in state OPENING, "
            + "found ZK node in unexpected state: "
            + dataInZNode.getEventType());
        return;
      }
      invokeAssign(regionInfo);
    } catch (KeeperException ke) {
      LOG.error("Unexpected ZK exception timing out CLOSING region", ke);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.