Search in sources :

Example 1 with ListCachePoolsResponseProto

use of org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.ListCachePoolsResponseProto in project hadoop by apache.

the class ClientNamenodeProtocolServerSideTranslatorPB method listCachePools.

@Override
public ListCachePoolsResponseProto listCachePools(RpcController controller, ListCachePoolsRequestProto request) throws ServiceException {
    try {
        BatchedEntries<CachePoolEntry> entries = server.listCachePools(request.getPrevPoolName());
        ListCachePoolsResponseProto.Builder responseBuilder = ListCachePoolsResponseProto.newBuilder();
        responseBuilder.setHasMore(entries.hasMore());
        for (int i = 0, n = entries.size(); i < n; i++) {
            responseBuilder.addEntries(PBHelperClient.convert(entries.get(i)));
        }
        return responseBuilder.build();
    } catch (IOException e) {
        throw new ServiceException(e);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) ListCachePoolsResponseProto(org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.ListCachePoolsResponseProto) IOException(java.io.IOException) CachePoolEntry(org.apache.hadoop.hdfs.protocol.CachePoolEntry)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 IOException (java.io.IOException)1 CachePoolEntry (org.apache.hadoop.hdfs.protocol.CachePoolEntry)1 ListCachePoolsResponseProto (org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.ListCachePoolsResponseProto)1