Class OzoneManager

java.lang.Object
org.apache.hadoop.hdds.server.ServiceRuntimeInfoImpl
org.apache.hadoop.ozone.om.OzoneManager
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.hdds.server.ServiceRuntimeInfo, org.apache.hadoop.ozone.audit.Auditor, org.apache.hadoop.ozone.om.IOmMetadataReader, OMMXBean, org.apache.hadoop.ozone.om.protocol.OMInterServiceProtocol, org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol, org.apache.hadoop.ozone.om.protocol.OzoneManagerSecurityProtocol

@LimitedPrivate({"HDFS","CBLOCK","OZONE","HBASE"}) public final class OzoneManager extends org.apache.hadoop.hdds.server.ServiceRuntimeInfoImpl implements org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol, org.apache.hadoop.ozone.om.protocol.OMInterServiceProtocol, OMMXBean, org.apache.hadoop.ozone.audit.Auditor
Ozone Manager is the metadata manager of ozone.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Method Details

    • initializeEdekCache

      public void initializeEdekCache(org.apache.hadoop.hdds.conf.OzoneConfiguration conf)
    • warmUpEdekCache

      public void warmUpEdekCache(ExecutorService executor, int delay, int interval, int maxRetries)
    • isStopped

      public boolean isStopped()
    • setS3Auth

      public static void setS3Auth(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.S3Authentication val)
      Set the OzoneManagerProtocolProtos.S3Authentication for the current rpc handler thread.
    • getS3Auth

      public static org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.S3Authentication getS3Auth()
      Returns the OzoneManagerProtocolProtos.S3Authentication for the current rpc handler thread.
    • getThreadNamePrefix

      public String getThreadNamePrefix()
      Returns the ThreadName prefix for the current OM.
    • setAllowListAllVolumesFromConfig

      public void setAllowListAllVolumesFromConfig()
    • createOm

      public static OzoneManager createOm(org.apache.hadoop.hdds.conf.OzoneConfiguration conf) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
      Constructs OM instance based on the configuration.
      Parameters:
      conf - OzoneConfiguration
      Returns:
      OM instance
      Throws:
      IOException - AuthenticationException in case OM instance creation fails,
      org.apache.hadoop.security.authentication.client.AuthenticationException
    • createOm

      public static OzoneManager createOm(org.apache.hadoop.hdds.conf.OzoneConfiguration conf, OzoneManager.StartupOption startupOption) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
      Throws:
      IOException
      org.apache.hadoop.security.authentication.client.AuthenticationException
    • getScmClient

      public ScmClient getScmClient()
      Return scmClient.
    • getBlockTokenSecretManager

      public org.apache.hadoop.hdds.security.token.OzoneBlockTokenSecretManager getBlockTokenSecretManager()
      Return SecretManager for OM.
    • getScmBlockSize

      public long getScmBlockSize()
      Return config value of OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE.
    • getPreallocateBlocksMax

      public int getPreallocateBlocksMax()
      Return config value of OzoneConfigKeys.OZONE_KEY_PREALLOCATION_BLOCKS_MAX.
    • isGrpcBlockTokenEnabled

      public boolean isGrpcBlockTokenEnabled()
      Return config value of HddsConfigKeys.HDDS_BLOCK_TOKEN_ENABLED.
    • isS3MultiTenancyEnabled

      public boolean isS3MultiTenancyEnabled()
      Returns true if S3 multi-tenancy is enabled; false otherwise.
    • isStrictS3

      public boolean isStrictS3()
    • checkS3MultiTenancyEnabled

      public void checkS3MultiTenancyEnabled() throws org.apache.hadoop.ozone.om.exceptions.OMException
      Throws OMException FEATURE_NOT_ENABLED if S3 multi-tenancy is not enabled.
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • isSecurityEnabled

      public boolean isSecurityEnabled()
      Return config value of OzoneConfigKeys.OZONE_SECURITY_ENABLED_KEY.
    • isTestSecureOmFlag

      public boolean isTestSecureOmFlag()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • refetchSecretKey

      public UUID refetchSecretKey()
      Specified by:
      refetchSecretKey in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
    • startSecretManager

      public void startSecretManager()
    • setCertClient

      public void setCertClient(org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient newClient) throws IOException
      For testing purpose only.
      Throws:
      IOException
    • setScmTopologyClient

      public void setScmTopologyClient(org.apache.hadoop.hdds.scm.client.ScmTopologyClient scmTopologyClient)
      For testing purpose only. This allows setting up ScmBlockLocationClient without having to fully setup a working cluster.
    • getClusterMap

      public org.apache.hadoop.hdds.scm.net.NetworkTopology getClusterMap()
    • setSecretKeyClient

      public void setSecretKeyClient(org.apache.hadoop.hdds.security.symmetric.SecretKeyClient secretKeyClient)
      For testing purpose only. This allows testing token in integration test without fully setting up a working secure cluster.
    • omInit

      public static boolean omInit(org.apache.hadoop.hdds.conf.OzoneConfiguration conf) throws IOException, org.apache.hadoop.security.authentication.client.AuthenticationException
      Initializes the OM instance.
      Parameters:
      conf - OzoneConfiguration
      Returns:
      true if OM initialization succeeds, false otherwise
      Throws:
      IOException - in case ozone metadata directory path is not accessible
      org.apache.hadoop.security.authentication.client.AuthenticationException
    • initializeSecurity

      public static void initializeSecurity(org.apache.hadoop.hdds.conf.OzoneConfiguration conf, OMStorage omStore, String scmId) throws IOException
      Initializes secure OzoneManager.
      Throws:
      IOException
    • getKeyManager

      public KeyManager getKeyManager()
    • getOmStorage

      public OMStorage getOmStorage()
    • getOmRatisServer

      public OzoneManagerRatisServer getOmRatisServer()
    • getOmSnapshotProvider

      public OmRatisSnapshotProvider getOmSnapshotProvider()
    • getOmRpcServerAddr

      public InetSocketAddress getOmRpcServerAddr()
    • getOmRatisServerState

      public org.apache.ratis.util.LifeCycle.State getOmRatisServerState()
    • getKmsProvider

      public org.apache.hadoop.crypto.key.KeyProviderCryptoExtension getKmsProvider()
    • getPrefixManager

      public PrefixManager getPrefixManager()
    • getVolumeManager

      public VolumeManager getVolumeManager()
    • getBucketManager

      public BucketManager getBucketManager()
    • getAccessAuthorizer

      public org.apache.hadoop.ozone.security.acl.IAccessAuthorizer getAccessAuthorizer()
    • getMetadataManager

      public org.apache.hadoop.ozone.om.OMMetadataManager getMetadataManager()
      Get metadata manager.
      Returns:
      metadata manager.
    • getS3SecretManager

      public org.apache.hadoop.ozone.om.S3SecretManager getS3SecretManager()
    • getOmSnapshotManager

      public OmSnapshotManager getOmSnapshotManager()
      Get snapshot manager.
      Returns:
      Om snapshot manager.
    • getMultiTenantManager

      public OMMultiTenantManager getMultiTenantManager()
      Get metadata manager.
      Returns:
      metadata manager.
    • getBlockTokenMgr

      public org.apache.hadoop.hdds.security.token.OzoneBlockTokenSecretManager getBlockTokenMgr()
    • getOmServerProtocol

      public OzoneManagerProtocolServerSideTranslatorPB getOmServerProtocol()
    • getMetrics

      public OMMetrics getMetrics()
    • getOmSnapshotIntMetrics

      public OmSnapshotInternalMetrics getOmSnapshotIntMetrics()
    • getPerfMetrics

      public OMPerformanceMetrics getPerfMetrics()
    • getDeletionMetrics

      public DeletingServiceMetrics getDeletionMetrics()
    • start

      public void start() throws IOException
      Start service.
      Throws:
      IOException
    • restart

      public void restart() throws IOException
      Restarts the service. This method re-initializes the rpc server.
      Throws:
      IOException
    • bootstrap

      public void bootstrap(org.apache.hadoop.ozone.om.helpers.OMNodeDetails newOMNode) throws IOException
      Specified by:
      bootstrap in interface org.apache.hadoop.ozone.om.protocol.OMInterServiceProtocol
      Throws:
      IOException
    • updatePeerList

      public void updatePeerList(List<String> newPeers)
      When OMStateMachine receives a configuration change update, it calls this function to update the peers list, if required. The configuration change could be to add or to remove an OM from the ring.
    • doesPeerExist

      public boolean doesPeerExist(String omNodeId)
      Check if the input nodeId exists in the peers list.
      Returns:
      true if the nodeId is self or it exists in peer node list, false otherwise.
    • getAllOMNodesInMemory

      public List<org.apache.hadoop.ozone.om.helpers.OMNodeDetails> getAllOMNodesInMemory()
      Return list of all current OM peers (does not reload configuration from disk to find newly configured OMs).
    • getAllOMNodesInNewConf

      public List<org.apache.hadoop.ozone.om.helpers.OMNodeDetails> getAllOMNodesInNewConf()
      Reload configuration from disk and return all the OM nodes present in the new conf under current serviceId.
    • getObjectIdFromTxId

      public long getObjectIdFromTxId(long trxnId)
    • getTransactionInfo

      public org.apache.hadoop.hdds.utils.TransactionInfo getTransactionInfo()
    • setTransactionInfo

      public void setTransactionInfo(org.apache.hadoop.hdds.utils.TransactionInfo info)
    • getRatisSnapshotIndex

      public long getRatisSnapshotIndex() throws IOException
      Throws:
      IOException
    • stop

      public boolean stop()
      Stop service.
    • shutDown

      public void shutDown(String message)
    • terminateOM

      public void terminateOM()
    • join

      public void join()
      Wait until service has completed shutdown.
    • getDelegationToken

      public org.apache.hadoop.security.token.Token<org.apache.hadoop.ozone.security.OzoneTokenIdentifier> getDelegationToken(org.apache.hadoop.io.Text renewer) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Get delegation token from OzoneManager.
      Specified by:
      getDelegationToken in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerSecurityProtocol
      Parameters:
      renewer - Renewer information
      Returns:
      delegationToken DelegationToken signed by OzoneManager
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • renewDelegationToken

      public long renewDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.ozone.security.OzoneTokenIdentifier> token) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Method to renew a delegationToken issued by OzoneManager.
      Specified by:
      renewDelegationToken in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerSecurityProtocol
      Parameters:
      token - token to renew
      Returns:
      new expiryTime of the token
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • cancelDelegationToken

      public void cancelDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.ozone.security.OzoneTokenIdentifier> token) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Cancels a delegation token.
      Specified by:
      cancelDelegationToken in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerSecurityProtocol
      Parameters:
      token - token to cancel
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • isOwner

      public boolean isOwner(org.apache.hadoop.security.UserGroupInformation callerUgi, String ownerName)
    • getVolumeOwner

      public String getVolumeOwner(String vol, org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType type, org.apache.hadoop.ozone.security.acl.OzoneObj.ResourceType resType) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • getBucketOwner

      public String getBucketOwner(String volume, String bucket, org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType type, org.apache.hadoop.ozone.security.acl.OzoneObj.ResourceType resType) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Return the owner of a given bucket.
      Returns:
      String
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • checkAcls

      public boolean checkAcls(org.apache.hadoop.ozone.security.acl.OzoneObj.ResourceType resType, org.apache.hadoop.ozone.security.acl.OzoneObj.StoreType storeType, org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType aclType, String vol, String bucket, String key, org.apache.hadoop.security.UserGroupInformation ugi, InetAddress remoteAddress, String hostName, boolean throwIfPermissionDenied, String owner) throws org.apache.hadoop.ozone.om.exceptions.OMException
      CheckAcls for the ozone object.
      Returns:
      true if permission granted, false if permission denied.
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException - ResultCodes.PERMISSION_DENIED if permission denied and throwOnPermissionDenied set to true.
    • getAclsEnabled

      public boolean getAclsEnabled()
      Return true if Ozone acl's are enabled, else false.
      Returns:
      boolean
    • getAllowListAllVolumes

      public boolean getAllowListAllVolumes()
    • getOmMetadataReader

      public org.apache.ratis.util.function.UncheckedAutoCloseableSupplier<org.apache.hadoop.ozone.om.IOmMetadataReader> getOmMetadataReader()
    • isSpnegoEnabled

      public boolean isSpnegoEnabled()
      Return true if SPNEGO auth is enabled for OM HTTP server, otherwise false.
      Returns:
      boolean
    • getVolumeInfo

      public org.apache.hadoop.ozone.om.helpers.OmVolumeArgs getVolumeInfo(String volume) throws IOException
      Gets the volume information.
      Specified by:
      getVolumeInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Parameters:
      volume - - Volume name.
      Returns:
      VolumeArgs or exception is thrown.
      Throws:
      IOException
    • listVolumeByUser

      public List<org.apache.hadoop.ozone.om.helpers.OmVolumeArgs> listVolumeByUser(String userName, String prefix, String prevKey, int maxKeys) throws IOException
      Lists volumes accessible by a specific user.
      Specified by:
      listVolumeByUser in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Parameters:
      userName - - user name
      prefix - - Filter prefix -- Return only entries that match this.
      prevKey - - Previous key -- List starts from the next from the prevkey
      maxKeys - - Max number of keys to return.
      Returns:
      List of Volumes.
      Throws:
      IOException
    • listAllVolumes

      public List<org.apache.hadoop.ozone.om.helpers.OmVolumeArgs> listAllVolumes(String prefix, String prevKey, int maxKeys) throws IOException
      Lists volume all volumes in the cluster.
      Specified by:
      listAllVolumes in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Parameters:
      prefix - - Filter prefix -- Return only entries that match this.
      prevKey - - Previous key -- List starts from the next from the prevkey
      maxKeys - - Max number of keys to return.
      Returns:
      List of Volumes.
      Throws:
      IOException
    • listBuckets

      public List<org.apache.hadoop.ozone.om.helpers.OmBucketInfo> listBuckets(String volumeName, String startKey, String prefix, int maxNumOfBuckets, boolean hasSnapshot) throws IOException
      Specified by:
      listBuckets in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getBucketInfo

      public org.apache.hadoop.ozone.om.helpers.OmBucketInfo getBucketInfo(String volume, String bucket) throws IOException
      Gets the bucket information.
      Specified by:
      getBucketInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Parameters:
      volume - - Volume name.
      bucket - - Bucket name.
      Returns:
      OmBucketInfo or exception is thrown.
      Throws:
      IOException
    • lookupKey

      public org.apache.hadoop.ozone.om.helpers.OmKeyInfo lookupKey(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args) throws IOException
      Specified by:
      lookupKey in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      lookupKey in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getKeyInfo

      public org.apache.hadoop.ozone.om.helpers.KeyInfoWithVolumeContext getKeyInfo(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args, boolean assumeS3Context) throws IOException
      Specified by:
      getKeyInfo in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      getKeyInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listKeys

      public org.apache.hadoop.ozone.om.helpers.ListKeysResult listKeys(String volumeName, String bucketName, String startKey, String keyPrefix, int maxKeys) throws IOException
      Specified by:
      listKeys in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Throws:
      IOException
    • listKeysLight

      public org.apache.hadoop.ozone.om.helpers.ListKeysLightResult listKeysLight(String volumeName, String bucketName, String startKey, String keyPrefix, int maxKeys) throws IOException
      Specified by:
      listKeysLight in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Throws:
      IOException
    • getSnapshotInfo

      public org.apache.hadoop.ozone.om.helpers.SnapshotInfo getSnapshotInfo(String volumeName, String bucketName, String snapshotName) throws IOException
      Specified by:
      getSnapshotInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listSnapshot

      public org.apache.hadoop.ozone.snapshot.ListSnapshotResponse listSnapshot(String volumeName, String bucketName, String snapshotPrefix, String prevSnapshot, int maxListResult) throws IOException
      Specified by:
      listSnapshot in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getAuditLogger

      public org.apache.hadoop.ozone.audit.AuditLogger getAuditLogger()
    • getSystemAuditLogger

      public org.apache.hadoop.ozone.audit.AuditLogger getSystemAuditLogger()
    • buildAuditMessageForSuccess

      public org.apache.hadoop.ozone.audit.AuditMessage buildAuditMessageForSuccess(org.apache.hadoop.ozone.audit.AuditAction op, Map<String,String> auditMap)
      Specified by:
      buildAuditMessageForSuccess in interface org.apache.hadoop.ozone.audit.Auditor
    • buildAuditMessageForFailure

      public org.apache.hadoop.ozone.audit.AuditMessage buildAuditMessageForFailure(org.apache.hadoop.ozone.audit.AuditAction op, Map<String,String> auditMap, Throwable throwable)
      Specified by:
      buildAuditMessageForFailure in interface org.apache.hadoop.ozone.audit.Auditor
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.apache.hadoop.hdds.server.ServiceRuntimeInfo
    • getRpcPort

      public String getRpcPort()
      Specified by:
      getRpcPort in interface OMMXBean
    • getRatisRoles

      public List<List<String>> getRatisRoles()
      Specified by:
      getRatisRoles in interface OMMXBean
    • omHAMetricsInit

      public void omHAMetricsInit(String leaderId)
      Create OMHAMetrics instance.
    • getOmhaMetrics

      public OMHAMetrics getOmhaMetrics()
    • getRatisLogDirectory

      public String getRatisLogDirectory()
      Specified by:
      getRatisLogDirectory in interface OMMXBean
    • getRocksDbDirectory

      public String getRocksDbDirectory()
      Specified by:
      getRocksDbDirectory in interface OMMXBean
    • getHostname

      public String getHostname()
      Description copied from interface: OMMXBean
      Gets the OM hostname.
      Specified by:
      getHostname in interface OMMXBean
      Returns:
      the OM hostname for the datanode.
    • getHttpServer

      public OzoneManagerHttpServer getHttpServer()
    • getServiceList

      public List<org.apache.hadoop.ozone.om.helpers.ServiceInfo> getServiceList() throws IOException
      Specified by:
      getServiceList in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getServiceInfo

      public org.apache.hadoop.ozone.om.helpers.ServiceInfoEx getServiceInfo() throws IOException
      Specified by:
      getServiceInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listOpenFiles

      public org.apache.hadoop.ozone.om.helpers.ListOpenFilesResult listOpenFiles(String path, int maxKeys, String contToken) throws IOException
      Specified by:
      listOpenFiles in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • transferLeadership

      public void transferLeadership(String newLeaderId) throws IOException
      Specified by:
      transferLeadership in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • triggerRangerBGSync

      public boolean triggerRangerBGSync(boolean noWait) throws IOException
      Specified by:
      triggerRangerBGSync in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • finalizeUpgrade

      public org.apache.hadoop.ozone.upgrade.UpgradeFinalization.StatusAndMessages finalizeUpgrade(String upgradeClientID) throws IOException
      Specified by:
      finalizeUpgrade in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • queryUpgradeFinalizationProgress

      public org.apache.hadoop.ozone.upgrade.UpgradeFinalization.StatusAndMessages queryUpgradeFinalizationProgress(String upgradeClientID, boolean takeover, boolean readonly) throws IOException
      Specified by:
      queryUpgradeFinalizationProgress in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listTenant

      public org.apache.hadoop.ozone.om.helpers.TenantStateList listTenant() throws IOException
      List tenants.
      Specified by:
      listTenant in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • tenantGetUserInfo

      public org.apache.hadoop.ozone.om.helpers.TenantUserInfoValue tenantGetUserInfo(String userPrincipal) throws IOException
      Tenant get user info.
      Specified by:
      tenantGetUserInfo in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listUsersInTenant

      public org.apache.hadoop.ozone.om.helpers.TenantUserList listUsersInTenant(String tenantId, String prefix) throws IOException
      Specified by:
      listUsersInTenant in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getS3VolumeContext

      public org.apache.hadoop.ozone.om.helpers.S3VolumeContext getS3VolumeContext() throws IOException
      Specified by:
      getS3VolumeContext in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listParts

      public org.apache.hadoop.ozone.om.helpers.OmMultipartUploadListParts listParts(String volumeName, String bucketName, String keyName, String uploadID, int partNumberMarker, int maxParts) throws IOException
      Specified by:
      listParts in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listMultipartUploads

      public org.apache.hadoop.ozone.om.helpers.OmMultipartUploadList listMultipartUploads(String volumeName, String bucketName, String prefix, String keyMarker, String uploadIdMarker, int maxUploads, boolean withPagination) throws IOException
      Specified by:
      listMultipartUploads in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getFileStatus

      public org.apache.hadoop.ozone.om.helpers.OzoneFileStatus getFileStatus(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args) throws IOException
      Specified by:
      getFileStatus in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Throws:
      IOException
    • lookupFile

      public org.apache.hadoop.ozone.om.helpers.OmKeyInfo lookupFile(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args) throws IOException
      Specified by:
      lookupFile in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      lookupFile in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listStatus

      public List<org.apache.hadoop.ozone.om.helpers.OzoneFileStatus> listStatus(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args, boolean recursive, String startKey, long numEntries) throws IOException
      Specified by:
      listStatus in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      listStatus in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listStatus

      public List<org.apache.hadoop.ozone.om.helpers.OzoneFileStatus> listStatus(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args, boolean recursive, String startKey, long numEntries, boolean allowPartialPrefixes) throws IOException
      Specified by:
      listStatus in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      listStatus in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listStatusLight

      public List<org.apache.hadoop.ozone.om.helpers.OzoneFileStatusLight> listStatusLight(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args, boolean recursive, String startKey, long numEntries, boolean allowPartialPrefixes) throws IOException
      Specified by:
      listStatusLight in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      listStatusLight in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getAcl

      public List<org.apache.hadoop.ozone.OzoneAcl> getAcl(org.apache.hadoop.ozone.security.acl.OzoneObj obj) throws IOException
      Specified by:
      getAcl in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Throws:
      IOException
    • installSnapshotFromLeader

      public org.apache.ratis.server.protocol.TermIndex installSnapshotFromLeader(String leaderId)
      Download and install latest checkpoint from leader OM.
      Parameters:
      leaderId - peerNodeID of the leader OM
      Returns:
      If checkpoint is installed successfully, return the corresponding termIndex. Otherwise, return null.
    • getLogger

      public static org.slf4j.Logger getLogger()
    • getConfiguration

      public org.apache.hadoop.hdds.conf.OzoneConfiguration getConfiguration()
    • getConfig

      public org.apache.hadoop.ozone.om.OmConfig getConfig()
    • setConfiguration

      public void setConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration conf)
    • reloadConfiguration

      public org.apache.hadoop.hdds.conf.OzoneConfiguration reloadConfiguration()
    • setTestReloadConfigFlag

      public static void setTestReloadConfigFlag(boolean testReloadConfigFlag)
    • setTestSecureOmFlag

      public static void setTestSecureOmFlag(boolean testSecureOmFlag)
    • setUgi

      public static void setUgi(org.apache.hadoop.security.UserGroupInformation user)
    • getNodeDetails

      public org.apache.hadoop.ozone.om.helpers.OMNodeDetails getNodeDetails()
    • getOMNodeId

      public String getOMNodeId()
    • getOMServiceId

      public String getOMServiceId()
    • getPeerNodes

      public List<org.apache.hadoop.ozone.om.helpers.OMNodeDetails> getPeerNodes()
    • getPeerNode

      public org.apache.hadoop.ozone.om.helpers.OMNodeDetails getPeerNode(String nodeID)
    • getCertificateClient

      public org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient getCertificateClient()
    • getComponent

      public String getComponent()
    • getMaxUserVolumeCount

      public long getMaxUserVolumeCount()
      Return maximum volumes count per user.
      Returns:
      maxUserVolumeCount
    • isLeaderReady

      public boolean isLeaderReady()
      Return true, if the current OM node is leader and in ready state to process the requests. If ratis is not enabled, then it always returns true.
    • checkLeaderStatus

      public void checkLeaderStatus() throws org.apache.hadoop.ozone.om.exceptions.OMNotLeaderException, org.apache.hadoop.ozone.om.exceptions.OMLeaderNotReadyException
      Checks the leader status. Does nothing if this OM is leader and is ready.
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMLeaderNotReadyException - if leader, but not ready
      org.apache.hadoop.ozone.om.exceptions.OMNotLeaderException - if not leader
    • isFilesystemSnapshotEnabled

      public boolean isFilesystemSnapshotEnabled()
      Returns:
      true if Ozone filesystem snapshot is enabled, false otherwise.
    • getDBUpdates

      public org.apache.hadoop.ozone.om.helpers.DBUpdates getDBUpdates(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.DBUpdatesRequest dbUpdatesRequest) throws IOException
      Get DB updates since a specific sequence number.
      Specified by:
      getDBUpdates in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Parameters:
      dbUpdatesRequest - request that encapsulates a sequence number.
      Returns:
      Wrapper containing the updates.
      Throws:
      org.apache.hadoop.hdds.utils.db.SequenceNumberNotFoundException - if db is unable to read the data.
      IOException
    • getDelegationTokenMgr

      public OzoneDelegationTokenSecretManager getDelegationTokenMgr()
    • getOmAdminUsernames

      public Collection<String> getOmAdminUsernames()
      Return the list of Ozone administrators in effect.
    • getOmReadOnlyAdminUsernames

      public Collection<String> getOmReadOnlyAdminUsernames()
    • getOmAdminGroups

      public Collection<String> getOmAdminGroups()
    • isReadOnlyAdmin

      public boolean isReadOnlyAdmin(org.apache.hadoop.security.UserGroupInformation callerUgi)
      Parameters:
      callerUgi - Caller UserGroupInformation
      Returns:
      return true if the ugi is a read-only OM admin
    • isAdmin

      public boolean isAdmin(org.apache.hadoop.security.UserGroupInformation callerUgi)
      Return true if a UserGroupInformation is OM admin, false otherwise.
      Parameters:
      callerUgi - Caller UserGroupInformation
    • isS3Admin

      public boolean isS3Admin(org.apache.hadoop.security.UserGroupInformation callerUgi)
    • isRunning

      public boolean isRunning()
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.KeyArgs args, OMClientRequest omClientRequest) throws IOException
      Throws:
      IOException
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.commons.lang3.tuple.Pair<String,String> requested) throws IOException
      Throws:
      IOException
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args) throws IOException
      Throws:
      IOException
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.commons.lang3.tuple.Pair<String,String> requested, OMClientRequest omClientRequest) throws IOException
      Throws:
      IOException
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.commons.lang3.tuple.Pair<String,String> requested, boolean allowDanglingBuckets) throws IOException
      Throws:
      IOException
    • resolveBucketLink

      public ResolvedBucket resolveBucketLink(org.apache.commons.lang3.tuple.Pair<String,String> requested, boolean allowDanglingBuckets, boolean aclEnabled) throws IOException
      Throws:
      IOException
    • setExitManagerForTesting

      public void setExitManagerForTesting(org.apache.hadoop.hdds.ExitManager exitManagerForTesting)
    • getEnableFileSystemPaths

      public boolean getEnableFileSystemPaths()
    • getKeyPathLockEnabled

      public boolean getKeyPathLockEnabled()
    • getOzoneLockProvider

      public OzoneLockProvider getOzoneLockProvider()
    • getDefaultReplicationConfig

      public org.apache.hadoop.hdds.client.ReplicationConfig getDefaultReplicationConfig()
    • setReplicationFromConfig

      public void setReplicationFromConfig()
    • getOMDefaultBucketLayout

      public org.apache.hadoop.ozone.om.helpers.BucketLayout getOMDefaultBucketLayout()
    • getVersionManager

      public OMLayoutVersionManager getVersionManager()
    • getPrepareState

      public OzoneManagerPrepareState getPrepareState()
    • getMinMultipartUploadPartSize

      public int getMinMultipartUploadPartSize()
    • setMinMultipartUploadPartSize

      public void setMinMultipartUploadPartSize(int partSizeForTest)
    • isOmRpcServerRunning

      public boolean isOmRpcServerRunning()
    • echoRPCReq

      public org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.EchoRPCResponse echoRPCReq(byte[] payloadReq, int payloadSizeResp, boolean writeToRatis)
      Specified by:
      echoRPCReq in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
    • recoverLease

      public org.apache.hadoop.ozone.om.helpers.LeaseKeyInfo recoverLease(String volumeName, String bucketName, String keyName, boolean force)
      Specified by:
      recoverLease in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
    • setTimes

      public void setTimes(org.apache.hadoop.ozone.om.helpers.OmKeyArgs keyArgs, long mtime, long atime) throws IOException
      Specified by:
      setTimes in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • setSafeMode

      public boolean setSafeMode(org.apache.hadoop.fs.SafeModeAction action, boolean isChecked) throws IOException
      Specified by:
      setSafeMode in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getQuotaRepairStatus

      public String getQuotaRepairStatus() throws IOException
      Specified by:
      getQuotaRepairStatus in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • startQuotaRepair

      public void startQuotaRepair(List<String> buckets) throws IOException
      Specified by:
      startQuotaRepair in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getObjectTagging

      public Map<String,String> getObjectTagging(org.apache.hadoop.ozone.om.helpers.OmKeyArgs args) throws IOException
      Specified by:
      getObjectTagging in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      Specified by:
      getObjectTagging in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • getOmDetailsProto

      public static org.apache.hadoop.hdds.protocol.proto.HddsProtos.OzoneManagerDetailsProto getOmDetailsProto(org.apache.hadoop.hdds.conf.ConfigurationSource config, String omID)
    • snapshotDiff

      public org.apache.hadoop.ozone.snapshot.SnapshotDiffResponse snapshotDiff(String volume, String bucket, String fromSnapshot, String toSnapshot, String token, int pageSize, boolean forceFullDiff, boolean disableNativeDiff) throws IOException
      Specified by:
      snapshotDiff in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • cancelSnapshotDiff

      public org.apache.hadoop.ozone.snapshot.CancelSnapshotDiffResponse cancelSnapshotDiff(String volume, String bucket, String fromSnapshot, String toSnapshot) throws IOException
      Specified by:
      cancelSnapshotDiff in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • listSnapshotDiffJobs

      public org.apache.hadoop.ozone.snapshot.ListSnapshotDiffJobResponse listSnapshotDiffJobs(String volume, String bucket, String jobStatus, boolean listAllStatus, String prevSnapshotDiffJob, int maxListResult) throws IOException
      Specified by:
      listSnapshotDiffJobs in interface org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol
      Throws:
      IOException
    • validateReplicationConfig

      public void validateReplicationConfig(org.apache.hadoop.hdds.client.ReplicationConfig replicationConfig) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • getReplicationConfigValidator

      public org.apache.hadoop.hdds.client.ReplicationConfigValidator getReplicationConfigValidator()
    • getReconfigurationHandler

      public org.apache.hadoop.hdds.conf.ReconfigurationHandler getReconfigurationHandler()
    • awaitDoubleBufferFlush

      public void awaitDoubleBufferFlush() throws InterruptedException
      Wait until both buffers are flushed. This is used in cases like "follower bootstrap tarball creation" where the rocksDb for the active fs needs to synchronized with the rocksdb's for the snapshots.
      Throws:
      InterruptedException
    • checkFeatureEnabled

      public void checkFeatureEnabled(org.apache.hadoop.ozone.OzoneManagerVersion feature) throws org.apache.hadoop.ozone.om.exceptions.OMException
      Throws:
      org.apache.hadoop.ozone.om.exceptions.OMException
    • compactOMDB

      public void compactOMDB(String columnFamily) throws IOException
      Throws:
      IOException
    • getOmExecutionFlow

      public OMExecutionFlow getOmExecutionFlow()