@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(PBHelper.convert(entries.get(i))); } return responseBuilder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@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); } }
public BatchedCachePoolEntries(ListCachePoolsResponseProto proto) { this.proto = proto; }