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


Java RegionServerStartupResponse类代码示例

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


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

示例1: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例2: handleReportForDutyResponse

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
@Override
protected void handleReportForDutyResponse(RegionServerStartupResponse c) throws IOException {
  if (firstRS.getAndSet(false)) {
    InetSocketAddress address = super.getRpcServer().getListenerAddress();
    if (address == null) {
      throw new IOException("Listener channel is closed");
    }
    for (NameStringPair e : c.getMapEntriesList()) {
      String key = e.getName();
      // The hostname the master sees us as.
      if (key.equals(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)) {
        String hostnameFromMasterPOV = e.getValue();
        assertEquals(address.getHostName(), hostnameFromMasterPOV);
      }
    }
    while (!masterActive) {
      Threads.sleep(100);
    }
    super.kill();
  } else {
    super.handleReportForDutyResponse(c);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:24,代码来源:TestRSKilledWhenInitializing.java

示例3: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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: handleReportForDutyResponse

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
@Override
protected void handleReportForDutyResponse(RegionServerStartupResponse c) throws IOException {
  if (firstRS.getAndSet(false)) {
    for (NameStringPair e : c.getMapEntriesList()) {
      String key = e.getName();
      // The hostname the master sees us as.
      if (key.equals(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)) {
        String hostnameFromMasterPOV = e.getValue();
        assertEquals(super.getRpcServer().getListenerAddress().getHostName(),
          hostnameFromMasterPOV);
      }
    }
    while (!masterActive) {
      Threads.sleep(100);
    }
    super.kill();
  } else {
    super.handleReportForDutyResponse(c);
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:21,代码来源:TestRSKilledWhenInitializing.java

示例5: regionServerStartup

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例6: handleReportForDutyResponse

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
@Override
protected void handleReportForDutyResponse(RegionServerStartupResponse c) throws IOException {
  for (NameStringPair e : c.getMapEntriesList()) {
    String key = e.getName();
    // The hostname the master sees us as.
    if (key.equals(HConstants.KEY_FOR_HOSTNAME_SEEN_BY_MASTER)) {
      String hostnameFromMasterPOV = e.getValue();
      assertEquals(super.getRpcServer().getListenerAddress().getHostName(),
        hostnameFromMasterPOV);
    }
  }
  while (!masterActive) {
    Threads.sleep(100);
  }
  super.kill();
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:17,代码来源:TestRSKilledWhenInitializing.java

示例7: createConfigurationSubset

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
/**
 * @return Subset of configuration to pass initializing regionservers: e.g.
 * the filesystem to use and root directory to use.
 */
private RegionServerStartupResponse.Builder createConfigurationSubset() {
  RegionServerStartupResponse.Builder resp = addConfig(
    RegionServerStartupResponse.newBuilder(), HConstants.HBASE_DIR);
  resp = addConfig(resp, "fs.defaultFS");
  return addConfig(resp, "hbase.master.info.port");
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:MasterRpcServices.java

示例8: addConfig

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
private RegionServerStartupResponse.Builder addConfig(
    final RegionServerStartupResponse.Builder resp, final String key) {
  NameStringPair.Builder entry = NameStringPair.newBuilder()
    .setName(key)
    .setValue(master.getConfiguration().get(key));
  resp.addMapEntries(entry.build());
  return resp;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:9,代码来源:MasterRpcServices.java

示例9: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例10: handleReportForDutyResponse

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
@Override
protected void handleReportForDutyResponse(
    final RegionServerStartupResponse c) throws IOException {
  super.handleReportForDutyResponse(c);
  // Run this thread to shutdown our filesystem on way out.
  this.shutdownThread = new SingleFileSystemShutdownThread(getFileSystem());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:MiniHBaseCluster.java

示例11: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例12: addConfig

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的package包/类
private RegionServerStartupResponse.Builder addConfig(
    final RegionServerStartupResponse.Builder resp, final String key) {
  NameStringPair.Builder entry = NameStringPair.newBuilder()
    .setName(key)
    .setValue(this.conf.get(key));
  resp.addMapEntries(entry.build());
  return resp;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:9,代码来源:HMaster.java

示例13: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例14: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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

示例15: reportForDuty

import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerStartupResponse; //导入依赖的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.RegionServerStartupResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。