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


Java HBaseRPCErrorHandler类代码示例

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


HBaseRPCErrorHandler类属于org.apache.hadoop.hbase.ipc包,在下文中一共展示了HBaseRPCErrorHandler类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HRegionServer

import org.apache.hadoop.hbase.ipc.HBaseRPCErrorHandler; //导入依赖的package包/类
/**
 * Starts a HRegionServer at the default location
 *
 * @param conf
 * @throws IOException
 * @throws InterruptedException
 */
public HRegionServer(Configuration conf)
throws IOException, InterruptedException {
  this.fsOk = true;
  this.conf = conf;
  // Set how many times to retry talking to another server over HConnection.
  HConnectionManager.setServerSideHConnectionRetries(this.conf, LOG);
  this.isOnline = false;
  checkCodecs(this.conf);

  // Config'ed params
  this.numRetries = conf.getInt("hbase.client.retries.number", 10);
  this.threadWakeFrequency = conf.getInt(HConstants.THREAD_WAKE_FREQUENCY,
    10 * 1000);
  this.msgInterval = conf.getInt("hbase.regionserver.msginterval", 3 * 1000);

  this.sleeper = new Sleeper(this.msgInterval, this);

  this.maxScannerResultSize = conf.getLong(
    HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY,
    HConstants.DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE);

  this.numRegionsToReport = conf.getInt(
    "hbase.regionserver.numregionstoreport", 10);

  this.rpcTimeout = conf.getInt(
    HConstants.HBASE_RPC_TIMEOUT_KEY,
    HConstants.DEFAULT_HBASE_RPC_TIMEOUT);

  this.abortRequested = false;
  this.stopped = false;

  // Server to handle client requests.
  String hostname = DNS.getDefaultHost(
    conf.get("hbase.regionserver.dns.interface", "default"),
    conf.get("hbase.regionserver.dns.nameserver", "default"));
  int port = conf.getInt(HConstants.REGIONSERVER_PORT,
    HConstants.DEFAULT_REGIONSERVER_PORT);
  // Creation of a HSA will force a resolve.
  InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
  if (initialIsa.getAddress() == null) {
    throw new IllegalArgumentException("Failed resolve of " + initialIsa);
  }
  this.rpcServer = HBaseRPC.getServer(this,
    new Class<?>[]{HRegionInterface.class, HBaseRPCErrorHandler.class,
      OnlineRegions.class},
      initialIsa.getHostName(), // BindAddress is IP we got for this server.
      initialIsa.getPort(),
      conf.getInt("hbase.regionserver.handler.count", 10),
      conf.getInt("hbase.regionserver.metahandler.count", 10),
      conf.getBoolean("hbase.rpc.verbose", false),
      conf, QOS_THRESHOLD);
  // Set our address.
  this.isa = this.rpcServer.getListenerAddress();

  this.rpcServer.setErrorHandler(this);
  this.rpcServer.setQosFunction(new QosFunction());
  this.startcode = System.currentTimeMillis();

  // login the server principal (if using secure Hadoop)
  User.login(this.conf, "hbase.regionserver.keytab.file",
    "hbase.regionserver.kerberos.principal", this.isa.getHostName());
  regionServerAccounting = new RegionServerAccounting();
  cacheConfig = new CacheConfig(conf);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:72,代码来源:HRegionServer.java


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