Search in sources :

Example 1 with SetQuotaRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.SetQuotaRequestProto in project hadoop by apache.

the class ClientNamenodeProtocolTranslatorPB method setQuota.

@Override
public void setQuota(String path, long namespaceQuota, long storagespaceQuota, StorageType type) throws IOException {
    final SetQuotaRequestProto.Builder builder = SetQuotaRequestProto.newBuilder().setPath(path).setNamespaceQuota(namespaceQuota).setStoragespaceQuota(storagespaceQuota);
    if (type != null) {
        builder.setStorageType(PBHelperClient.convertStorageType(type));
    }
    final SetQuotaRequestProto req = builder.build();
    try {
        rpcProxy.setQuota(null, req);
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) SetQuotaRequestProto(org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.SetQuotaRequestProto)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 SetQuotaRequestProto (org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.SetQuotaRequestProto)1