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


Java ProtobufUtil.closeRegion方法代码示例

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


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

示例1: sendRegionClose

import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的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

示例2: closeRegionSilentlyAndWait

import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
/**
 * Contacts a region server and waits up to timeout ms
 * to close the region.  This bypasses the active hmaster.
 */
public static void closeRegionSilentlyAndWait(ClusterConnection connection,
  ServerName server, HRegionInfo region, long timeout) throws IOException, InterruptedException {
  AdminService.BlockingInterface rs = connection.getAdmin(server);
  PayloadCarryingRpcController controller = connection.getRpcControllerFactory().newController();
  try {
    ProtobufUtil.closeRegion(controller, rs, server, region.getRegionName(), false);
  } catch (IOException e) {
    LOG.warn("Exception when closing region: " + region.getRegionNameAsString(), e);
  }
  long expiration = timeout + System.currentTimeMillis();
  while (System.currentTimeMillis() < expiration) {
    try {
      HRegionInfo rsRegion =
        ProtobufUtil.getRegionInfo(controller, rs, region.getRegionName());
      if (rsRegion == null) return;
    } catch (IOException ioe) {
      if (ioe instanceof NotServingRegionException) // no need to retry again
        return;
      LOG.warn("Exception when retrieving regioninfo from: "
        + region.getRegionNameAsString(), ioe);
    }
    Thread.sleep(1000);
  }
  throw new IOException("Region " + region + " failed to close within"
      + " timeout " + timeout);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:31,代码来源:ServerManager.java

示例3: closeRegion

import org.apache.hadoop.hbase.protobuf.ProtobufUtil; //导入方法依赖的package包/类
/**
 * Close a region.  For expert-admins  Runs close on the regionserver.  The
 * master will not be informed of the close.
 * @param sn
 * @param hri
 * @throws IOException
 */
@Override
public void closeRegion(final ServerName sn, final HRegionInfo hri)
throws IOException {
  AdminService.BlockingInterface admin = this.connection.getAdmin(sn);
  PayloadCarryingRpcController controller = rpcControllerFactory.newController();

  // Close the region without updating zk state.
  ProtobufUtil.closeRegion(controller, admin, sn, hri.getRegionName(), false);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:HBaseAdmin.java


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