本文整理汇总了Java中org.apache.hadoop.hbase.master.HMaster.getServerName方法的典型用法代码示例。如果您正苦于以下问题:Java HMaster.getServerName方法的具体用法?Java HMaster.getServerName怎么用?Java HMaster.getServerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.master.HMaster
的用法示例。
在下文中一共展示了HMaster.getServerName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getServerHoldingRegion
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
@Override
public ServerName getServerHoldingRegion(final TableName tn, byte[] regionName)
throws IOException {
// Assume there is only one master thread which is the active master.
// If there are multiple master threads, the backup master threads
// should hold some regions. Please refer to #countServedRegions
// to see how we find out all regions.
HMaster master = getMaster();
Region region = master.getOnlineRegion(regionName);
if (region != null) {
return master.getServerName();
}
int index = getServerWith(regionName);
if (index < 0) {
return null;
}
return getRegionServer(index).getServerName();
}
示例2: getServerHoldingRegion
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
@Override
public ServerName getServerHoldingRegion(final TableName tn, byte[] regionName)
throws IOException {
// Assume there is only one master thread which is the active master.
// If there are multiple master threads, the backup master threads
// should hold some regions. Please refer to #countServedRegions
// to see how we find out all regions.
HMaster master = getMaster();
HRegion region = master.getOnlineRegion(regionName);
if (region != null) {
return master.getServerName();
}
int index = getServerWith(regionName);
if (index < 0) {
return null;
}
return getRegionServer(index).getServerName();
}
示例3: stopMasterAndAssignMeta
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public static void stopMasterAndAssignMeta(HBaseTestingUtility HTU)
throws NodeExistsException, KeeperException, IOException, InterruptedException {
// Stop master
HMaster master = HTU.getHBaseCluster().getMaster();
Thread masterThread = HTU.getHBaseCluster().getMasterThread();
ServerName masterAddr = master.getServerName();
master.stopMaster();
LOG.info("Waiting until master thread exits");
while (masterThread != null && masterThread.isAlive()) {
Threads.sleep(100);
}
}
示例4: ClusterStatusChore
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public ClusterStatusChore(HMaster master, LoadBalancer balancer) {
super(master.getServerName() + "-ClusterStatusChore",
master.getConfiguration().getInt("hbase.balancer.statusPeriod", 60000),
master);
this.master = master;
this.balancer = balancer;
}
示例5: ClusterStatusChore
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public ClusterStatusChore(HMaster master, LoadBalancer balancer) {
super(master.getServerName() + "-ClusterStatusChore", master, master.getConfiguration().getInt(
"hbase.balancer.statusPeriod", 60000));
this.master = master;
this.balancer = balancer;
}
示例6: BalancerChore
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public BalancerChore(HMaster master) {
super(master.getServerName() + "-BalancerChore", master, master.getConfiguration().getInt(
"hbase.balancer.period", 300000));
this.master = master;
}
示例7: RegionNormalizerChore
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public RegionNormalizerChore(HMaster master) {
super(master.getServerName() + "-RegionNormalizerChore", master,
master.getConfiguration().getInt("hbase.normalizer.period", 300000));
this.master = master;
}
示例8: MasterThread
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public MasterThread(final HMaster m, final int index) {
super(m, "Master:" + index + ";" + m.getServerName());
this.master = m;
}
示例9: BalancerChore
import org.apache.hadoop.hbase.master.HMaster; //导入方法依赖的package包/类
public BalancerChore(HMaster master) {
super(master.getServerName() + "-BalancerChore",
master.getConfiguration().getInt("hbase.balancer.period", 300000),
master);
this.master = master;
}