public class CompressionRatio extends Object
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.| 限定符和类型 | 方法和说明 |
|---|---|
double |
getCompressionRatioSum() |
static CompressionRatio |
getInstance() |
double |
getRatio()
Get the average compression ratio for all closed files
|
void |
updateRatio(double currentCompressionRatio)
Whenever the task of closing a file ends, the compression ratio of the file is calculated and
call this method.
|
public void updateRatio(double currentCompressionRatio)
throws IOException
currentCompressionRatio - the compression ratio of the closing file.IOExceptionpublic double getRatio()
public double getCompressionRatioSum()
public static CompressionRatio getInstance()
Copyright © 2022 The Apache Software Foundation. All rights reserved.