Class Lspv


  • @ThreadSafe
    public final class Lspv
    extends java.lang.Object
    Utility to query lspv
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.String,​java.util.List<HWPartition>> PARTITION_CACHE
      The lspv command incurs a lot of disk reads.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Lspv()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<HWPartition> computeLogicalVolumes​(java.lang.String device, java.util.Map<java.lang.String,​Pair<java.lang.Integer,​java.lang.Integer>> majMinMap)  
      static java.util.List<HWPartition> queryLogicalVolumes​(java.lang.String device, java.util.Map<java.lang.String,​Pair<java.lang.Integer,​java.lang.Integer>> majMinMap)
      Query lspv to get partition info, or return a cached value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PARTITION_CACHE

        private static final java.util.Map<java.lang.String,​java.util.List<HWPartition>> PARTITION_CACHE
        The lspv command incurs a lot of disk reads. Since partitions shouldn't change during operation, cache the result here.
    • Constructor Detail

      • Lspv

        private Lspv()
    • Method Detail

      • queryLogicalVolumes

        public static java.util.List<HWPartition> queryLogicalVolumes​(java.lang.String device,
                                                                      java.util.Map<java.lang.String,​Pair<java.lang.Integer,​java.lang.Integer>> majMinMap)
        Query lspv to get partition info, or return a cached value.
        Parameters:
        device - The disk to get the volumes from.
        majMinMap - A map of device name to a pair with major and minor numbers.
        Returns:
        A list of logical volumes (partitions) on this device.
      • computeLogicalVolumes

        private static java.util.List<HWPartition> computeLogicalVolumes​(java.lang.String device,
                                                                         java.util.Map<java.lang.String,​Pair<java.lang.Integer,​java.lang.Integer>> majMinMap)