public class DataBlockEncodingTool extends Object
Constructor and Description |
---|
DataBlockEncodingTool(String compressionAlgorithmName) |
Modifier and Type | Method and Description |
---|---|
void |
benchmarkAlgorithm(Compression.Algorithm algorithm,
String name,
byte[] buffer,
int offset,
int length)
Check decompress performance of a given algorithm and print it.
|
void |
benchmarkCodecs()
Benchmark codec's speed.
|
void |
checkStatistics(KeyValueScanner scanner,
int kvLimit)
Check statistics for given HFile for different data block encoders.
|
void |
displayStatistics()
Display statistics of different compression algorithms.
|
static void |
main(String[] args)
A command line interface to benchmarks.
|
static void |
testCodecs(Configuration conf,
int kvLimit,
String hfilePath,
String compressionName,
boolean doBenchmark,
boolean doVerify)
Test a data block encoder on the given HFile.
|
boolean |
verifyCodecs(KeyValueScanner scanner,
int kvLimit)
Verify if all data block encoders are working properly.
|
public DataBlockEncodingTool(String compressionAlgorithmName)
compressionAlgorithmName
- What kind of algorithm should be used
as baseline for comparison (e.g. lzo, gz).public void checkStatistics(KeyValueScanner scanner, int kvLimit) throws IOException
scanner
- Of file which will be compressed.kvLimit
- Maximal count of KeyValue which will be processed.IOException
- thrown if scanner is invalidpublic boolean verifyCodecs(KeyValueScanner scanner, int kvLimit) throws IOException
scanner
- Of file which was compressed.kvLimit
- Maximal count of KeyValue which will be processed.IOException
- thrown if scanner is invalidpublic void benchmarkCodecs() throws IOException
IOException
public void benchmarkAlgorithm(Compression.Algorithm algorithm, String name, byte[] buffer, int offset, int length) throws IOException
algorithm
- Compression algorithm.name
- Name of algorithm.buffer
- Buffer to be compressed.offset
- Position of the beginning of the data.length
- Length of data in buffer.IOException
public void displayStatistics() throws IOException
IOException
public static void testCodecs(Configuration conf, int kvLimit, String hfilePath, String compressionName, boolean doBenchmark, boolean doVerify) throws IOException
kvLimit
- The limit of KeyValue which will be analyzed.hfilePath
- an HFile path on the file system.compressionName
- Compression algorithm used for comparison.doBenchmark
- Run performance benchmarks.doVerify
- Verify correctness.IOException
- When pathName is incorrect.public static void main(String[] args) throws IOException
args
- Should have length at least 1 and holds the file path to HFile.IOException
- If you specified the wrong file.