@Override public DatanodeCommand cacheReport(DatanodeRegistration registration, String poolId, List<Long> blockIds) throws IOException { CacheReportRequestProto.Builder builder = CacheReportRequestProto.newBuilder() .setRegistration(PBHelper.convert(registration)) .setBlockPoolId(poolId); for (Long blockId : blockIds) { builder.addBlocks(blockId); } CacheReportResponseProto resp; try { resp = rpcProxy.cacheReport(NULL_CONTROLLER, builder.build()); } catch (ServiceException se) { throw ProtobufHelper.getRemoteException(se); } if (resp.hasCmd()) { return PBHelper.convert(resp.getCmd()); } return null; }
@Override public CacheReportResponseProto cacheReport(RpcController controller, CacheReportRequestProto request) throws ServiceException { DatanodeCommand cmd = null; try { cmd = impl.cacheReport( PBHelper.convert(request.getRegistration()), request.getBlockPoolId(), request.getBlocksList()); } catch (IOException e) { throw new ServiceException(e); } CacheReportResponseProto.Builder builder = CacheReportResponseProto.newBuilder(); if (cmd != null) { builder.setCmd(PBHelper.convert(cmd)); } return builder.build(); }