org.apache.hadoop.hbase.codec
Class KeyValueCodecWithTags

java.lang.Object
  extended by org.apache.hadoop.hbase.codec.KeyValueCodecWithTags
All Implemented Interfaces:
Codec

@InterfaceAudience.LimitedPrivate(value="Configuration")
@InterfaceStability.Unstable
public class KeyValueCodecWithTags
extends Object
implements Codec

Codec that does KeyValue version 1 serialization with serializing tags also.

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
 
Note: The only difference of this with KeyValueCodec is the latter ignores tags in KeyValues. Use this Codec only at server side.


Nested Class Summary
static class KeyValueCodecWithTags.KeyValueDecoder
           
static class KeyValueCodecWithTags.KeyValueEncoder
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.codec.Codec
Codec.Decoder, Codec.Encoder
 
Constructor Summary
KeyValueCodecWithTags()
           
 
Method Summary
 Codec.Decoder getDecoder(InputStream is)
          Implementation depends on InputStream.available()
 Codec.Encoder getEncoder(OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyValueCodecWithTags

public KeyValueCodecWithTags()
Method Detail

getDecoder

public Codec.Decoder getDecoder(InputStream is)
Implementation depends on InputStream.available()

Specified by:
getDecoder in interface Codec

getEncoder

public Codec.Encoder getEncoder(OutputStream os)
Specified by:
getEncoder in interface Codec


Copyright © 2015 The Apache Software Foundation. All rights reserved.