Class CompressionRatio


  • public class CompressionRatio
    extends java.lang.Object
    This class is used to count, compute and persist the compression ratio of tsfiles. Whenever the task of closing a file ends, the compression ratio of the file is calculated based on the total MemTable size and the total size of the tsfile on disk. compressionRatioSum records the sum of these compression ratios, and records the number of closed file tasks. When the compression rate of the current system is obtained, the average compression ratio is returned as the result, that is compressionRatioSum/. At the same time, each time the compression ratio statistics are updated, these two parameters are persisted on disk for system recovery.
    • Method Detail

      • updateRatio

        public void updateRatio​(double currentCompressionRatio)
                         throws java.io.IOException
        Whenever the task of closing a file ends, the compression ratio of the file is calculated and call this method.
        Parameters:
        currentCompressionRatio - the compression ratio of the closing file.
        Throws:
        java.io.IOException
      • getRatio

        public double getRatio()
        Get the average compression ratio for all closed files
      • getCompressionRatioSum

        public double getCompressionRatioSum()