|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.codec.KeyValueCodec
public class KeyValueCodec
Codec that does KeyValue version 1 serialization.
Encodes by casting Cell to KeyValue and writing out the backing array with a length prefix. This is how KVs were serialized in Puts, Deletes and Results pre-0.96. Its what would happen if you called the Writable#write KeyValue implementation. This encoder will fail if the passed Cell is not an old-school pre-0.96 KeyValue. Does not copy bytes writing. It just writes them direct to the passed stream.
If you wrote two KeyValues to this encoder, it would look like this in the stream:
length-of-KeyValue1 // A java int with the length of KeyValue1 backing array KeyValue1 backing array filled with a KeyValue serialized in its particular format length-of-KeyValue2 KeyValue2 backing array
Nested Class Summary | |
---|---|
static class |
KeyValueCodec.KeyValueDecoder
|
static class |
KeyValueCodec.KeyValueEncoder
|
Constructor Summary | |
---|---|
KeyValueCodec()
|
Method Summary | |
---|---|
Decoder |
getDecoder(InputStream is)
Implementation depends on InputStream.available() |
Encoder |
getEncoder(OutputStream os)
Must be passed a DataOutputStream so KeyValues can be serialized using the usual
Writable mechanisms |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyValueCodec()
Method Detail |
---|
public Decoder getDecoder(InputStream is)
InputStream.available()
Must be passed a DataInputStream
so KeyValues can be derserialized with the usual
Writable mechanisms
getDecoder
in interface Codec
public Encoder getEncoder(OutputStream os)
DataOutputStream
so KeyValues can be serialized using the usual
Writable mechanisms
getEncoder
in interface Codec
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |