private boolean isRunningOutOfDiskSpace ( ) { // If there's not enough space left to allocate two log segments return raft . getStorage ( ) . statistics ( ) . getUsableSpace ( ) < raft . getStorage ( ) . maxLogSegmentSize ( ) * SEGMENT_BUFFER_FACTOR // Or the used disk percentage has surpassed the free disk buffer percentage || raft . getStorage ( ) . statistics ( ) . getUsableSpace ( ) / ( double ) raft . getStorage ( ) . statistics ( ) . getTotalSpace ( ) < raft . getStorage ( ) . freeDiskBuffer ( ) ; }
Returns a boolean indicating whether the node is running out of disk space .