Class OmSnapshot

java.lang.Object
org.apache.hadoop.ozone.om.OmSnapshot
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.ozone.om.IOmMetadataReader

public class OmSnapshot extends Object implements org.apache.hadoop.ozone.om.IOmMetadataReader, Closeable
Metadata Reading class for OM Snapshots.

This abstraction manages all the metadata key/acl reading from a rocksDb instance, for OM snapshots. It's basically identical to the ozoneManager OmMetadataReader with two exceptions:

1. Its keymanager and prefix manager contain an OmMetadataManager that reads from a snapshot.

2. It normalizes/denormalizes each request as it comes in to remove/replace the ".snapshot/snapshotName" prefix.

  • Constructor Details

  • Method Details

    • 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
      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
      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
      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
      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
      Throws:
      IOException
    • listKeys

      public org.apache.hadoop.ozone.om.helpers.ListKeysResult listKeys(String vname, String bname, 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 volName, String buckName, String startKey, String keyPrefix, int maxKeys) throws IOException
      Specified by:
      listKeysLight in interface org.apache.hadoop.ozone.om.IOmMetadataReader
      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
    • 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
      Throws:
      IOException
    • getName

      public String getName()
    • getSnapshotID

      public UUID getSnapshotID()
    • close

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

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getMetadataManager

      public org.apache.hadoop.ozone.om.OMMetadataManager getMetadataManager()
    • getKeyManager

      public KeyManager getKeyManager()
    • getSnapshotTableKey

      public String getSnapshotTableKey()
      Returns:
      DB snapshot table key for this OmSnapshot instance.