本文整理汇总了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;
}
}
示例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;
}
}
示例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));
}
}
示例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;
}
}