Class BucketManagerImpl

java.lang.Object
org.apache.hadoop.ozone.om.BucketManagerImpl
All Implemented Interfaces:
BucketManager, IOzoneAcl

public class BucketManagerImpl extends Object implements BucketManager
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

    Constructors
    Constructor
    Description
    BucketManagerImpl(OzoneManager ozoneManager, org.apache.hadoop.ozone.om.OMMetadataManager metadataManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkAccess(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.OmBucketInfo
    getBucketInfo(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 by OmBucketInfo in the given volume.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      getBucketInfo in interface BucketManager
      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: BucketManager
      Returns a list of buckets represented by OmBucketInfo in the given volume.
      Specified by:
      listBuckets in interface BucketManager
      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: IOzoneAcl
      Returns list of ACLs for given Ozone object.
      Specified by:
      getAcl in interface IOzoneAcl
      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: IOzoneAcl
      Check access for given ozoneObject.
      Specified by:
      checkAccess in interface IOzoneAcl
      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