Class LinuxHWDiskStore

java.lang.Object
oshi.hardware.common.AbstractHWDiskStore
oshi.hardware.platform.linux.LinuxHWDiskStore
All Implemented Interfaces:
HWDiskStore
Direct Known Subclasses:
LinuxHWDiskStoreJNA

@ThreadSafe public abstract class LinuxHWDiskStore extends AbstractHWDiskStore
Linux hard disk implementation.
  • Field Details

  • Constructor Details

    • LinuxHWDiskStore

      protected LinuxHWDiskStore(String name, String model, String serial, long size)
  • Method Details

    • getReads

      public long getReads()
      Description copied from interface: HWDiskStore
      The number of reads from the disk
      Returns:
      the reads
    • getReadBytes

      public long getReadBytes()
      Description copied from interface: HWDiskStore
      The number of bytes read from the disk
      Returns:
      the bytes read
    • getWrites

      public long getWrites()
      Description copied from interface: HWDiskStore
      The number of writes to the disk
      Returns:
      the writes
    • getWriteBytes

      public long getWriteBytes()
      Description copied from interface: HWDiskStore
      The number of bytes written to the disk
      Returns:
      the bytes written
    • getCurrentQueueLength

      public long getCurrentQueueLength()
      Description copied from interface: HWDiskStore
      The length of the disk queue (#I/O's in progress). Includes I/O requests that have been issued to the device driver but have not yet completed. Not supported on macOS.
      Returns:
      the current disk queue length
    • getTransferTime

      public long getTransferTime()
      Description copied from interface: HWDiskStore
      The time spent reading or writing, in milliseconds.
      Returns:
      the transfer time
    • getTimeStamp

      public long getTimeStamp()
      Description copied from interface: HWDiskStore
      The time this disk's statistics were updated.
      Returns:
      the timeStamp, in milliseconds since the epoch.
    • getPartitions

      public List<HWPartition> getPartitions()
      Description copied from interface: HWDiskStore
      The partitions on this disk.
      Returns:
      an UnmodifiableList of the partitions on this drive.
    • setDiskStats

      protected void setDiskStats(long reads, long readBytes, long writes, long writeBytes, long currentQueueLength, long transferTime, long timeStamp)
    • setPartitionList

      protected void setPartitionList(List<HWPartition> partitionList)
    • getMutablePartitionList

      protected List<HWPartition> getMutablePartitionList()
    • computeDiskStats

      protected static void computeDiskStats(LinuxHWDiskStore store, String devstat)
    • readMountsMap

      protected static Map<String,String> readMountsMap()
    • getPartitionNameForDmDevice

      protected static String getPartitionNameForDmDevice(String vgName, String lvName)
    • getMountPointOfDmDevice

      protected static String getMountPointOfDmDevice(String vgName, String lvName)
    • getDependentNamesFromHoldersDirectory

      protected static String getDependentNamesFromHoldersDirectory(String sysPath)
    • finalizePartitions

      protected static void finalizePartitions(List<HWDiskStore> result)