当前位置: 首页>>代码示例>>Java>>正文


Java MetaServerShutdownHandler类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler的典型用法代码示例。如果您正苦于以下问题:Java MetaServerShutdownHandler类的具体用法?Java MetaServerShutdownHandler怎么用?Java MetaServerShutdownHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MetaServerShutdownHandler类属于org.apache.hadoop.hbase.master.handler包,在下文中一共展示了MetaServerShutdownHandler类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  boolean carryingRoot = services.getAssignmentManager().isCarryingRoot(serverName);
  if (!services.isServerShutdownHandlerEnabled() && (!carryingRoot || !this.isSSHForRootEnabled)) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.deadNotExpiredServers.add(serverName);
    return;
  }
  if (!this.onlineServers.containsKey(serverName)) {
    LOG.warn("Received expiration of " + serverName +
      " but server is not currently online");
  }
  if (this.deadservers.contains(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Received expiration of " + serverName +
        " but server shutdown is already in progress");
    return;
  }
  // Remove the server from the known servers lists and update load info BUT
  // add to deadservers first; do this so it'll show in dead servers list if
  // not in online servers list.
  this.deadservers.add(serverName);
  this.onlineServers.remove(serverName);
  synchronized (onlineServers) {
    onlineServers.notifyAll();
  }
  this.serverConnections.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingRoot || carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, carryingRoot, carryingMeta));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed, root=" +
      carryingRoot + ", meta=" + carryingMeta);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:51,代码来源:ServerManager.java

示例2: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (serverName.equals(master.getServerName())) {
    if (!(master.isAborted() || master.isStopped())) {
      master.stop("We lost our znode?");
    }
    return;
  }
  if (!services.isServerShutdownHandlerEnabled()) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.queuedDeadServers.add(serverName);
    return;
  }
  if (this.deadservers.isDeadServer(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Expiration of " + serverName +
        " but server shutdown already in progress");
    return;
  }
  synchronized (onlineServers) {
    if (!this.onlineServers.containsKey(serverName)) {
      LOG.warn("Expiration of " + serverName + " but server not online");
    }
    // Remove the server from the known servers lists and update load info BUT
    // add to deadservers first; do this so it'll show in dead servers list if
    // not in online servers list.
    this.deadservers.add(serverName);
    this.onlineServers.remove(serverName);
    onlineServers.notifyAll();
  }
  this.rsAdmins.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);

  // Tell our listeners that a server was removed
  if (!this.listeners.isEmpty()) {
    for (ServerListener listener : this.listeners) {
      listener.serverRemoved(serverName);
    }
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:61,代码来源:ServerManager.java

示例3: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (!services.isServerShutdownHandlerEnabled()) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.queuedDeadServers.add(serverName);
    return;
  }
  if (this.deadservers.isDeadServer(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Expiration of " + serverName +
        " but server shutdown already in progress");
    return;
  }
  synchronized (onlineServers) {
    if (!this.onlineServers.containsKey(serverName)) {
      LOG.warn("Expiration of " + serverName + " but server not online");
    }
    // Remove the server from the known servers lists and update load info BUT
    // add to deadservers first; do this so it'll show in dead servers list if
    // not in online servers list.
    this.deadservers.add(serverName);
    this.onlineServers.remove(serverName);
    onlineServers.notifyAll();
  }
  this.rsAdmins.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);

  // Tell our listeners that a server was removed
  if (!this.listeners.isEmpty()) {
    for (ServerListener listener : this.listeners) {
      listener.serverRemoved(serverName);
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:55,代码来源:ServerManager.java

示例4: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (!this.onlineServers.containsKey(serverName)) {
    LOG.warn("Received expiration of " + serverName +
      " but server is not currently online");
    return;
  }
  if (this.deadservers.contains(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Received expiration of " + serverName +
        " but server shutdown is already in progress");
    return;
  }
  // Remove the server from the known servers lists and update load info BUT
  // add to deadservers first; do this so it'll show in dead servers list if
  // not in online servers list.
  this.deadservers.add(serverName);
  this.onlineServers.remove(serverName);
  this.serverConnections.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingRoot = services.getAssignmentManager().isCarryingRoot(serverName);
  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingRoot || carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, carryingRoot, carryingMeta));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed, root=" +
      carryingRoot + ", meta=" + carryingMeta);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:43,代码来源:ServerManager.java

