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();
}
Aggregations