Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HServerInfo$LoadComparator


   */
  public synchronized void expireServer(final HServerInfo hsi) {
    // First check a server to expire.  ServerName is of the form:
    // <hostname> , <port> , <startcode>
    String serverName = hsi.getServerName();
    HServerInfo info = this.onlineServers.get(serverName);
    if (info == null) {
      LOG.warn("Received expiration of " + hsi.getServerName() +
        " but server is not currently online");
      return;
    }
View Full Code Here


      Stat stat = new Stat();
      String nodeName = ZKAssign.getNodeName(zkw, hri.getEncodedName());
      ZKUtil.getDataAndWatch(zkw, nodeName, stat);
      // use the version for the OpenedRegionHandler
      OpenedRegionHandler handler = new OpenedRegionHandler(server, am, region
          .getRegionInfo(), new HServerInfo(new HServerAddress(
          new InetSocketAddress(1111)), 0, ""), 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,
View Full Code Here

      @Override
      public void stop(String why) {
      }}, null, null, false);

    LOG.debug("regionServerStartup 1");
    HServerInfo hsi1 = new HServerInfo(new HServerAddress("example.org:1234"),
        System.currentTimeMillis(), -1, "example.com");
    sm.regionServerStartup(hsi1, System.currentTimeMillis());

    long maxSkew = 30000;

    try {
      LOG.debug("regionServerStartup 2");
      HServerInfo hsi2 = new HServerInfo(new HServerAddress("example.org:1235"),
        System.currentTimeMillis(), -1, "example.com");
      sm.regionServerStartup(hsi2, System.currentTimeMillis() - maxSkew * 2);
      Assert.assertTrue("HMaster should have thrown an ClockOutOfSyncException "
          + "but didn't.", false);
    } catch(ClockOutOfSyncException e) {
View Full Code Here

        false, conf, QOS_THRESHOLD);
    this.server.setErrorHandler(this);
    this.server.setQosFunction(new QosFunction());

    // HServerInfo can be amended by master.  See below in reportForDuty.
    this.serverInfo = new HServerInfo(new HServerAddress(new InetSocketAddress(
        address.getBindAddress(), this.server.getListenerAddress().getPort())),
        System.currentTimeMillis(), this.conf.getInt(
            "hbase.regionserver.info.port", 60030), machineName);
    if (this.serverInfo.getServerAddress() == null) {
      throw new NullPointerException("Server address cannot be null; "
View Full Code Here

          }
          // auto bind enabled, try to use another port
          LOG.info("Failed binding http info server to port: " + port);
          port++;
          // update HRS server info port.
          this.serverInfo = new HServerInfo(this.serverInfo.getServerAddress(),
            this.serverInfo.getStartCode(), port,
            this.serverInfo.getHostname());
        }
      }
    }
View Full Code Here

      Map<HServerInfo, List<HRegionInfo>> assignments =
        this.assignmentManager.getAssignments();
      // Returned Map from AM does not include mention of servers w/o assignments.
      for (Map.Entry<String, HServerInfo> e:
          this.serverManager.getOnlineServers().entrySet()) {
        HServerInfo hsi = e.getValue();
        if (!assignments.containsKey(hsi)) {
          assignments.put(hsi, new ArrayList<HRegionInfo>());
        }
      }
      List<RegionPlan> plans = this.balancer.balanceCluster(assignments);
View Full Code Here

    Pair<HRegionInfo, HServerInfo> p =
      this.assignmentManager.getAssignment(encodedRegionName);
    if (p == null)
      throw new UnknownRegionException(Bytes.toStringBinary(encodedRegionName));
    HRegionInfo hri = p.getFirst();
    HServerInfo dest = null;
    if (destServerName == null || destServerName.length == 0) {
      LOG.info("Passed destination servername is null/empty so " +
        "choosing a server at random");
      this.assignmentManager.clearRegionPlan(hri);
      // Unassign will reassign it elsewhere choosing random server.
View Full Code Here

    // TODO: Regions that have a null location and are not in regionsInTransitions
    // need to be handled.

    // Add -ROOT- and .META. on regions map.  They must be deployed if we got
    // this far.  Caller takes care of it.
    HServerInfo hsi =
      this.serverManager.getHServerInfo(this.catalogTracker.getMetaLocation());
    regionOnline(HRegionInfo.FIRST_META_REGIONINFO, hsi);
    hsi = this.serverManager.getHServerInfo(this.catalogTracker.getRootLocation());
    regionOnline(HRegionInfo.ROOT_REGIONINFO, hsi);
View Full Code Here

            && (isOnDeadServer(regionInfo, deadServers)
                || regionInfo.isMetaRegion() || regionInfo.isRootRegion())) {
          // If was on a dead server, then its not open any more; needs handling.
          forceOffline(regionInfo, data);
        } else {
          HServerInfo hsi = this.serverManager.getServerInfo(sn);
          if (hsi == null) {
            LOG.info("Failed to find " + sn +
              " in list of online servers; skipping registration of open of " +
              regionInfo.getRegionNameAsString());
          } else {
View Full Code Here

        this.regionsInTransition.notifyAll();
      }
    }
    synchronized (this.regions) {
      // Add check
      HServerInfo hsi = this.regions.get(regionInfo);
      if (hsi != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() +
        " on " + hsi);
     
      HServerInfo hsiWithoutLoad = new HServerInfo(
        serverInfo.getServerAddress(), serverInfo.getStartCode(),
        serverInfo.getInfoPort(), serverInfo.getHostname());
     
      if (isServerOnline(hsiWithoutLoad.getServerName())) {
        this.regions.put(regionInfo, hsiWithoutLoad);
        addToServers(hsiWithoutLoad, regionInfo);
        this.regions.notifyAll();
      } else {
        LOG.info("The server is not in online servers, ServerName=" +
          hsiWithoutLoad.getServerName() + ", region=" +
          regionInfo.getEncodedName());
      }
    }
    // Remove plan if one.
    clearRegionPlan(regionInfo);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.HServerInfo$LoadComparator

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.