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


Java ServerName.toString方法代码示例

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


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

示例1: sendRegionsMerge

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
/**
 * Sends an MERGE REGIONS RPC to the specified server to merge the specified
 * regions.
 * <p>
 * A region server could reject the close request because it either does not
 * have the specified region.
 * @param server server to merge regions
 * @param region_a region to merge
 * @param region_b region to merge
 * @param forcible true if do a compulsory merge, otherwise we will only merge
 *          two adjacent regions
 * @throws IOException
 */
public void sendRegionsMerge(ServerName server, HRegionInfo region_a,
    HRegionInfo region_b, boolean forcible) throws IOException {
  if (server == null)
    throw new NullPointerException("Passed server is null");
  if (region_a == null || region_b == null)
    throw new NullPointerException("Passed region is null");
  AdminService.BlockingInterface admin = getRsAdmin(server);
  if (admin == null) {
    throw new IOException("Attempting to send MERGE REGIONS RPC to server "
        + server.toString() + " for region "
        + region_a.getRegionNameAsString() + ","
        + region_b.getRegionNameAsString()
        + " failed because no RPC connection found to this server");
  }
  PayloadCarryingRpcController controller = newRpcController();
  ProtobufUtil.mergeRegions(controller, admin, region_a, region_b, forcible);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:31,代码来源:ServerManager.java

示例2: SplitLogManager

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
/**
 * Its OK to construct this object even when region-servers are not online. It does lookup the
 * orphan tasks in coordination engine but it doesn't block waiting for them to be done.
 * @param server the server instance
 * @param conf the HBase configuration
 * @param stopper the stoppable in case anything is wrong
 * @param master the master services
 * @param serverName the master server name
 * @throws IOException
 */
public SplitLogManager(Server server, Configuration conf, Stoppable stopper,
    MasterServices master, ServerName serverName) throws IOException {
  this.server = server;
  this.conf = conf;
  this.stopper = stopper;
  this.choreService = new ChoreService(serverName.toString() + "_splitLogManager_");
  if (server.getCoordinatedStateManager() != null) {
    SplitLogManagerCoordination coordination =
        ((BaseCoordinatedStateManager) server.getCoordinatedStateManager())
            .getSplitLogManagerCoordination();
    Set<String> failedDeletions = Collections.synchronizedSet(new HashSet<String>());
    SplitLogManagerDetails details =
        new SplitLogManagerDetails(tasks, master, failedDeletions, serverName);
    coordination.setDetails(details);
    coordination.init();
    // Determine recovery mode
  }
  this.unassignedTimeout =
      conf.getInt("hbase.splitlog.manager.unassigned.timeout", DEFAULT_UNASSIGNED_TIMEOUT);
  this.timeoutMonitor =
      new TimeoutMonitor(conf.getInt("hbase.splitlog.manager.timeoutmonitor.period", 1000),
          stopper);
  choreService.scheduleChore(timeoutMonitor);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:SplitLogManager.java

示例3: sendRegionClose

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
/**
 * Sends an CLOSE RPC to the specified server to close the specified region.
 * <p>
 * A region server could reject the close request because it either does not
 * have the specified region or the region is being split.
 * @param server server to open a region
 * @param region region to open
 * @param versionOfClosingNode
 *   the version of znode to compare when RS transitions the znode from
 *   CLOSING state.
 * @param dest - if the region is moved to another server, the destination server. null otherwise.
 * @return true if server acknowledged close, false if not
 * @throws IOException
 */
public boolean sendRegionClose(ServerName server, HRegionInfo region,
  int versionOfClosingNode, ServerName dest, boolean transitionInZK) throws IOException {
  if (server == null) throw new NullPointerException("Passed server is null");
  AdminService.BlockingInterface admin = getRsAdmin(server);
  if (admin == null) {
    throw new IOException("Attempting to send CLOSE RPC to server " +
      server.toString() + " for region " +
      region.getRegionNameAsString() +
      " failed because no RPC connection found to this server");
  }
  PayloadCarryingRpcController controller = newRpcController();
  return ProtobufUtil.closeRegion(controller, admin, server, region.getRegionName(),
    versionOfClosingNode, dest, transitionInZK);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:ServerManager.java

示例4: MockRegionServer

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
/**
 * @param sn Name of this mock regionserver
 * @throws IOException
 * @throws org.apache.hadoop.hbase.ZooKeeperConnectionException
 */
MockRegionServer(final Configuration conf, final ServerName sn)
throws ZooKeeperConnectionException, IOException {
  this.sn = sn;
  this.conf = conf;
  this.zkw = new ZooKeeperWatcher(conf, sn.toString(), this, true);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:MockRegionServer.java


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