Java Code Examples for org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil#toGroupInfo()

The following examples show how to use org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil#toGroupInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RSGroupAdminClient.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * Gets {@code RSGroupInfo} for given group name.
 */
public RSGroupInfo getRSGroupInfo(String groupName) throws IOException {
  try {
    GetRSGroupInfoResponse resp = stub.getRSGroupInfo(null,
      GetRSGroupInfoRequest.newBuilder().setRSGroupName(groupName).build());
    if (resp.hasRSGroupInfo()) {
      return ProtobufUtil.toGroupInfo(resp.getRSGroupInfo());
    }
    return null;
  } catch (ServiceException e) {
    throw ProtobufUtil.handleRemoteException(e);
  }
}
 
Example 2
Source File: RSGroupAdminClient.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * Gets {@code RSGroupInfo} for the given table's group.
 */
public RSGroupInfo getRSGroupInfoOfTable(TableName tableName) throws IOException {
  GetRSGroupInfoOfTableRequest request = GetRSGroupInfoOfTableRequest.newBuilder()
    .setTableName(ProtobufUtil.toProtoTableName(tableName)).build();
  try {
    GetRSGroupInfoOfTableResponse resp = stub.getRSGroupInfoOfTable(null, request);
    if (resp.hasRSGroupInfo()) {
      return ProtobufUtil.toGroupInfo(resp.getRSGroupInfo());
    }
    return null;
  } catch (ServiceException e) {
    throw ProtobufUtil.handleRemoteException(e);
  }
}
 
Example 3
Source File: RSGroupAdminClient.java    From hbase with Apache License 2.0 5 votes vote down vote up
/**
 * Retrieve the RSGroupInfo a server is affiliated to
 * @param hostPort HostPort to get RSGroupInfo for
 */
public RSGroupInfo getRSGroupOfServer(Address hostPort) throws IOException {
  GetRSGroupInfoOfServerRequest request =
    GetRSGroupInfoOfServerRequest.newBuilder().setServer(HBaseProtos.ServerName.newBuilder()
      .setHostName(hostPort.getHostname()).setPort(hostPort.getPort()).build()).build();
  try {
    GetRSGroupInfoOfServerResponse resp = stub.getRSGroupInfoOfServer(null, request);
    if (resp.hasRSGroupInfo()) {
      return ProtobufUtil.toGroupInfo(resp.getRSGroupInfo());
    }
    return null;
  } catch (ServiceException e) {
    throw ProtobufUtil.handleRemoteException(e);
  }
}