@Override public GetAdditionalDatanodeResponseProto getAdditionalDatanode( RpcController controller, GetAdditionalDatanodeRequestProto req) throws ServiceException { try { List<DatanodeInfoProto> existingList = req.getExistingsList(); List<String> existingStorageIDsList = req.getExistingStorageUuidsList(); List<DatanodeInfoProto> excludesList = req.getExcludesList(); LocatedBlock result = server.getAdditionalDatanode(req.getSrc(), req.getFileId(), PBHelper.convert(req.getBlk()), PBHelper.convert(existingList.toArray( new DatanodeInfoProto[existingList.size()])), existingStorageIDsList.toArray( new String[existingStorageIDsList.size()]), PBHelper.convert(excludesList.toArray( new DatanodeInfoProto[excludesList.size()])), req.getNumAdditionalNodes(), req.getClientName()); return GetAdditionalDatanodeResponseProto.newBuilder().setBlock( PBHelper.convert(result)) .build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public LocatedBlock getAdditionalDatanode(String src, long fileId, ExtendedBlock blk, DatanodeInfo[] existings, String[] existingStorageIDs, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException { GetAdditionalDatanodeRequestProto req = GetAdditionalDatanodeRequestProto .newBuilder() .setSrc(src) .setFileId(fileId) .setBlk(PBHelper.convert(blk)) .addAllExistings(PBHelper.convert(existings)) .addAllExistingStorageUuids(Arrays.asList(existingStorageIDs)) .addAllExcludes(PBHelper.convert(excludes)) .setNumAdditionalNodes(numAdditionalNodes) .setClientName(clientName) .build(); try { return PBHelper.convert(rpcProxy.getAdditionalDatanode(null, req) .getBlock()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public LocatedBlock getAdditionalDatanode(String src, long fileId, ExtendedBlock blk, DatanodeInfo[] existings, String[] existingStorageIDs, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws IOException { GetAdditionalDatanodeRequestProto req = GetAdditionalDatanodeRequestProto .newBuilder() .setSrc(src) .setFileId(fileId) .setBlk(PBHelperClient.convert(blk)) .addAllExistings(PBHelperClient.convert(existings)) .addAllExistingStorageUuids(Arrays.asList(existingStorageIDs)) .addAllExcludes(PBHelperClient.convert(excludes)) .setNumAdditionalNodes(numAdditionalNodes) .setClientName(clientName) .build(); try { return PBHelperClient.convertLocatedBlockProto( rpcProxy.getAdditionalDatanode(null, req).getBlock()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public GetAdditionalDatanodeResponseProto getAdditionalDatanode( RpcController controller, GetAdditionalDatanodeRequestProto req) throws ServiceException { try { List<DatanodeInfoProto> existingList = req.getExistingsList(); List<String> existingStorageIDsList = req.getExistingStorageUuidsList(); List<DatanodeInfoProto> excludesList = req.getExcludesList(); LocatedBlock result = server.getAdditionalDatanode(req.getSrc(), req.getFileId(), PBHelperClient.convert(req.getBlk()), PBHelperClient.convert(existingList.toArray( new DatanodeInfoProto[existingList.size()])), existingStorageIDsList.toArray( new String[existingStorageIDsList.size()]), PBHelperClient.convert(excludesList.toArray( new DatanodeInfoProto[excludesList.size()])), req.getNumAdditionalNodes(), req.getClientName()); return GetAdditionalDatanodeResponseProto.newBuilder().setBlock( PBHelperClient.convertLocatedBlock(result)) .build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public GetAdditionalDatanodeResponseProto getAdditionalDatanode( RpcController controller, GetAdditionalDatanodeRequestProto req) throws ServiceException { try { List<DatanodeInfoProto> existingList = req.getExistingsList(); List<DatanodeInfoProto> excludesList = req.getExcludesList(); LocatedBlock result = server.getAdditionalDatanode( req.getSrc(), PBHelper.convert(req.getBlk()), PBHelper.convert(existingList.toArray( new DatanodeInfoProto[existingList.size()])), PBHelper.convert(excludesList.toArray( new DatanodeInfoProto[excludesList.size()])), req.getNumAdditionalNodes(), req.getClientName()); return GetAdditionalDatanodeResponseProto.newBuilder().setBlock( PBHelper.convert(result)) .build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public LocatedBlock getAdditionalDatanode(String src, ExtendedBlock blk, DatanodeInfo[] existings, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException { GetAdditionalDatanodeRequestProto req = GetAdditionalDatanodeRequestProto .newBuilder() .setSrc(src) .setBlk(PBHelper.convert(blk)) .addAllExistings(PBHelper.convert(existings)) .addAllExcludes(PBHelper.convert(excludes)) .setNumAdditionalNodes(numAdditionalNodes) .setClientName(clientName) .build(); try { return PBHelper.convert(rpcProxy.getAdditionalDatanode(null, req) .getBlock()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public GetAdditionalDatanodeResponseProto getAdditionalDatanode( RpcController controller, GetAdditionalDatanodeRequestProto req) throws ServiceException { try { List<DatanodeInfoProto> existingList = req.getExistingsList(); List<DatanodeInfoProto> excludesList = req.getExcludesList(); LocatedBlock result = server .getAdditionalDatanode(req.getSrc(), PBHelper.convert(req.getBlk()), PBHelper.convert(existingList .toArray(new DatanodeInfoProto[existingList.size()])), PBHelper.convert(excludesList .toArray(new DatanodeInfoProto[excludesList.size()])), req.getNumAdditionalNodes(), req.getClientName()); return GetAdditionalDatanodeResponseProto.newBuilder() .setBlock(PBHelper.convert(result)).build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public LocatedBlock getAdditionalDatanode(String src, ExtendedBlock blk, DatanodeInfo[] existings, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException { GetAdditionalDatanodeRequestProto req = GetAdditionalDatanodeRequestProto.newBuilder().setSrc(src) .setBlk(PBHelper.convert(blk)) .addAllExistings(PBHelper.convert(existings)) .addAllExcludes(PBHelper.convert(excludes)) .setNumAdditionalNodes(numAdditionalNodes).setClientName(clientName) .build(); try { return PBHelper .convert(rpcProxy.getAdditionalDatanode(null, req).getBlock()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public GetAdditionalDatanodeResponseProto getAdditionalDatanode( RpcController controller, GetAdditionalDatanodeRequestProto req) throws ServiceException { try { List<DatanodeInfoProto> existingList = req.getExistingsList(); List<String> existingStorageIDsList = req.getExistingStorageUuidsList(); List<DatanodeInfoProto> excludesList = req.getExcludesList(); LocatedBlock result = server.getAdditionalDatanode(req.getSrc(), PBHelper.convert(req.getBlk()), PBHelper.convert(existingList.toArray( new DatanodeInfoProto[existingList.size()])), existingStorageIDsList.toArray( new String[existingStorageIDsList.size()]), PBHelper.convert(excludesList.toArray( new DatanodeInfoProto[excludesList.size()])), req.getNumAdditionalNodes(), req.getClientName()); return GetAdditionalDatanodeResponseProto.newBuilder().setBlock( PBHelper.convert(result)) .build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public LocatedBlock getAdditionalDatanode(String src, ExtendedBlock blk, DatanodeInfo[] existings, String[] existingStorageIDs, DatanodeInfo[] excludes, int numAdditionalNodes, String clientName) throws AccessControlException, FileNotFoundException, SafeModeException, UnresolvedLinkException, IOException { GetAdditionalDatanodeRequestProto req = GetAdditionalDatanodeRequestProto .newBuilder() .setSrc(src) .setBlk(PBHelper.convert(blk)) .addAllExistings(PBHelper.convert(existings)) .addAllExistingStorageUuids(Arrays.asList(existingStorageIDs)) .addAllExcludes(PBHelper.convert(excludes)) .setNumAdditionalNodes(numAdditionalNodes) .setClientName(clientName) .build(); try { return PBHelper.convert(rpcProxy.getAdditionalDatanode(null, req) .getBlock()); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }