Java 类org.apache.hadoop.hbase.protobuf.generated.AdminProtos.GetOnlineRegionRequest 实例源码

项目:ditb    文件:RSRpcServices.java   
@Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
    final GetOnlineRegionRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    Map<String, Region> onlineRegions = regionServer.onlineRegions;
    List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
    for (Region region: onlineRegions.values()) {
      list.add(region.getRegionInfo());
    }
    Collections.sort(list);
    return ResponseConverter.buildGetOnlineRegionResponse(list);
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:pbase    文件:RSRpcServices.java   
@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
                                               final GetOnlineRegionRequest request) throws ServiceException {
    try {
        checkOpen();
        requestCount.increment();
        Map<String, HRegion> onlineRegions = regionServer.onlineRegions;
        List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
        for (HRegion region : onlineRegions.values()) {
            list.add(region.getRegionInfo());
        }
        Collections.sort(list);
        return ResponseConverter.buildGetOnlineRegionResponse(list);
    } catch (IOException ie) {
        throw new ServiceException(ie);
    }
}
项目:HIndex    文件:HRegionServer.java   
@Override
@QosPriority(priority=HConstants.HIGH_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
    final GetOnlineRegionRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
    for (HRegion region: this.onlineRegions.values()) {
      list.add(region.getRegionInfo());
    }
    Collections.sort(list);
    return ResponseConverter.buildGetOnlineRegionResponse(list);
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:PyroDB    文件:RSRpcServices.java   
@Override
@QosPriority(priority=HConstants.HIGH_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
    final GetOnlineRegionRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    Map<String, HRegion> onlineRegions = regionServer.onlineRegions;
    List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
    for (HRegion region: onlineRegions.values()) {
      list.add(region.getRegionInfo());
    }
    Collections.sort(list);
    return ResponseConverter.buildGetOnlineRegionResponse(list);
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:c5    文件:HRegionServer.java   
@Override
@QosPriority(priority=HConstants.HIGH_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
    final GetOnlineRegionRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
    for (HRegion region: this.onlineRegions.values()) {
      list.add(region.getRegionInfo());
    }
    Collections.sort(list);
    return ResponseConverter.buildGetOnlineRegionResponse(list);
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:DominoHBase    文件:HRegionServer.java   
@Override
@QosPriority(priority=HConstants.HIGH_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller,
    final GetOnlineRegionRequest request) throws ServiceException {
  try {
    checkOpen();
    requestCount.increment();
    List<HRegionInfo> list = new ArrayList<HRegionInfo>(onlineRegions.size());
    for (HRegion region: this.onlineRegions.values()) {
      list.add(region.getRegionInfo());
    }
    Collections.sort(list);
    return ResponseConverter.buildGetOnlineRegionResponse(list);
  } catch (IOException ie) {
    throw new ServiceException(ie);
  }
}
项目:ditb    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rpcServices).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:ditb    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 * @return a list of online region info
 */
public static List<HRegionInfo> getOnlineRegions(final RpcController controller,
    final AdminService.BlockingInterface admin)
throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(controller, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:pbase    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rpcServices).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:pbase    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 *
 * @param admin
 * @return a list of online region info
 * @throws IOException
 */
public static List<HRegionInfo> getOnlineRegions(final AdminService.BlockingInterface admin)
throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(null, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:HIndex    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rs).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:HIndex    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 *
 * @param admin
 * @return a list of online region info
 * @throws IOException
 */
public static List<HRegionInfo> getOnlineRegions(final AdminService.BlockingInterface admin)
throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(null, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:PyroDB    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rpcServices).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:PyroDB    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 *
 * @param admin
 * @return a list of online region info
 * @throws IOException
 */
public static List<HRegionInfo> getOnlineRegions(final AdminService.BlockingInterface admin)
throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(null, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:c5    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf("mytable"));
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getTableName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rs).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:c5    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 *
 * @param admin
 * @return a list of online region info
 * @throws IOException
 */
public static List<HRegionInfo> getOnlineRegions(final AdminService.BlockingInterface admin)
throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(null, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:DominoHBase    文件:ProtobufUtil.java   
/**
 * A helper to get the all the online regions on a region
 * server using admin protocol.
 *
 * @param admin
 * @return a list of online region info
 * @throws IOException
 */
public static List<HRegionInfo> getOnlineRegions(final AdminProtocol admin) throws IOException {
  GetOnlineRegionRequest request = RequestConverter.buildGetOnlineRegionRequest();
  GetOnlineRegionResponse response = null;
  try {
    response = admin.getOnlineRegion(null, request);
  } catch (ServiceException se) {
    throw getRemoteException(se);
  }
  return getRegionInfos(response);
}
项目:DominoHBase    文件:TestRSStatusServlet.java   
@Test
public void testWithRegions() throws IOException, ServiceException {
  HTableDescriptor htd = new HTableDescriptor("mytable");
  List<HRegionInfo> regions = Lists.newArrayList(
      new HRegionInfo(htd.getName(), Bytes.toBytes("a"), Bytes.toBytes("d")),
      new HRegionInfo(htd.getName(), Bytes.toBytes("d"), Bytes.toBytes("z"))
      );
  Mockito.doReturn(ResponseConverter.buildGetOnlineRegionResponse(
    regions)).when(rs).getOnlineRegion((RpcController)Mockito.any(),
      (GetOnlineRegionRequest)Mockito.any());

  new RSStatusTmpl().render(new StringWriter(), rs);
}
项目:DominoHBase    文件:TestPriorityRpc.java   
@Test
public void testQosFunctionWithoutKnownArgument() throws IOException {
  //The request is not using any of the
  //known argument classes (it uses one random request class)
  //(known argument classes are listed in
  //HRegionServer.QosFunction.knownArgumentClasses)
  RpcRequestBody.Builder rpcRequestBuilder = RpcRequestBody.newBuilder();
  rpcRequestBuilder.setMethodName("foo");
  rpcRequestBuilder.setRequestClassName(GetOnlineRegionRequest.class.getCanonicalName());
  RpcRequestBody rpcRequest = rpcRequestBuilder.build();
  QosFunction qosFunc = regionServer.getQosFunction();
  assertTrue (qosFunc.apply(rpcRequest) == HConstants.NORMAL_QOS);
}
项目:ditb    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:pbase    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:HIndex    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:PyroDB    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:c5    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:DominoHBase    文件:MockRegionServer.java   
@Override
public GetOnlineRegionResponse getOnlineRegion(RpcController controller,
    GetOnlineRegionRequest request) throws ServiceException {
  // TODO Auto-generated method stub
  return null;
}
项目:ditb    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}
项目:pbase    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}
项目:HIndex    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}
项目:PyroDB    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}
项目:c5    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}
项目:DominoHBase    文件:RequestConverter.java   
/**
 * Create a protocol buffer GetOnlineRegionRequest
 *
 * @return a protocol buffer GetOnlineRegionRequest
 */
public static GetOnlineRegionRequest buildGetOnlineRegionRequest() {
  return GetOnlineRegionRequest.newBuilder().build();
}