@Override public CommitBlockSynchronizationResponseProto commitBlockSynchronization( RpcController controller, CommitBlockSynchronizationRequestProto request) throws ServiceException { List<DatanodeIDProto> dnprotos = request.getNewTaragetsList(); DatanodeID[] dns = new DatanodeID[dnprotos.size()]; for (int i = 0; i < dnprotos.size(); i++) { dns[i] = PBHelper.convert(dnprotos.get(i)); } final List<String> sidprotos = request.getNewTargetStoragesList(); final String[] storageIDs = sidprotos.toArray(new String[sidprotos.size()]); try { impl.commitBlockSynchronization(PBHelper.convert(request.getBlock()), request.getNewGenStamp(), request.getNewLength(), request.getCloseFile(), request.getDeleteBlock(), dns, storageIDs); } catch (IOException e) { throw new ServiceException(e); } return VOID_COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO; }
@Override public CommitBlockSynchronizationResponseProto commitBlockSynchronization( RpcController controller, CommitBlockSynchronizationRequestProto request) throws ServiceException { List<DatanodeIDProto> dnprotos = request.getNewTaragetsList(); DatanodeID[] dns = new DatanodeID[dnprotos.size()]; for (int i = 0; i < dnprotos.size(); i++) { dns[i] = PBHelperClient.convert(dnprotos.get(i)); } final List<String> sidprotos = request.getNewTargetStoragesList(); final String[] storageIDs = sidprotos.toArray(new String[sidprotos.size()]); try { impl.commitBlockSynchronization(PBHelperClient.convert(request.getBlock()), request.getNewGenStamp(), request.getNewLength(), request.getCloseFile(), request.getDeleteBlock(), dns, storageIDs); } catch (IOException e) { throw new ServiceException(e); } return VOID_COMMIT_BLOCK_SYNCHRONIZATION_RESPONSE_PROTO; }