Package org.apache.hadoop.hbase.master.handler

Examples of org.apache.hadoop.hbase.master.handler.OpenedRegionHandler


      String nodeName = ZKAssign.getNodeName(zkw, region.getRegionInfo()
          .getEncodedName());
      ZKUtil.getDataAndWatch(zkw, nodeName, stat);

      // use the version for the OpenedRegionHandler
      OpenedRegionHandler handler = new OpenedRegionHandler(server, am, region
          .getRegionInfo(), server.getServerName(), stat.getVersion());
      // Once again overwrite the same znode so that the version changes.
      ZKAssign.transitionNode(zkw, region.getRegionInfo(), server
          .getServerName(), EventType.RS_ZK_REGION_OPENED,
          EventType.RS_ZK_REGION_OPENED, stat.getVersion());

      // Should not invoke assignmentmanager.regionOnline. If it is
      // invoked as per current mocking it will throw null pointer exception.
      boolean expectedException = false;
      try {
        handler.process();
      } catch (Exception e) {
        expectedException = true;
      }
      assertFalse("The process method should not throw any exception.",
          expectedException);
View Full Code Here


      String nodeName = ZKAssign.getNodeName(zkw, region.getRegionInfo()
          .getEncodedName());
      ZKUtil.getDataAndWatch(zkw, nodeName, stat);

      // use the version for the OpenedRegionHandler
      OpenedRegionHandler handler = new OpenedRegionHandler(server, am, region
          .getRegionInfo(), server.getServerName(), stat.getVersion());
      // Once again overwrite the same znode so that the version changes.
      ZKAssign.transitionNode(zkw, region.getRegionInfo(), server
          .getServerName(), EventType.RS_ZK_REGION_OPENED,
          EventType.RS_ZK_REGION_OPENED, stat.getVersion());

      // Should not invoke assignmentmanager.regionOnline. If it is
      // invoked as per current mocking it will throw null pointer exception.
      boolean expectedException = false;
      try {
        handler.process();
      } catch (Exception e) {
        expectedException = true;
      }
      assertFalse("The process method should not throw any exception.",
          expectedException);
View Full Code Here

        } else {
          // Region is opened, insert into RIT and handle it
          // This could be done asynchronously, we would need then to acquire the lock in the
          //  handler.
          regionStates.updateRegionState(rt, RegionState.State.OPEN);
          new OpenedRegionHandler(server, this, regionInfo, sn, expectedVersion).process();
        }
        break;
      case RS_ZK_REGION_SPLITTING:
        if (!serverManager.isServerOnline(sn)) {
          // The regionserver started the split, but died before updating the status.
View Full Code Here

          }
          // Handle OPENED by removing from transition and deleted zk node
          regionState = regionStates.updateRegionState(rt, RegionState.State.OPEN);
          if (regionState != null) {
            failedOpenTracker.remove(encodedName); // reset the count, if any
            new OpenedRegionHandler(
              server, this, regionState.getRegion(), sn, expectedVersion).process();
            openedRegionHandlerCalled.put(regionState.getRegion(), new AtomicBoolean(true));
          }
          break;
View Full Code Here

      case RS_ZK_REGION_OPENED:
        // Region is opened, insert into RIT and handle it
        // This could be done asynchronously, we would need then to acquire the lock in the
        //  handler.
        regionStates.updateRegionState(rt, State.OPEN);
        new OpenedRegionHandler(server, this, regionInfo, sn, expectedVersion).process();
        break;
      case RS_ZK_REQUEST_REGION_SPLIT:
      case RS_ZK_REGION_SPLITTING:
      case RS_ZK_REGION_SPLIT:
        // Splitting region should be online. We could have skipped it during
View Full Code Here

          }
          // Handle OPENED by removing from transition and deleted zk node
          regionState = regionStates.updateRegionState(rt, State.OPEN);
          if (regionState != null) {
            failedOpenTracker.remove(encodedName); // reset the count, if any
            new OpenedRegionHandler(
              server, this, regionState.getRegion(), sn, expectedVersion).process();
            updateOpenedRegionHandlerTracker(regionState.getRegion());
          }
          break;
View Full Code Here

        } else {
          // Region is opened, insert into RIT and handle it
          // This could be done asynchronously, we would need then to acquire the lock in the
          //  handler.
          regionStates.updateRegionState(rt, RegionState.State.OPEN);
          new OpenedRegionHandler(server, this, regionInfo, sn, expectedVersion).process();
        }
        break;
      case RS_ZK_REGION_SPLITTING:
        if (!serverManager.isServerOnline(sn)) {
          // The regionserver started the split, but died before updating the status.
View Full Code Here

          }
          // Handle OPENED by removing from transition and deleted zk node
          regionState = regionStates.updateRegionState(rt, RegionState.State.OPEN);
          if (regionState != null) {
            failedOpenTracker.remove(encodedName); // reset the count, if any
            this.executorService.submit(new OpenedRegionHandler(
              server, this, regionState.getRegion(), sn, expectedVersion));
          }
          break;

        default:
View Full Code Here

            return;
          }
          // Handle OPENED by removing from transition and deleted zk node
          regionState.update(RegionState.State.OPEN, data.getStamp());
          this.executorService.submit(
            new OpenedRegionHandler(master, this, regionState.getRegion(),
              this.serverManager.getServerInfo(data.getServerName())));
          break;
      }
    }
  }
View Full Code Here

          LOG.warn("Region in transition " + regionInfo.getEncodedName() +
            " references a server no longer up " + data.getServerName() +
            "; letting RIT timeout so will be assigned elsewhere");
          break;
        }
        new OpenedRegionHandler(master, this, regionInfo, hsi).process();
        break;
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.master.handler.OpenedRegionHandler

Copyright © 2018 www.massapicom. 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.