示例5: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (serverName.equals(master.getServerName())) {
    if (!(master.isAborted() || master.isStopped())) {
      master.stop("We lost our znode?");
    }
    return;
  }
  if (!services.isServerShutdownHandlerEnabled()) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.queuedDeadServers.add(serverName);
    return;
  }
  if (this.deadservers.isDeadServer(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Expiration of " + serverName +
        " but server shutdown already in progress");
    return;
  }
  synchronized (onlineServers) {
    if (!this.onlineServers.containsKey(serverName)) {
      LOG.warn("Expiration of " + serverName + " but server not online");
    }
    // Remove the server from the known servers lists and update load info BUT
    // add to deadservers first; do this so it'll show in dead servers list if
    // not in online servers list.
    this.deadservers.add(serverName);
    this.onlineServers.remove(serverName);
    onlineServers.notifyAll();
  }
  this.rsAdmins.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:54,代码来源:ServerManager.java

示例6: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (!services.isServerShutdownHandlerEnabled()) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.queuedDeadServers.add(serverName);
    return;
  }
  if (!this.onlineServers.containsKey(serverName)) {
    LOG.warn("Expiration of " + serverName +
      " but server not online");
  }
  if (this.deadservers.isDeadServer(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Expiration of " + serverName +
        " but server shutdown already in progress");
    return;
  }
  // Remove the server from the known servers lists and update load info BUT
  // add to deadservers first; do this so it'll show in dead servers list if
  // not in online servers list.
  this.deadservers.add(serverName);
  this.onlineServers.remove(serverName);
  synchronized (onlineServers) {
    onlineServers.notifyAll();
  }
  this.rsAdmins.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:49,代码来源:ServerManager.java

示例7: expireServer

import org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler; //导入依赖的package包/类
public synchronized void expireServer(final ServerName serverName) {
  if (!services.isServerShutdownHandlerEnabled()) {
    LOG.info("Master doesn't enable ServerShutdownHandler during initialization, "
        + "delay expiring server " + serverName);
    this.queuedDeadServers.add(serverName);
    return;
  }
  if (!this.onlineServers.containsKey(serverName)) {
    LOG.warn("Received expiration of " + serverName +
      " but server is not currently online");
  }
  if (this.deadservers.contains(serverName)) {
    // TODO: Can this happen?  It shouldn't be online in this case?
    LOG.warn("Received expiration of " + serverName +
        " but server shutdown is already in progress");
    return;
  }
  // Remove the server from the known servers lists and update load info BUT
  // add to deadservers first; do this so it'll show in dead servers list if
  // not in online servers list.
  this.deadservers.add(serverName);
  this.onlineServers.remove(serverName);
  synchronized (onlineServers) {
    onlineServers.notifyAll();
  }
  this.serverConnections.remove(serverName);
  // If cluster is going down, yes, servers are going to be expiring; don't
  // process as a dead server
  if (this.clusterShutdown) {
    LOG.info("Cluster shutdown set; " + serverName +
      " expired; onlineServers=" + this.onlineServers.size());
    if (this.onlineServers.isEmpty()) {
      master.stop("Cluster shutdown set; onlineServer=0");
    }
    return;
  }

  boolean carryingRoot = services.getAssignmentManager().isCarryingRoot(serverName);
  boolean carryingMeta = services.getAssignmentManager().isCarryingMeta(serverName);
  if (carryingRoot || carryingMeta) {
    this.services.getExecutorService().submit(new MetaServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, carryingRoot, carryingMeta));
  } else {
    this.services.getExecutorService().submit(new ServerShutdownHandler(this.master,
      this.services, this.deadservers, serverName, true));
  }
  LOG.debug("Added=" + serverName +
    " to dead servers, submitted shutdown handler to be executed, root=" +
      carryingRoot + ", meta=" + carryingMeta);
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:51,代码来源:ServerManager.java


注:本文中的org.apache.hadoop.hbase.master.handler.MetaServerShutdownHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。