Class DiskUsageMonitor
java.lang.Object
org.apache.cassandra.service.disk.usage.DiskUsageMonitor
Schedule periodic task to monitor local disk usage and notify
DiskUsageBroadcaster if local state changed.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDiskUsageMonitor(Supplier<com.google.common.collect.Multimap<FileStore, Directories.DataDirectory>> dataDirectoriesSupplier) -
Method Summary
Modifier and TypeMethodDescriptionlongdoublegetState(long usagePercentage) voidstart(Consumer<DiskUsageState> notifier) Start monitoring local disk usage and call notifier when local disk usage state changed.state()static longstatic longtotalSpace(FileStore store) voidupdateLocalState(double usageRatio, Consumer<DiskUsageState> notifier) static longusableSpace(FileStore store)
-
Field Details
-
instance
-
-
Constructor Details
-
DiskUsageMonitor
public DiskUsageMonitor() -
DiskUsageMonitor
public DiskUsageMonitor(Supplier<com.google.common.collect.Multimap<FileStore, Directories.DataDirectory>> dataDirectoriesSupplier)
-
-
Method Details
-
start
Start monitoring local disk usage and call notifier when local disk usage state changed. -
updateLocalState
-
state
- Returns:
- local node disk usage state
-
getDiskUsage
public double getDiskUsage()- Returns:
- The current disk usage (including all memtable sizes) ratio. This is the ratio between the space taken by all the data directories and the addition of that same space and the free available space on disk. The space taken by the data directories is the addition of the actual space on disk plus the size of the memtables. Memtables are included in that calculation because they are expected to be eventually flushed to disk.
-
getAllMemtableSize
public long getAllMemtableSize() -
getState
-
totalDiskSpace
public static long totalDiskSpace() -
totalSpace
-
usableSpace
-