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

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


          hri = checkIfInFailover(regionState, encodedName, data);
          if (hri != null) {
            regionState = new RegionState(hri, RegionState.State.OPEN, data
                .getStamp(), data.getOrigin());
            regionsInTransition.put(encodedName, regionState);
            new OpenedRegionHandler(master, this, regionState.getRegion(), data
              .getOrigin(), expectedVersion).process();
            failoverProcessedRegions.put(encodedName, hri);
            break;
          }
          // Should see OPENED after OPENING but possible after PENDING_OPEN
          if (regionState == null ||
              (!regionState.isOffline() && !regionState.isPendingOpen() && !regionState.isOpening())) {
            LOG.warn("Received OPENED for region " +
                prettyPrintedRegionName +
                " from server " + data.getOrigin() + " but region was in " +
                " the state " + regionState + " and not " +
                "in expected OFFLINE, PENDING_OPEN or OPENING states");
            return;
          }
          // Handle OPENED by removing from transition and deleted zk node
          regionState.update(RegionState.State.OPEN,
              data.getStamp(), data.getOrigin());
          this.executorService.submit(
            new OpenedRegionHandler(master, this, regionState.getRegion(),
              data.getOrigin(), expectedVersion));
          break;
      }
    }
  }
View Full Code Here


      OpenRegionCoordination orc = csm.getOpenRegionCoordination();
      ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd =
        new ZkOpenRegionCoordination.ZkOpenRegionDetails();
      zkOrd.setServerName(server.getServerName());
      zkOrd.setVersion(stat.getVersion());
      OpenedRegionHandler handler = new OpenedRegionHandler(server, am, region
          .getRegionInfo(), orc, zkOrd);
      // 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

      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

      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

          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

            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

      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

          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

            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

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.