Java 类org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.CreateResponseProto 实例源码

项目:hadoop    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:aliyun-oss-hadoop-fs    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:aliyun-oss-hadoop-fs    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:big-c    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hadoop-plus    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hadoop-plus    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:FlexMap    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hops    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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;
}
项目:hops    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }
}
项目:hadoop-TCP    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hadoop-TCP    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:hardfs    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hardfs    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:hadoop-on-lustre2    文件:ClientNamenodeProtocolServerSideTranslatorPB.java   
@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);
  }
}
项目:hadoop-on-lustre2    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:hadoop    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:big-c    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:hadoop-2.6.0-cdh5.4.3    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}
项目:FlexMap    文件:ClientNamenodeProtocolTranslatorPB.java   
@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);
  }

}