Class EncryptionZoneManager

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.EncryptionZoneManager

public class EncryptionZoneManager extends Object
Manages the list of encryption zones in the filesystem.

The EncryptionZoneManager has its own lock, but relies on the FSDirectory lock being held for many operations. The FSDirectory lock should not be taken if the manager lock is already held.

  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
    • EMPTY_LIST

      public static final org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries<org.apache.hadoop.hdfs.protocol.ZoneReencryptionStatus> EMPTY_LIST
  • Constructor Details

    • EncryptionZoneManager

      public EncryptionZoneManager(FSDirectory dir, org.apache.hadoop.conf.Configuration conf)
      Construct a new EncryptionZoneManager.
      Parameters:
      dir - Enclosing FSDirectory
  • Method Details

    • pauseReencryptForTesting

      @VisibleForTesting public void pauseReencryptForTesting()
    • resumeReencryptForTesting

      @VisibleForTesting public void resumeReencryptForTesting()
    • pauseForTestingAfterNthSubmission

      @VisibleForTesting public void pauseForTestingAfterNthSubmission(int count)
    • pauseReencryptUpdaterForTesting

      @VisibleForTesting public void pauseReencryptUpdaterForTesting()
    • resumeReencryptUpdaterForTesting

      @VisibleForTesting public void resumeReencryptUpdaterForTesting()
    • pauseForTestingAfterNthCheckpoint

      @VisibleForTesting public void pauseForTestingAfterNthCheckpoint(String zone, int count) throws IOException
      Throws:
      IOException
    • resetMetricsForTesting

      @VisibleForTesting public void resetMetricsForTesting()
    • getReencryptionStatus

      @VisibleForTesting public org.apache.hadoop.hdfs.protocol.ReencryptionStatus getReencryptionStatus()
    • getZoneStatus

      @VisibleForTesting public org.apache.hadoop.hdfs.protocol.ZoneReencryptionStatus getZoneStatus(String zone) throws IOException
      Throws:
      IOException
    • getNumEncryptionZones

      public int getNumEncryptionZones()
      Returns:
      number of encryption zones.
    • hasCreatedEncryptionZone

      public boolean hasCreatedEncryptionZone()
      Returns:
      Whether there has been any attempt to create an encryption zone in the cluster at all. If not, it is safe to quickly return null when checking the encryption information of any file or directory in the cluster.