• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RegionServerStartupRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
/**
 * Let the server manager know a new regionserver has come online
 * @param request the startup request
 * @param ia the InetAddress from which request is received
 * @return The ServerName we know this server as.
 * @throws IOException
 */
ServerName regionServerStartup(RegionServerStartupRequest request, InetAddress ia)
    throws IOException {
  // Test for case where we get a region startup message from a regionserver
  // that has been quickly restarted but whose znode expiration handler has
  // not yet run, or from a server whose fail we are currently processing.
  // Test its host+port combo is present in serverAddresstoServerInfo.  If it
  // is, reject the server and trigger its expiration. The next time it comes
  // in, it should have been removed from serverAddressToServerInfo and queued
  // for processing by ProcessServerShutdown.

  final String hostname = request.hasUseThisHostnameInstead() ?
      request.getUseThisHostnameInstead() :ia.getHostName();
  ServerName sn = ServerName.valueOf(hostname, request.getPort(),
    request.getServerStartCode());
  checkClockSkew(sn, request.getServerCurrentTime());
  checkIsDead(sn, "STARTUP");
  if (!checkAndRecordNewServer(sn, ServerLoad.EMPTY_SERVERLOAD)) {
    LOG.warn("THIS SHOULD NOT HAPPEN, RegionServerStartup"
      + " could not record the server: " + sn);
  }
  return sn;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:30,代码来源:ServerManager.java


示例2: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
@Override
public RegionServerStartupResponse regionServerStartup(
    RpcController controller, RegionServerStartupRequest request) throws ServiceException {
  // Register with server manager
  try {
    master.checkServiceStarted();
    InetAddress ia = master.getRemoteInetAddress(
      request.getPort(), request.getServerStartCode());
    // if regionserver passed hostname to use,
    // then use it instead of doing a reverse DNS lookup
    ServerName rs = master.serverManager.regionServerStartup(request, ia);

    // Send back some config info
    RegionServerStartupResponse.Builder resp = createConfigurationSubset();
    NameStringPair.Builder entry = NameStringPair.newBuilder()
      .setName(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)
      .setValue(rs.getHostname());
    resp.addMapEntries(entry.build());

    return resp.build();
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:MasterRpcServices.java


示例3: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
@Override
public RegionServerStartupResponse regionServerStartup(
    RpcController controller, RegionServerStartupRequest request) throws ServiceException {
  // Register with server manager
  try {
    master.checkServiceStarted();
    InetAddress ia = master.getRemoteInetAddress(
      request.getPort(), request.getServerStartCode());
    ServerName rs = master.serverManager.regionServerStartup(ia, request.getPort(),
      request.getServerStartCode(), request.getServerCurrentTime());

    // Send back some config info
    RegionServerStartupResponse.Builder resp = createConfigurationSubset();
    NameStringPair.Builder entry = NameStringPair.newBuilder()
      .setName(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)
      .setValue(rs.getHostname());
    resp.addMapEntries(entry.build());

    return resp.build();
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:24,代码来源:MasterRpcServices.java


示例4: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
@Override
public RegionServerStartupResponse regionServerStartup(
    RpcController controller, RegionServerStartupRequest request) throws ServiceException {
  // Register with server manager
  try {
    InetAddress ia = getRemoteInetAddress(request.getPort(), request.getServerStartCode());
    ServerName rs = this.serverManager.regionServerStartup(ia, request.getPort(),
      request.getServerStartCode(), request.getServerCurrentTime());

    // Send back some config info
    RegionServerStartupResponse.Builder resp = createConfigurationSubset();
    NameStringPair.Builder entry = NameStringPair.newBuilder()
      .setName(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)
      .setValue(rs.getHostname());
    resp.addMapEntries(entry.build());

    return resp.build();
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:22,代码来源:HMaster.java


示例5: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
private RegionServerStartupResponse reportForDuty() throws IOException {
  ServerName masterServerName = createRegionServerStatusStub();
  if (masterServerName == null) return null;
  RegionServerStartupResponse result = null;
  try {
    rpcServices.requestCount.set(0);
    LOG.info(
        "reportForDuty to master=" + masterServerName + " with port=" + rpcServices.isa.getPort()
            + ", startcode=" + this.startcode);
    long now = EnvironmentEdgeManager.currentTime();
    int port = rpcServices.isa.getPort();
    RegionServerStartupRequest.Builder request = RegionServerStartupRequest.newBuilder();
    if (shouldUseThisHostnameInstead()) {
      request.setUseThisHostnameInstead(useThisHostnameInstead);
    }
    request.setPort(port);
    request.setServerStartCode(this.startcode);
    request.setServerCurrentTime(now);
    result = this.rssStub.regionServerStartup(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof ClockOutOfSyncException) {
      LOG.fatal("Master rejected startup because clock is out of sync", ioe);
      // Re-throw IOE will cause RS to abort
      throw ioe;
    } else if (ioe instanceof ServerNotRunningYetException) {
      LOG.debug("Master is not running yet");
    } else {
      LOG.warn("error telling master we are up", se);
    }
    rssStub = null;
  }
  return result;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:35,代码来源:HRegionServer.java


示例6: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
private RegionServerStartupResponse reportForDuty() throws IOException {
    ServerName masterServerName = createRegionServerStatusStub();
    if (masterServerName == null) return null;
    RegionServerStartupResponse result = null;
    try {
        rpcServices.requestCount.set(0);
        LOG.info("reportForDuty to master=" + masterServerName + " with port="
                + rpcServices.isa.getPort() + ", startcode=" + this.startcode);
        long now = EnvironmentEdgeManager.currentTime();
        int port = rpcServices.isa.getPort();
        RegionServerStartupRequest.Builder request = RegionServerStartupRequest.newBuilder();
        request.setPort(port);
        request.setServerStartCode(this.startcode);
        request.setServerCurrentTime(now);
        result = this.rssStub.regionServerStartup(null, request.build());
    } catch (ServiceException se) {
        IOException ioe = ProtobufUtil.getRemoteException(se);
        if (ioe instanceof ClockOutOfSyncException) {
            LOG.fatal("Master rejected startup because clock is out of sync", ioe);
            // Re-throw IOE will cause RS to abort
            throw ioe;
        } else if (ioe instanceof ServerNotRunningYetException) {
            LOG.debug("Master is not running yet");
        } else {
            LOG.warn("error telling master we are up", se);
        }
    }
    return result;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:30,代码来源:HRegionServer.java


示例7: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
private RegionServerStartupResponse reportForDuty() throws IOException {
  RegionServerStartupResponse result = null;
  Pair<ServerName, RegionServerStatusService.BlockingInterface> p =
    createRegionServerStatusStub();
  this.rssStub = p.getSecond();
  ServerName masterServerName = p.getFirst();
  if (masterServerName == null) return result;
  try {
    this.requestCount.set(0);
    LOG.info("reportForDuty to master=" + masterServerName + " with port=" + this.isa.getPort() +
      ", startcode=" + this.startcode);
    long now = EnvironmentEdgeManager.currentTimeMillis();
    int port = this.isa.getPort();
    RegionServerStartupRequest.Builder request = RegionServerStartupRequest.newBuilder();
    request.setPort(port);
    request.setServerStartCode(this.startcode);
    request.setServerCurrentTime(now);
    result = this.rssStub.regionServerStartup(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof ClockOutOfSyncException) {
      LOG.fatal("Master rejected startup because clock is out of sync", ioe);
      // Re-throw IOE will cause RS to abort
      throw ioe;
    } else if (ioe instanceof ServerNotRunningYetException) {
      LOG.debug("Master is not running yet");
    } else {
      LOG.warn("error telling master we are up", se);
    }
  }
  return result;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:33,代码来源:HRegionServer.java


示例8: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
private RegionServerStartupResponse reportForDuty() throws IOException {
  RegionServerStartupResponse result = null;
  Pair<ServerName, RegionServerStatusService.BlockingInterface> p =
    createRegionServerStatusStub();
  this.rssStub = p.getSecond();
  ServerName masterServerName = p.getFirst();
  if (masterServerName == null) return result;
  try {
    rpcServices.requestCount.set(0);
    LOG.info("reportForDuty to master=" + masterServerName + " with port="
      + rpcServices.isa.getPort() + ", startcode=" + this.startcode);
    long now = EnvironmentEdgeManager.currentTimeMillis();
    int port = rpcServices.isa.getPort();
    RegionServerStartupRequest.Builder request = RegionServerStartupRequest.newBuilder();
    request.setPort(port);
    request.setServerStartCode(this.startcode);
    request.setServerCurrentTime(now);
    result = this.rssStub.regionServerStartup(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof ClockOutOfSyncException) {
      LOG.fatal("Master rejected startup because clock is out of sync", ioe);
      // Re-throw IOE will cause RS to abort
      throw ioe;
    } else if (ioe instanceof ServerNotRunningYetException) {
      LOG.debug("Master is not running yet");
    } else {
      LOG.warn("error telling master we are up", se);
    }
  }
  return result;
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:33,代码来源:HRegionServer.java


示例9: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupRequest; //导入依赖的package包/类
private RegionServerStartupResponse reportForDuty() throws IOException {
  RegionServerStartupResponse result = null;
  ServerName masterServerName = getMaster();
  if (masterServerName == null) return result;
  try {
    this.requestCount.set(0);
    LOG.info("Telling master at " + masterServerName + " that we are up " +
      "with port=" + this.isa.getPort() + ", startcode=" + this.startcode);
    long now = EnvironmentEdgeManager.currentTimeMillis();
    int port = this.isa.getPort();
    RegionServerStartupRequest.Builder request = RegionServerStartupRequest.newBuilder();
    request.setPort(port);
    request.setServerStartCode(this.startcode);
    request.setServerCurrentTime(now);
    result = this.hbaseMaster.regionServerStartup(null, request.build());
  } catch (ServiceException se) {
    IOException ioe = ProtobufUtil.getRemoteException(se);
    if (ioe instanceof ClockOutOfSyncException) {
      LOG.fatal("Master rejected startup because clock is out of sync", ioe);
      // Re-throw IOE will cause RS to abort
      throw ioe;
    } else {
      LOG.warn("error telling master we are up", se);
    }
  }
  return result;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:28,代码来源:HRegionServer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FileBasedSink类代码示例发布时间:2022-05-22
下一篇:
Java DataEndpointException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap