Search in sources :

Example 1 with GetStoreFileResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileResponse in project hbase by apache.

the class RSRpcServices method getStoreFile.

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public GetStoreFileResponse getStoreFile(final RpcController controller, final GetStoreFileRequest request) throws ServiceException {
    try {
        checkOpen();
        Region region = getRegion(request.getRegion());
        requestCount.increment();
        Set<byte[]> columnFamilies;
        if (request.getFamilyCount() == 0) {
            columnFamilies = region.getTableDesc().getFamiliesKeys();
        } else {
            columnFamilies = new TreeSet<>(Bytes.BYTES_RAWCOMPARATOR);
            for (ByteString cf : request.getFamilyList()) {
                columnFamilies.add(cf.toByteArray());
            }
        }
        int nCF = columnFamilies.size();
        List<String> fileList = region.getStoreFileList(columnFamilies.toArray(new byte[nCF][]));
        GetStoreFileResponse.Builder builder = GetStoreFileResponse.newBuilder();
        builder.addAllStoreFile(fileList);
        return builder.build();
    } catch (IOException ie) {
        throw new ServiceException(ie);
    }
}
Also used : ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) ByteString(org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) ByteString(org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) HBaseIOException(org.apache.hadoop.hbase.HBaseIOException) GetStoreFileResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileResponse) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority)

Aggregations

IOException (java.io.IOException)1 InterruptedIOException (java.io.InterruptedIOException)1 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)1 QosPriority (org.apache.hadoop.hbase.ipc.QosPriority)1 ByteString (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString)1 ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)1 GetStoreFileResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetStoreFileResponse)1