@Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { HdfsFileStatus result = server.create(req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convertCreateFlag(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize(), PBHelper.convertCryptoProtocolVersions( req.getCryptoProtocolVersionList())); if (result != null) { return CreateResponseProto.newBuilder().setFs(PBHelper.convert(result)) .build(); } return VOID_CREATE_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } }
@Override public HdfsFileStatus create(String src, FsPermission masked, String clientName, EnumSetWritable<CreateFlag> flag, boolean createParent, short replication, long blockSize, CryptoProtocolVersion[] supportedVersions) throws IOException { CreateRequestProto.Builder builder = CreateRequestProto.newBuilder() .setSrc(src) .setMasked(PBHelperClient.convert(masked)) .setClientName(clientName) .setCreateFlag(PBHelperClient.convertCreateFlag(flag)) .setCreateParent(createParent) .setReplication(replication) .setBlockSize(blockSize); builder.addAllCryptoProtocolVersion( PBHelperClient.convert(supportedVersions)); CreateRequestProto req = builder.build(); try { CreateResponseProto res = rpcProxy.create(null, req); return res.hasFs() ? PBHelperClient.convert(res.getFs()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { HdfsFileStatus result = server.create(req.getSrc(), PBHelperClient.convert(req.getMasked()), req.getClientName(), PBHelperClient.convertCreateFlag(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize(), PBHelperClient.convertCryptoProtocolVersions( req.getCryptoProtocolVersionList())); if (result != null) { return CreateResponseProto.newBuilder().setFs(PBHelperClient.convert(result)) .build(); } return VOID_CREATE_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } }
@Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { HdfsFileStatus result = server.create(req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convert(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize()); if (result != null) { return CreateResponseProto.newBuilder().setFs(PBHelper.convert(result)) .build(); } return VOID_CREATE_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } }
@Override public HdfsFileStatus create(String src, FsPermission masked, String clientName, EnumSetWritable<CreateFlag> flag, boolean createParent, short replication, long blockSize) throws AccessControlException, AlreadyBeingCreatedException, DSQuotaExceededException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, IOException { CreateRequestProto req = CreateRequestProto.newBuilder() .setSrc(src) .setMasked(PBHelper.convert(masked)) .setClientName(clientName) .setCreateFlag(PBHelper.convertCreateFlag(flag)) .setCreateParent(createParent) .setReplication(replication) .setBlockSize(blockSize) .build(); try { CreateResponseProto res = rpcProxy.create(null, req); return res.hasFs() ? PBHelper.convert(res.getFs()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { HdfsFileStatus result = null; if (req.hasPolicy()) { result = server.create(req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convert(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize(), PBHelper.convert(req.getPolicy())); } else { result = server.create(req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convert(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize()); } if (result != null) { return CreateResponseProto.newBuilder().setFs(PBHelper.convert(result)) .build(); } } catch (IOException e) { throw new ServiceException(e); } return VOID_CREATE_RESPONSE; }
@Override public HdfsFileStatus create(String src, FsPermission masked, String clientName, EnumSetWritable<CreateFlag> flag, boolean createParent, short replication, long blockSize, EncodingPolicy policy) throws AccessControlException, AlreadyBeingCreatedException, DSQuotaExceededException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, IOException { CreateRequestProto.Builder builder = CreateRequestProto.newBuilder().setSrc(src) .setMasked(PBHelper.convert(masked)).setClientName(clientName) .setCreateFlag(PBHelper.convertCreateFlag(flag)) .setCreateParent(createParent).setReplication(replication) .setBlockSize(blockSize); if (policy != null) { builder.setPolicy(PBHelper.convert(policy)); } CreateRequestProto req = builder.build(); try { CreateResponseProto result = rpcProxy.create(null, req); return result.hasFs() ? PBHelper.convert(result.getFs()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { HdfsFileStatus result = server.create(req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convertCreateFlag(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize()); if (result != null) { return CreateResponseProto.newBuilder().setFs(PBHelper.convert(result)) .build(); } return VOID_CREATE_RESPONSE; } catch (IOException e) { throw new ServiceException(e); } }
@Override public HdfsFileStatus create(String src, FsPermission masked, String clientName, EnumSetWritable<CreateFlag> flag, boolean createParent, short replication, long blockSize, CryptoProtocolVersion[] supportedVersions) throws AccessControlException, AlreadyBeingCreatedException, DSQuotaExceededException, FileAlreadyExistsException, FileNotFoundException, NSQuotaExceededException, ParentNotDirectoryException, SafeModeException, UnresolvedLinkException, IOException { CreateRequestProto.Builder builder = CreateRequestProto.newBuilder() .setSrc(src) .setMasked(PBHelper.convert(masked)) .setClientName(clientName) .setCreateFlag(PBHelper.convertCreateFlag(flag)) .setCreateParent(createParent) .setReplication(replication) .setBlockSize(blockSize); builder.addAllCryptoProtocolVersion(PBHelper.convert(supportedVersions)); CreateRequestProto req = builder.build(); try { CreateResponseProto res = rpcProxy.create(null, req); return res.hasFs() ? PBHelper.convert(res.getFs()) : null; } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }