Class DiskUsageMonitor

java.lang.Object
org.apache.cassandra.service.disk.usage.DiskUsageMonitor

public class DiskUsageMonitor extends Object
Schedule periodic task to monitor local disk usage and notify DiskUsageBroadcaster if local state changed.
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public void start(Consumer<DiskUsageState> notifier)
      Start monitoring local disk usage and call notifier when local disk usage state changed.
    • updateLocalState

      public void updateLocalState(double usageRatio, Consumer<DiskUsageState> notifier)
    • state

      public DiskUsageState 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

      public DiskUsageState getState(long usagePercentage)
    • totalDiskSpace

      public static long totalDiskSpace()
    • totalSpace

      public static long totalSpace(FileStore store)
    • usableSpace

      public static long usableSpace(FileStore store)