Search in sources :

Example 1 with OMKeyAddAclRequest

use of org.apache.hadoop.ozone.om.request.key.acl.OMKeyAddAclRequest in project ozone by apache.

the class TestOMKeyAclRequest method createAddAclkeyRequest.

/**
 * Create OMRequest which encapsulates OMKeyAddAclRequest.
 */
protected OMRequest createAddAclkeyRequest(OzoneAcl acl) {
    OzoneObj obj = OzoneObjInfo.Builder.newBuilder().setBucketName(bucketName).setVolumeName(volumeName).setKeyName(keyName).setResType(OzoneObj.ResourceType.KEY).setStoreType(OzoneObj.StoreType.OZONE).build();
    AddAclRequest addAclRequest = AddAclRequest.newBuilder().setObj(OzoneObj.toProtobuf(obj)).setAcl(OzoneAcl.toProtobuf(acl)).build();
    return OMRequest.newBuilder().setClientId(UUID.randomUUID().toString()).setCmdType(OzoneManagerProtocolProtos.Type.AddAcl).setAddAclRequest(addAclRequest).build();
}
Also used : OzoneObj(org.apache.hadoop.ozone.security.acl.OzoneObj) AddAclRequest(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.AddAclRequest) OMKeyAddAclRequest(org.apache.hadoop.ozone.om.request.key.acl.OMKeyAddAclRequest)

Aggregations

OMKeyAddAclRequest (org.apache.hadoop.ozone.om.request.key.acl.OMKeyAddAclRequest)1 AddAclRequest (org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.AddAclRequest)1 OzoneObj (org.apache.hadoop.ozone.security.acl.OzoneObj)1