Examples of HServerInfo


Examples of org.apache.hadoop.hbase.HServerInfo

      // happen after check of MSG_REPORT_EXITING above, since region server
      // will send us one of these messages after it gets MSG_REGIONSERVER_STOP
      return new HMsg [] {HMsg.REGIONSERVER_STOP};
    }

    HServerInfo storedInfo = serversToServerInfo.get(serverName);
    if (storedInfo == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("received server report from unknown server: " + serverName);
      }

      // The HBaseMaster may have been restarted.
      // Tell the RegionServer to start over and call regionServerStartup()
      return new HMsg[]{HMsg.CALL_SERVER_STARTUP};
    } else if (storedInfo.getStartCode() != serverInfo.getStartCode()) {
      // This state is reachable if:
      //
      // 1) RegionServer A started
      // 2) RegionServer B started on the same machine, then
      //    clobbered A in regionServerStartup.
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

  }
 
  /** Cancel a server's lease and update its load information */
  private boolean cancelLease(final String serverName) {
    boolean leaseCancelled = false;
    HServerInfo info = serversToServerInfo.remove(serverName);
    if (info != null) {
      // Only cancel lease and update load information once.
      // This method can be called a couple of times during shutdown.
      if (master.getRootRegionLocation() != null &&
        info.getServerAddress().equals(master.getRootRegionLocation())) {
        master.regionManager.unassignRootRegion();
      }
      LOG.info("Cancelling lease for " + serverName);
      try {
        serverLeases.cancelLease(serverName);
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

    /** {@inheritDoc} */
    public void leaseExpired() {
      LOG.info(server + " lease expired");
      // Remove the server from the known servers list and update load info
      HServerInfo info = serversToServerInfo.remove(server);
      if (info != null) {
        HServerAddress root = master.getRootRegionLocation();
        if (root != null && root.equals(info.getServerAddress())) {
          master.regionManager.unassignRootRegion();
        }
        String serverName = info.getServerAddress().toString();
        HServerLoad load = serversToLoad.remove(serverName);
        if (load != null) {
          synchronized (loadToServers) {
            Set<String> servers = loadToServers.get(load);
            if (servers != null) {
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

      regionManager.noLongerUnassigned(info);
      regionManager.noLongerPending(info.getRegionName());
      return;
    }
    HServerInfo storedInfo = null;
    boolean deadServer = false;
    if (serverName.length() != 0) {
     
      if (regionManager.isMarkedToClose(serverName, info.getRegionName())) {
        // Skip if region is on kill list
        if(LOG.isDebugEnabled()) {
          LOG.debug("not assigning region (on kill list): " +
            info.getRegionNameAsString());
        }
        return;
      }
     
      storedInfo = master.serverManager.getServerInfo(serverName);
      deadServer = master.serverManager.isDead(serverName);
    }

    /*
     * If the server is a dead server or its startcode is off -- either null
     * or doesn't match the start code for the address -- then add it to the
     * list of unassigned regions IF not already there (or pending open).
     */
    if (!deadServer && !regionManager.isUnassigned(info) &&
          !regionManager.isPending(info.getRegionName())
        && (storedInfo == null || storedInfo.getStartCode() != startCode)) {
      // The current assignment is invalid
      if (LOG.isDebugEnabled()) {
        LOG.debug("Current assignment of " +
          info.getRegionNameAsString() +
          " is not valid: serverInfo: " + storedInfo + ", passed startCode: " +
          startCode + ", storedInfo.startCode: " +
          ((storedInfo != null)? storedInfo.getStartCode(): -1) +
          ", unassignedRegions: " +
          regionManager.isUnassigned(info) +
          ", pendingRegions: " +
          regionManager.isPending(info.getRegionName()));
      }
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

      address.getPort(), conf.getInt("hbase.regionserver.handler.count", 10),
      false, conf);
    this.server.setErrorHandler(this);
    // Address is giving a default IP for the moment. Will be changed after
    // calling the master.
    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

Examples of org.apache.hadoop.hbase.HServerInfo

   */
  @Override
  @QosPriority(priority=HConstants.HIGH_QOS)
  public HServerInfo getHServerInfo() throws IOException {
    checkOpen();
    return new HServerInfo(new HServerAddress(this.isa),
      this.startcode, this.rsInfo.getInfoPort());
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

   */
  @Override
  @QosPriority(priority=HConstants.HIGH_QOS)
  public HServerInfo getHServerInfo() throws IOException {
    checkOpen();
    return new HServerInfo(new HServerAddress(this.isa),
      this.startcode, this.rsInfo.getInfoPort());
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

   */
  @Override
  @QosPriority(priority=HConstants.HIGH_QOS)
  public HServerInfo getHServerInfo() throws IOException {
    checkOpen();
    return new HServerInfo(new HServerAddress(this.isa),
      this.startcode, this.rsInfo.getInfoPort());
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

   */
  @Override
  @QosPriority(priority=HConstants.HIGH_QOS)
  public HServerInfo getHServerInfo() throws IOException {
    checkOpen();
    return new HServerInfo(new HServerAddress(this.isa),
      this.startcode, this.webuiport);
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.HServerInfo

    // not yet run, or from a server whose fail we are currently processing.
    // Test its host+port combo is present in serverAddresstoServerInfo.  If it
    // is, reject the server and trigger its expiration. The next time it comes
    // in, it should have been removed from serverAddressToServerInfo and queued
    // for processing by ProcessServerShutdown.
    HServerInfo info = new HServerInfo(serverInfo);
    String hostAndPort = info.getServerAddress().toString();
    HServerInfo existingServer = haveServerWithSameHostAndPortAlready(info.getHostnamePort());
    if (existingServer != null) {
      String message = "Server start rejected; we already have " + hostAndPort +
        " registered; existingServer=" + existingServer + ", newServer=" + info;
      LOG.info(message);
      if (existingServer.getStartCode() < info.getStartCode()) {
        LOG.info("Triggering server recovery; existingServer looks stale");
        expireServer(existingServer);
      }
      throw new PleaseHoldException(message);
    }
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.