Class StorageVolumeUtil

java.lang.Object
org.apache.hadoop.ozone.container.common.utils.StorageVolumeUtil

public final class StorageVolumeUtil extends Object
A util class for StorageVolume.
  • Method Details

    • onFailure

      public static void onFailure(StorageVolume volume)
    • getHddsVolumesList

      public static List<HddsVolume> getHddsVolumesList(List<StorageVolume> volumes)
    • getDbVolumesList

      public static List<DbVolume> getDbVolumesList(List<StorageVolume> volumes)
    • getVersionFile

      public static File getVersionFile(File rootDir)
    • generateUuid

      public static String generateUuid()
    • getStorageID

      public static String getStorageID(Properties props, File versionFile) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Returns storageID if it is valid. Throws an exception otherwise.
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • getClusterID

      public static String getClusterID(Properties props, File versionFile, String clusterID) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Returns clusterID if it is valid. It should match the clusterID from the Datanode. Throws an exception otherwise.
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • getDatanodeUUID

      public static String getDatanodeUUID(Properties props, File versionFile, String datanodeUuid) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Returns datanodeUuid if it is valid. It should match the UUID of the Datanode. Throws an exception otherwise.
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • getCreationTime

      public static long getCreationTime(Properties props, File versionFile) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Returns creationTime if it is valid. Throws an exception otherwise.
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • getLayOutVersion

      public static int getLayOutVersion(Properties props, File versionFile) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Returns layOutVersion if it is valid. Throws an exception otherwise.
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • getProperty

      public static String getProperty(Properties props, String propName, File versionFile) throws org.apache.hadoop.ozone.common.InconsistentStorageStateException
      Throws:
      org.apache.hadoop.ozone.common.InconsistentStorageStateException
    • checkVolume

      public static boolean checkVolume(StorageVolume volume, String scmId, String clusterId, org.apache.hadoop.hdds.conf.ConfigurationSource conf, org.slf4j.Logger logger, MutableVolumeSet dbVolumeSet)
      Check Volume is in consistent state or not. Prior to SCM HA, volumes used the format <volume>/hdds/<scm-id>. Post SCM HA, new volumes will use the format <volume>/hdds/<cluster -id>. Existing volumes using SCM ID will be reformatted to have <volume>/hdds/<cluster-id> as a symlink pointing to <volume >/hdds/<scm-id> when SCM HA is finalized.
      Parameters:
      volume -
      scmId -
      clusterId -
      conf -
      logger -
      dbVolumeSet -
      Returns:
      true - if volume is in consistent state, otherwise false.