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


Java ServerName.getServerName方法代码示例

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


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

示例1: getServerName

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
@Override
public String getServerName() {
  ServerName serverName = master.getServerName();
  if (serverName == null) {
    return "";
  }
  return serverName.getServerName();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:MetricsMasterWrapperImpl.java

示例2: getServerName

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
@Override
public String getServerName() {
  ServerName serverName = regionServer.getServerName();
  if (serverName == null) {
    return "";
  }
  return serverName.getServerName();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:MetricsRegionServerWrapperImpl.java

示例3: testRemoveStaleRecoveringRegionsDuringMasterInitialization

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
@Test
public void testRemoveStaleRecoveringRegionsDuringMasterInitialization() throws Exception {
  // this test is for when distributed log replay is enabled
  if (!UTIL.getConfiguration().getBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, false)) return;
  
  LOG.info("Starting testRemoveStaleRecoveringRegionsDuringMasterInitialization");
  HMaster master = UTIL.getMiniHBaseCluster().getMaster();
  MasterFileSystem fs = master.getMasterFileSystem();

  String failedRegion = "failedRegoin1";
  String staleRegion = "staleRegion";
  ServerName inRecoveryServerName = ServerName.valueOf("mgr,1,1");
  ServerName previouselyFaildServerName = ServerName.valueOf("previous,1,1");
  String walPath = "/hbase/data/.logs/" + inRecoveryServerName.getServerName()
      + "-splitting/test";
  // Create a ZKW to use in the test
  ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(UTIL);
  zkw.getRecoverableZooKeeper().create(ZKSplitLog.getEncodedNodeName(zkw, walPath),
    new SplitLogTask.Owned(inRecoveryServerName, fs.getLogRecoveryMode()).toByteArray(), 
      Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
  String staleRegionPath = ZKUtil.joinZNode(zkw.recoveringRegionsZNode, staleRegion);
  ZKUtil.createWithParents(zkw, staleRegionPath);
  String inRecoveringRegionPath = ZKUtil.joinZNode(zkw.recoveringRegionsZNode, failedRegion);
  inRecoveringRegionPath = ZKUtil.joinZNode(inRecoveringRegionPath, 
    inRecoveryServerName.getServerName());
  ZKUtil.createWithParents(zkw, inRecoveringRegionPath);
  Set<ServerName> servers = new HashSet<ServerName>();
  servers.add(previouselyFaildServerName);
  fs.removeStaleRecoveringRegionsFromZK(servers);

  // verification
  assertFalse(ZKUtil.checkExists(zkw, staleRegionPath) != -1);
  assertTrue(ZKUtil.checkExists(zkw, inRecoveringRegionPath) != -1);
    
  ZKUtil.deleteChildrenRecursively(zkw, zkw.recoveringRegionsZNode);
  ZKUtil.deleteChildrenRecursively(zkw, zkw.splitLogZNode);
  zkw.close();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:39,代码来源:TestMasterFileSystem.java

示例4: updateServerStats

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
public void updateServerStats(ServerName serverName, byte[] regionName,
                              Object r) {
  if (!(r instanceof Result)) {
    return;
  }
  Result result = (Result) r;
  ClientProtos.RegionLoadStats stats = result.getStats();
  if(stats == null){
    return;
  }
  String name = serverName.getServerName() + "," + Bytes.toStringBinary(regionName);
  ConcurrentMap<byte[], RegionStats> rsStats = null;
  if (serverStats.containsKey(serverName)) {
    rsStats = serverStats.get(serverName);
  } else {
    rsStats = serverStats.putIfAbsent(serverName,
        new ConcurrentSkipListMap<byte[], RegionStats>(Bytes.BYTES_COMPARATOR));
    if (rsStats == null) {
      rsStats = serverStats.get(serverName);
    }
  }
  RegionStats regionStats = null;
  if (rsStats.containsKey(regionName)) {
    regionStats = rsStats.get(regionName);
  } else {
    regionStats = rsStats.putIfAbsent(regionName, new RegionStats(this.registry, name));
    if (regionStats == null) {
      regionStats = rsStats.get(regionName);
    }
  }
  regionStats.update(stats);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:33,代码来源:MetricsConnection.java


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