Package org.apache.hadoop.hbase

Examples of org.apache.hadoop.hbase.HServerInfo


  }

  /** Update a server load information because it's shutting down*/
  private boolean removeServerInfo(final String serverName) {
    boolean infoUpdated = false;
    HServerInfo info = this.serversToServerInfo.remove(serverName);
    // Only update load information once.
    // This method can be called a couple of times during shutdown.
    if (info != null) {
      LOG.info("Removing server's info " + serverName);
      this.master.getRegionManager().offlineMetaServer(info.getServerAddress());

      //HBASE-1928: Check whether this server has been transitioning the ROOT table
      if (this.master.getRegionManager().isRootInTransitionOnThisServer(serverName)) {
         this.master.getRegionManager().unsetRootRegion();
         this.master.getRegionManager().reassignRootRegion();
View Full Code Here


   */
  private 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.serversToServerInfo.get(serverName);
    if (info == null) {
      LOG.warn("No HServerInfo for " + serverName);
      return;
    }
    if (this.deadServers.contains(serverName)) {
View Full Code Here

      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

          }
          // 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

    }
    return result;
  }
 
  private HServerInfo createServerInfoWithNewStartCode(final HServerInfo hsi) {
    return new HServerInfo(hsi.getServerAddress(), hsi.getInfoPort(),
      hsi.getHostname());
  }
View Full Code Here

      for (HServerAddress address : addresses) {
        HRegionInfo[] regions = null;
        try {
          HRegionInterface hri =
            this.connection.getHRegionConnection(address, false);
          HServerInfo info = hri.getHServerInfo();
          LOG.debug("Inspection found server " + info.getServerName());
          this.serverManager.recordNewServer(info, true);
          regions = hri.getRegionsAssignment();
        } catch (IOException e) {
          LOG.error("Failed contacting " + address.toString(), e);
          continue;
View Full Code Here

      }
    }
    if (sa != null && sa.length() > 0) {
      serverName = HServerInfo.getServerName(sa, sc);
    }
    HServerInfo storedInfo = null;
    synchronized (this.master.getRegionManager()) {
      /* We don't assign regions that are offline, in transition or were on
       * a dead server. Regions that were on a dead server will get reassigned
       * by ProcessServerShutdown
       */
 
View Full Code Here

    this.server = HbaseRPC.getServer(this, address.getBindAddress(),
      address.getPort(), conf.getInt("hbase.regionserver.handler.count", 10),
      false, conf);
    // Address is givin a default IP for the moment. Will be changed after
    // calling the master.
    this.serverInfo = new HServerInfo(new HServerAddress(
      new InetSocketAddress(DEFAULT_HOST,
      this.server.getListenerAddress().getPort())), System.currentTimeMillis(),
      this.conf.getInt("hbase.regionserver.info.port", 60030));
    this.numRegionsToReport =                                       
      conf.getInt("hbase.regionserver.numregionstoreport", 10);     
View Full Code Here

   */
  @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

   * @param serverInfo
   * @throws Leases.LeaseStillHeldException
   */
  public void regionServerStartup(final HServerInfo serverInfo)
  throws Leases.LeaseStillHeldException {
    HServerInfo info = new HServerInfo(serverInfo);
    String serverName = HServerInfo.getServerName(info);
    if (serversToServerInfo.containsKey(serverName) ||
        deadServers.contains(serverName)) {
      LOG.debug("Server start was rejected: " + serverInfo);
      LOG.debug("serversToServerInfo.containsKey: " + serversToServerInfo.containsKey(serverName));
      LOG.debug("deadServers.contains: " + deadServers.contains(serverName));
      throw new Leases.LeaseStillHeldException(serverName);
    }
   
    LOG.info("Received start message from: " + serverName);
    // Go on to process the regionserver registration.
    HServerLoad load = serversToLoad.remove(serverName);
    if (load != null) {
      // The startup message was from a known server.
      // Remove stale information about the server's load.
      synchronized (loadToServers) {
        Set<String> servers = loadToServers.get(load);
        if (servers != null) {
          servers.remove(serverName);
          if (servers.size() > 0)
            loadToServers.put(load, servers);
          else
            loadToServers.remove(load);
        }
      }
    }
    HServerInfo storedInfo = serversToServerInfo.remove(serverName);
    if (storedInfo != null && !master.closed.get()) {
      // The startup message was from a known server with the same name.
      // Timeout the old one right away.
      master.getRootRegionLocation();
      try {
View Full Code Here

TOP

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

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.