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


Java ServerName.parseVersionedServerName方法代码示例

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


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

示例1: tryRegionServerReport

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
@VisibleForTesting protected void tryRegionServerReport(long reportStartTime, long reportEndTime)
    throws IOException {
  RegionServerStatusService.BlockingInterface rss = rssStub;
  if (rss == null) {
    // the current server could be stopping.
    return;
  }
  ClusterStatusProtos.ServerLoad sl = buildServerLoad(reportStartTime, reportEndTime);
  try {
    RegionServerReportRequest.Builder request = RegionServerReportRequest.newBuilder();
    ServerName sn = ServerName.parseVersionedServerName(this.serverName.getVersionedBytes());
    request.setServer(ProtobufUtil.toServerName(sn));
    request.setLoad(sl);
    rss.regionServerReport(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof YouAreDeadException) {
      // This will be caught and handled as a fatal error in run()
      throw ioe;
    }
    if (rssStub == rss) {
      rssStub = null;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    createRegionServerStatusStub();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:29,代码来源:HRegionServer.java

示例2: abort

import org.apache.hadoop.hbase.ServerName; //导入方法依赖的package包/类
/**
 * Cause the server to exit without closing the regions it is serving, the log
 * it is using and without notifying the master. Used unit testing and on
 * catastrophic events such as HDFS is yanked out from under hbase or we OOME.
 *
 * @param reason the reason we are aborting
 * @param cause  the exception that caused the abort, or null
 */
@Override public void abort(String reason, Throwable cause) {
  String msg = "ABORTING region server " + this + ": " + reason;
  if (cause != null) {
    LOG.fatal(msg, cause);
  } else {
    LOG.fatal(msg);
  }
  this.abortRequested = true;
  // HBASE-4014: show list of coprocessors that were loaded to help debug
  // regionserver crashes.Note that we're implicitly using
  // java.util.HashSet's toString() method to print the coprocessor names.
  LOG.fatal(
      "RegionServer abort: loaded coprocessors are: " + CoprocessorHost.getLoadedCoprocessors());
  // Try and dump metrics if abort -- might give clue as to how fatal came about....
  try {
    LOG.info("Dump of metrics as JSON on abort: " + JSONBean.dumpRegionServerMetrics());
  } catch (MalformedObjectNameException | IOException e) {
    LOG.warn("Failed dumping metrics", e);
  }

  // Do our best to report our abort to the master, but this may not work
  try {
    if (cause != null) {
      msg += "\nCause:\n" + StringUtils.stringifyException(cause);
    }
    // Report to the master but only if we have already registered with the master.
    if (rssStub != null && this.serverName != null) {
      ReportRSFatalErrorRequest.Builder builder = ReportRSFatalErrorRequest.newBuilder();
      ServerName sn = ServerName.parseVersionedServerName(this.serverName.getVersionedBytes());
      builder.setServer(ProtobufUtil.toServerName(sn));
      builder.setErrorMessage(msg);
      rssStub.reportRSFatalError(null, builder.build());
    }
  } catch (Throwable t) {
    LOG.warn("Unable to report fatal error to master", t);
  }
  stop(reason);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:47,代码来源:HRegionServer.java


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