@InterfaceAudience.LimitedPrivate(value="Configuration") public class KeyValueCodec extends Object implements Codec
Encodes Cell as serialized in KeyValue with total 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
Modifier and Type | Class and Description |
---|---|
static class |
KeyValueCodec.ByteBuffKeyValueDecoder |
static class |
KeyValueCodec.KeyValueDecoder |
static class |
KeyValueCodec.KeyValueEncoder |
Codec.Decoder, Codec.Encoder
Constructor and Description |
---|
KeyValueCodec() |
Modifier and Type | Method and Description |
---|---|
Codec.Decoder |
getDecoder(ByteBuff buf) |
Codec.Decoder |
getDecoder(InputStream is)
Implementation depends on
InputStream.available() |
Codec.Encoder |
getEncoder(OutputStream os) |
public KeyValueCodec()
public Codec.Decoder getDecoder(InputStream is)
InputStream.available()
getDecoder
in interface Codec
public Codec.Decoder getDecoder(ByteBuff buf)
getDecoder
in interface Codec
public Codec.Encoder getEncoder(OutputStream os)
getEncoder
in interface Codec
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.