Package org.apache.iotdb.db.conf.adapter
Class CompressionRatio
- java.lang.Object
-
- org.apache.iotdb.db.conf.adapter.CompressionRatio
-
public class CompressionRatio extends java.lang.ObjectThis 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.compressionRatioSumrecords 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 iscompressionRatioSum/. At the same time, each time the compression ratio statistics are updated, these two parameters are persisted on disk for system recovery.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCompressionRatioSum()static CompressionRatiogetInstance()doublegetRatio()Get the average compression ratio for all closed filesvoidupdateRatio(double currentCompressionRatio)Whenever the task of closing a file ends, the compression ratio of the file is calculated and call this method.
-
-
-
Method Detail
-
updateRatio
public void updateRatio(double currentCompressionRatio) throws java.io.IOExceptionWhenever 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()
-
getInstance
public static CompressionRatio getInstance()
-
-