@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 CreateResponseProto create(RpcController controller, CreateRequestProto req) throws ServiceException { try { server.create( req.getSrc(), PBHelper.convert(req.getMasked()), req.getClientName(), PBHelper.convert(req.getCreateFlag()), req.getCreateParent(), (short) req.getReplication(), req.getBlockSize()); } catch (IOException e) { throw new ServiceException(e); } return VOID_CREATE_RESPONSE; }