Java 类org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionServerReportRequest 实例源码

项目:ditb    文件:MasterRpcServices.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    master.checkServiceStarted();
    ClusterStatusProtos.ServerLoad sl = request.getLoad();
    ServerName serverName = ProtobufUtil.toServerName(request.getServer());
    ServerLoad oldLoad = master.serverManager.getLoad(serverName);
    master.serverManager.regionServerReport(serverName, new ServerLoad(sl));
    if (sl != null && master.metricsMaster != null) {
      // Up our metrics.
      master.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests()
          - (oldLoad != null ? oldLoad.getTotalNumberOfRequests() : 0));
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return RegionServerReportResponse.newBuilder().build();
}
项目:pbase    文件:MasterRpcServices.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    master.checkServiceStarted();
    ClusterStatusProtos.ServerLoad sl = request.getLoad();
    ServerName serverName = ProtobufUtil.toServerName(request.getServer());
    ServerLoad oldLoad = master.serverManager.getLoad(serverName);
    master.serverManager.regionServerReport(serverName, new ServerLoad(sl));
    if (sl != null && master.metricsMaster != null) {
      // Up our metrics.
      master.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests()
        - (oldLoad != null ? oldLoad.getTotalNumberOfRequests() : 0));
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return RegionServerReportResponse.newBuilder().build();
}
项目:HIndex    文件:HMaster.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    ClusterStatusProtos.ServerLoad sl = request.getLoad();
    ServerName serverName = ProtobufUtil.toServerName(request.getServer());
    ServerLoad oldLoad = serverManager.getLoad(serverName);
    this.serverManager.regionServerReport(serverName, new ServerLoad(sl));
    if (sl != null && this.metricsMaster != null) {
      // Up our metrics.
      this.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests()
        - (oldLoad != null ? oldLoad.getTotalNumberOfRequests() : 0));
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }

  return RegionServerReportResponse.newBuilder().build();
}
项目:PyroDB    文件:MasterRpcServices.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    master.checkServiceStarted();
    ClusterStatusProtos.ServerLoad sl = request.getLoad();
    ServerName serverName = ProtobufUtil.toServerName(request.getServer());
    ServerLoad oldLoad = master.serverManager.getLoad(serverName);
    master.serverManager.regionServerReport(serverName, new ServerLoad(sl));
    if (sl != null && master.metricsMaster != null) {
      // Up our metrics.
      master.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests()
        - (oldLoad != null ? oldLoad.getTotalNumberOfRequests() : 0));
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }
  return RegionServerReportResponse.newBuilder().build();
}
项目:c5    文件:HMaster.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    ClusterStatusProtos.ServerLoad sl = request.getLoad();
    this.serverManager.regionServerReport(ProtobufUtil.toServerName(request.getServer()), new ServerLoad(sl));
    if (sl != null && this.metricsMaster != null) {
      // Up our metrics.
      this.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests());
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }

  return RegionServerReportResponse.newBuilder().build();
}
项目:DominoHBase    文件:HMaster.java   
@Override
public RegionServerReportResponse regionServerReport(
    RpcController controller, RegionServerReportRequest request) throws ServiceException {
  try {
    HBaseProtos.ServerLoad sl = request.getLoad();
    this.serverManager.regionServerReport(ProtobufUtil.toServerName(request.getServer()), new ServerLoad(sl));
    if (sl != null && this.metricsMaster != null) {
      // Up our metrics.
      this.metricsMaster.incrementRequests(sl.getTotalNumberOfRequests());
    }
  } catch (IOException ioe) {
    throw new ServiceException(ioe);
  }

  return RegionServerReportResponse.newBuilder().build();
}
项目:DominoHBase    文件:HRegionServer.java   
void tryRegionServerReport(long reportStartTime, long reportEndTime)
throws IOException {
  HBaseProtos.ServerLoad sl = buildServerLoad(reportStartTime, reportEndTime);
  try {
    RegionServerReportRequest.Builder request = RegionServerReportRequest.newBuilder();
    ServerName sn = ServerName.parseVersionedServerName(
      this.serverNameFromMasterPOV.getVersionedBytes());
    request.setServer(ProtobufUtil.toServerName(sn));
    request.setLoad(sl);
    this.hbaseMaster.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;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    getMaster();
  }
}
项目:ditb    文件:HRegionServer.java   
@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();
  }
}
项目:pbase    文件:HRegionServer.java   
@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();
    }
}
项目:HIndex    文件:HRegionServer.java   
@VisibleForTesting
protected void tryRegionServerReport(long reportStartTime, long reportEndTime)
throws IOException {
  if (this.rssStub == null) {
    // the current server is stopping.
    return;
  }
  ClusterStatusProtos.ServerLoad sl = buildServerLoad(reportStartTime, reportEndTime);
  try {
    RegionServerReportRequest.Builder request = RegionServerReportRequest.newBuilder();
    ServerName sn = ServerName.parseVersionedServerName(
      this.serverNameFromMasterPOV.getVersionedBytes());
    request.setServer(ProtobufUtil.toServerName(sn));
    request.setLoad(sl);
    this.rssStub.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;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    Pair<ServerName, RegionServerStatusService.BlockingInterface> p =
      createRegionServerStatusStub();
    this.rssStub = p.getSecond();
  }
}
项目:PyroDB    文件:HRegionServer.java   
@VisibleForTesting
protected void tryRegionServerReport(long reportStartTime, long reportEndTime)
throws IOException {
  if (this.rssStub == null) {
    // the current server is 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);
    this.rssStub.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;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    Pair<ServerName, RegionServerStatusService.BlockingInterface> p =
      createRegionServerStatusStub();
    this.rssStub = p.getSecond();
  }
}
项目:c5    文件:HRegionServer.java   
void tryRegionServerReport(long reportStartTime, long reportEndTime)
throws IOException {
  if (this.rssStub == null) {
    // the current server is stopping.
    return;
  }
  ClusterStatusProtos.ServerLoad sl = buildServerLoad(reportStartTime, reportEndTime);
  try {
    RegionServerReportRequest.Builder request = RegionServerReportRequest.newBuilder();
    ServerName sn = ServerName.parseVersionedServerName(
      this.serverNameFromMasterPOV.getVersionedBytes());
    request.setServer(ProtobufUtil.toServerName(sn));
    request.setLoad(sl);
    this.rssStub.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;
    }
    // Couldn't connect to the master, get location from zk and reconnect
    // Method blocks until new master is found or we are stopped
    Pair<ServerName, RegionServerStatusService.BlockingInterface> p =
      createRegionServerStatusStub();
    this.rssStub = p.getSecond();
  }
}