Class HWDiskStore
- All Implemented Interfaces:
java.lang.Comparable<HWDiskStore>
@NotThreadSafe public class HWDiskStore extends java.lang.Object implements java.lang.Comparable<HWDiskStore>
Thread safe if both threads only use getters on both this object and the
partitions returned by getPartitions()
, or if setter usage
(including on the partitions) is externally synchronized.
-
Constructor Summary
Constructors Constructor Description HWDiskStore()
Create an object with empty/default valuesHWDiskStore(HWDiskStore diskStore)
Copy constructor -
Method Summary
Modifier and Type Method Description int
compareTo(HWDiskStore store)
boolean
equals(java.lang.Object obj)
long
getCurrentQueueLength()
Getter for the fieldcurrentQueueLength
.java.lang.String
getModel()
Getter for the fieldmodel
.java.lang.String
getName()
Getter for the fieldname
.HWPartition[]
getPartitions()
Getter for the fieldpartitions
.long
getReadBytes()
Getter for the fieldreadBytes
.long
getReads()
Getter for the fieldreads
.java.lang.String
getSerial()
Getter for the fieldserial
.long
getSize()
Getter for the fieldsize
.long
getTimeStamp()
Getter for the fieldtimeStamp
.long
getTransferTime()
Getter for the fieldtransferTime
.long
getWriteBytes()
Getter for the fieldwriteBytes
.long
getWrites()
Getter for the fieldwrites
.int
hashCode()
void
setCurrentQueueLength(long currentQueueLength)
Setter for the fieldcurrentQueueLength
.void
setModel(java.lang.String model)
Setter for the fieldmodel
.void
setName(java.lang.String name)
Setter for the fieldname
.void
setPartitions(HWPartition[] partitions)
Setter for the fieldpartitions
.void
setReadBytes(long readBytes)
Setter for the fieldreadBytes
.void
setReads(long reads)
Setter for the fieldreads
.void
setSerial(java.lang.String serial)
Setter for the fieldserial
.void
setSize(long size)
Setter for the fieldsize
.void
setTimeStamp(long timeStamp)
Setter for the fieldtimeStamp
.void
setTransferTime(long transferTime)
Setter for the fieldtransferTime
.void
setWriteBytes(long writeBytes)
Setter for the fieldwriteBytes
.void
setWrites(long writes)
Setter for the fieldwrites
.java.lang.String
toString()
boolean
updateAtrributes()
Make a best effort to update all the statistics about the drive without needing to recreate the drive list.
-
Constructor Details
-
HWDiskStore
public HWDiskStore()Create an object with empty/default values -
HWDiskStore
Copy constructor- Parameters:
diskStore
- The object to copy
-
-
Method Details
-
updateAtrributes
public boolean updateAtrributes()Make a best effort to update all the statistics about the drive without needing to recreate the drive list. This method provides for more frequent periodic updates of drive statistics. It will not detect if a removable drive has been removed and replaced by a different drive in between method calls.- Returns:
- True if the update was (probably) successful, false if the disk was not found
-
getName
public java.lang.String getName()Getter for the field
name
.- Returns:
- the name
-
getModel
public java.lang.String getModel()Getter for the field
model
.- Returns:
- the model
-
getSerial
public java.lang.String getSerial()Getter for the field
serial
.- Returns:
- the serial
-
getSize
public long getSize()Getter for the field
size
.- Returns:
- Get size of disk (in bytes)
-
getReads
public long getReads()Getter for the field
reads
.- Returns:
- the reads
-
getReadBytes
public long getReadBytes()Getter for the field
readBytes
.- Returns:
- the bytes read
-
getWrites
public long getWrites()Getter for the field
writes
.- Returns:
- the writes
-
getWriteBytes
public long getWriteBytes()Getter for the field
writeBytes
.- Returns:
- the bytes written
-
getCurrentQueueLength
public long getCurrentQueueLength()Getter for the field
currentQueueLength
.- Returns:
- 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.
-
getTransferTime
public long getTransferTime()Getter for the field
transferTime
.- Returns:
- the milliseconds spent reading or writing
-
getPartitions
Getter for the field
partitions
.- Returns:
- Returns the partitions on this drive.
-
getTimeStamp
public long getTimeStamp()Getter for the field
timeStamp
.- Returns:
- Returns the timeStamp.
-
setName
public void setName(java.lang.String name)Setter for the field
name
.- Parameters:
name
- the name to set
-
setModel
public void setModel(java.lang.String model)Setter for the field
model
.- Parameters:
model
- the model to set
-
setSerial
public void setSerial(java.lang.String serial)Setter for the field
serial
.- Parameters:
serial
- the serial to set
-
setSize
public void setSize(long size)Setter for the field
size
.- Parameters:
size
- Set size of disk (in bytes)
-
setReads
public void setReads(long reads)Setter for the field
reads
.- Parameters:
reads
- the reads to set
-
setReadBytes
public void setReadBytes(long readBytes)Setter for the field
readBytes
.- Parameters:
readBytes
- the bytes read to set
-
setWrites
public void setWrites(long writes)Setter for the field
writes
.- Parameters:
writes
- the writes to set
-
setWriteBytes
public void setWriteBytes(long writeBytes)Setter for the field
writeBytes
.- Parameters:
writeBytes
- the bytes written to set
-
setCurrentQueueLength
public void setCurrentQueueLength(long currentQueueLength)Setter for the field
currentQueueLength
.- Parameters:
currentQueueLength
- the length of the disk queue (#I/O's in progress) to set
-
setTransferTime
public void setTransferTime(long transferTime)Setter for the field
transferTime
.- Parameters:
transferTime
- milliseconds spent reading or writing to set
-
setPartitions
Setter for the field
partitions
.- Parameters:
partitions
- The partitions to set.
-
setTimeStamp
public void setTimeStamp(long timeStamp)Setter for the field
timeStamp
.- Parameters:
timeStamp
- The timeStamp to set.
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<HWDiskStore>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-