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


Java RegionState.getServerName方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.master.RegionState.getServerName方法的典型用法代码示例。如果您正苦于以下问题:Java RegionState.getServerName方法的具体用法?Java RegionState.getServerName怎么用?Java RegionState.getServerName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.master.RegionState的用法示例。


在下文中一共展示了RegionState.getServerName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
public ServerName getMetaRegionLocation(final ZooKeeperWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:MetaTableLocator.java

示例2: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
@Nullable
public ServerName getMetaRegionLocation(final ZooKeeperWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:15,代码来源:MetaTableLocator.java

示例3: handleMetaRITOnCrashedServer

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Handle RIT of meta region against crashed server.
 * Only used when ServerCrashProcedure is not enabled.
 * See handleRIT in ServerCrashProcedure for similar function.
 *
 * @param serverName Server that has already crashed
 */
public void handleMetaRITOnCrashedServer(ServerName serverName) {
  RegionInfo hri = RegionReplicaUtil
      .getRegionInfoForReplica(RegionInfoBuilder.FIRST_META_REGIONINFO,
          RegionInfo.DEFAULT_REPLICA_ID);
  RegionState regionStateNode = getRegionStates().getRegionState(hri);
  if (regionStateNode == null) {
    LOG.warn("RegionStateNode is null for " + hri);
    return;
  }
  ServerName rsnServerName = regionStateNode.getServerName();
  if (rsnServerName != null && !rsnServerName.equals(serverName)) {
    return;
  } else if (rsnServerName == null) {
    LOG.warn("Empty ServerName in RegionStateNode; proceeding anyways in case latched " +
        "RecoverMetaProcedure so meta latch gets cleaned up.");
  }
  // meta has been assigned to crashed server.
  LOG.info("Meta assigned to crashed " + serverName + "; reassigning...");
  // Handle failure and wake event
  RegionTransitionProcedure rtp = getRegionStates().getRegionTransitionProcedure(hri);
  // Do not need to consider for REGION_TRANSITION_QUEUE step
  if (rtp != null && rtp.isMeta() &&
      rtp.getTransitionState() == RegionTransitionState.REGION_TRANSITION_DISPATCH) {
    LOG.debug("Failing " + rtp.toString());
    rtp.remoteCallFailed(master.getMasterProcedureExecutor().getEnvironment(), serverName,
        new ServerCrashException(rtp.getProcId(), serverName));
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:36,代码来源:AssignmentManager.java

示例4: getMetaRegionLocation

import org.apache.hadoop.hbase.master.RegionState; //导入方法依赖的package包/类
/**
 * Gets the meta region location, if available.  Does not block.
 * @param zkw zookeeper connection to use
 * @return server name or null if we failed to get the data.
 */
public ServerName getMetaRegionLocation(final ZKWatcher zkw) {
  try {
    RegionState state = getMetaRegionState(zkw);
    return state.isOpened() ? state.getServerName() : null;
  } catch (KeeperException ke) {
    return null;
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:14,代码来源:MetaTableLocator.java


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