Class PhysicalVolumeConfiguration

java.lang.Object
com.aoindustries.aoserv.cluster.PhysicalVolumeConfiguration
All Implemented Interfaces:
Serializable, Comparable<PhysicalVolumeConfiguration>
Direct Known Subclasses:
PhysicalVolumeConfigurationInt, PhysicalVolumeConfigurationLong, PhysicalVolumeConfigurationShort

public abstract class PhysicalVolumeConfiguration extends Object implements Comparable<PhysicalVolumeConfiguration>, Serializable
One Xen domU disk to physical volume configuration. This equates to a LVM logical volume to physical volume mapping segment. See lvdisplay -m for segments.
Author:
AO Industries, Inc.
See Also:
  • Method Details

    • newInstance

      public static PhysicalVolumeConfiguration newInstance(PhysicalVolume physicalVolume, long firstLogicalExtent, long firstPhysicalExtent, long extents)
      Creates a new PhysicalVolume of the appropriate type for the provided extents. Will use 16-bit and 32-bit representation when possible to save heap.

      If heap space is every an issue, can use even more specialized versions like: PhysicalVolumeConfiguration896 for multiples of 896 that can store into byte PhysicalVolumeConfiguration_0_0_896 for newInstance(0,0,896) - would need to measure to know which would save heap

    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getPhysicalVolume

      public final PhysicalVolume getPhysicalVolume()
    • equals

      public final boolean equals(Object obj)
      Performs a deep field-by-field comparison to see if two configurations are identical in every way.
      Overrides:
      equals in class Object
      See Also:
    • equals

      public final boolean equals(PhysicalVolumeConfiguration other)
      Performs a deep field-by-field comparison to see if two configurations are identical in every way.
      See Also:
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • getFirstLogicalExtent

      public abstract long getFirstLogicalExtent()
    • getFirstPhysicalExtent

      public abstract long getFirstPhysicalExtent()
    • getExtents

      public abstract long getExtents()
    • compareTo

      public final int compareTo(PhysicalVolumeConfiguration other)
      Sorted ascending. By:
      1. physicalVolume
      2. firstLogicalExtent
      3. firstPhysicalExtent
      4. extents
      Specified by:
      compareTo in interface Comparable<PhysicalVolumeConfiguration>
    • overlaps

      public final boolean overlaps(PhysicalVolumeConfiguration other)
      Returns true if either the logical or the physical extents overlap.