hadoop SequenceFile介紹
阿新 • • 發佈:2019-02-20
1 2 3 4 5 6 7 8 |
public static enum CompressionType {
/** 不壓縮 */
NONE,
/** 只壓縮value */
RECORD,
/** 壓縮很多記錄的key/value成一塊 */
BLOCK
}
|
SequenceFile
Writer
s
based on the CompressType used
to compress key/value pairs:1 |
public static class Writer implements java.io.Closeable, Syncable
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
/** Write and flush the file header. */
private void writeFileHeader()
throws IOException {
out.write(VERSION);
Text.writeString(out, keyClass.getName());
Text.writeString(out, valClass.getName());
out.writeBoolean( this .isCompressed());
out.writeBoolean( this .isBlockCompressed()); if ( this .isCompressed()) {
|