Package org.apache.hadoop.ozone.om
Class BucketManagerImpl
java.lang.Object
org.apache.hadoop.ozone.om.BucketManagerImpl
- All Implemented Interfaces:
BucketManager,IOzoneAcl
Implementation for
BucketManager
BucketManager uses MetadataDB to store bucket level information.
Keys used in BucketManager for storing data into MetadataDB
for BucketInfo:
{volume/bucket} -> bucketInfo-
Constructor Summary
ConstructorsConstructorDescriptionBucketManagerImpl(OzoneManager ozoneManager, org.apache.hadoop.ozone.om.OMMetadataManager metadataManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAccess(org.apache.hadoop.ozone.security.acl.OzoneObj ozObject, org.apache.hadoop.ozone.security.acl.RequestContext context) Check access for given ozoneObject.List<org.apache.hadoop.ozone.OzoneAcl> getAcl(org.apache.hadoop.ozone.security.acl.OzoneObj obj) Returns list of ACLs for given Ozone object.org.apache.hadoop.ozone.om.helpers.OmBucketInfogetBucketInfo(String volumeName, String bucketName) Retrieve bucket info.List<org.apache.hadoop.ozone.om.helpers.OmBucketInfo> listBuckets(String volumeName, String startBucket, String bucketPrefix, int maxNumOfBuckets, boolean hasSnapshot) Returns a list of buckets represented byOmBucketInfoin the given volume.
-
Constructor Details
-
BucketManagerImpl
public BucketManagerImpl(OzoneManager ozoneManager, org.apache.hadoop.ozone.om.OMMetadataManager metadataManager)
-
-
Method Details
-
getBucketInfo
public org.apache.hadoop.ozone.om.helpers.OmBucketInfo getBucketInfo(String volumeName, String bucketName) throws IOException Retrieve bucket info. This method does not follow the bucket link and returns only this bucket properties.- Specified by:
getBucketInfoin interfaceBucketManager- Parameters:
volumeName- - Name of the Volume.bucketName- - Name of the Bucket.- Returns:
- Bucket Information.
- Throws:
IOException
-
listBuckets
public List<org.apache.hadoop.ozone.om.helpers.OmBucketInfo> listBuckets(String volumeName, String startBucket, String bucketPrefix, int maxNumOfBuckets, boolean hasSnapshot) throws IOException Description copied from interface:BucketManagerReturns a list of buckets represented byOmBucketInfoin the given volume.- Specified by:
listBucketsin interfaceBucketManager- Parameters:
volumeName- Required parameter volume name determines buckets in which volume to return.startBucket- Optional start bucket name parameter indicating where to start the bucket listing from, this key is excluded from the result.bucketPrefix- Optional start key parameter, restricting the response to buckets that begin with the specified name.maxNumOfBuckets- The maximum number of buckets to return. It ensures the size of the result will not exceed this limit.hasSnapshot- Set the flag to list buckets which have snapshots.- Returns:
- a list of buckets.
- Throws:
IOException
-
getAcl
public List<org.apache.hadoop.ozone.OzoneAcl> getAcl(org.apache.hadoop.ozone.security.acl.OzoneObj obj) throws IOException Description copied from interface:IOzoneAclReturns list of ACLs for given Ozone object.- Specified by:
getAclin interfaceIOzoneAcl- Parameters:
obj- Ozone object.- Throws:
IOException- if there is error.
-
checkAccess
public boolean checkAccess(org.apache.hadoop.ozone.security.acl.OzoneObj ozObject, org.apache.hadoop.ozone.security.acl.RequestContext context) throws org.apache.hadoop.ozone.om.exceptions.OMException Description copied from interface:IOzoneAclCheck access for given ozoneObject.- Specified by:
checkAccessin interfaceIOzoneAcl- Parameters:
ozObject- object for which access needs to be checked.context- Context object encapsulating all user related information.- Returns:
- true if user has access else false.
- Throws:
org.apache.hadoop.ozone.om.exceptions.OMException
-