hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [31/51] [partial] hbase-site git commit: Published site at eea8b38dfa0180d3e6f93d3e8055d5d4fbf673c3.
Date Fri, 11 Mar 2016 17:00:05 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.CellEncoder.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.CellEncoder.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.CellEncoder.html
index 742b06b..b129aea 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.CellEncoder.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.CellEncoder.html
@@ -28,107 +28,114 @@
 <span class="sourceLineNo">020</span>import java.io.IOException;<a name="line.20"></a>
 <span class="sourceLineNo">021</span>import java.io.InputStream;<a name="line.21"></a>
 <span class="sourceLineNo">022</span>import java.io.OutputStream;<a name="line.22"></a>
-<span class="sourceLineNo">023</span><a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.commons.io.IOUtils;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.Cell;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>/**<a name="line.31"></a>
-<span class="sourceLineNo">032</span> * Basic Cell codec that just writes out all the individual elements of a Cell including the tags.<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * Uses ints delimiting all lengths. Profligate. Needs tune up.<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * &lt;b&gt;Use this Codec only at server side.&lt;/b&gt;<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public class CellCodecWithTags implements Codec {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  static class CellEncoder extends BaseEncoder {<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    CellEncoder(final OutputStream out) {<a name="line.39"></a>
-<span class="sourceLineNo">040</span>      super(out);<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    }<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>    @Override<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    public void write(Cell cell) throws IOException {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>      checkFlushed();<a name="line.45"></a>
-<span class="sourceLineNo">046</span>      // Row<a name="line.46"></a>
-<span class="sourceLineNo">047</span>      write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());<a name="line.47"></a>
-<span class="sourceLineNo">048</span>      // Column family<a name="line.48"></a>
-<span class="sourceLineNo">049</span>      write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());<a name="line.49"></a>
-<span class="sourceLineNo">050</span>      // Qualifier<a name="line.50"></a>
-<span class="sourceLineNo">051</span>      write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());<a name="line.51"></a>
-<span class="sourceLineNo">052</span>      // Version<a name="line.52"></a>
-<span class="sourceLineNo">053</span>      this.out.write(Bytes.toBytes(cell.getTimestamp()));<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      // Type<a name="line.54"></a>
-<span class="sourceLineNo">055</span>      this.out.write(cell.getTypeByte());<a name="line.55"></a>
-<span class="sourceLineNo">056</span>      // Value<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());<a name="line.57"></a>
-<span class="sourceLineNo">058</span>      // Tags<a name="line.58"></a>
-<span class="sourceLineNo">059</span>      write(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength());<a name="line.59"></a>
-<span class="sourceLineNo">060</span>      // MvccVersion<a name="line.60"></a>
-<span class="sourceLineNo">061</span>      this.out.write(Bytes.toBytes(cell.getSequenceId()));<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * Write int length followed by array bytes.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     *<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * @param bytes<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * @param offset<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * @param length<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     * @throws IOException<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    private void write(final byte[] bytes, final int offset, final int length) throws IOException {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>      this.out.write(Bytes.toBytes(length));<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      this.out.write(bytes, offset, length);<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  static class CellDecoder extends BaseDecoder {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    public CellDecoder(final InputStream in) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      super(in);<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span><a name="line.82"></a>
-<span class="sourceLineNo">083</span>    protected Cell parseCell() throws IOException {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      byte[] row = readByteArray(this.in);<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      byte[] family = readByteArray(in);<a name="line.85"></a>
-<span class="sourceLineNo">086</span>      byte[] qualifier = readByteArray(in);<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      byte[] longArray = new byte[Bytes.SIZEOF_LONG];<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      IOUtils.readFully(this.in, longArray);<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      long timestamp = Bytes.toLong(longArray);<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      byte type = (byte) this.in.read();<a name="line.90"></a>
-<span class="sourceLineNo">091</span>      byte[] value = readByteArray(in);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      byte[] tags = readByteArray(in);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      // Read memstore version<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      IOUtils.readFully(this.in, memstoreTSArray);<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      long memstoreTS = Bytes.toLong(memstoreTSArray);<a name="line.96"></a>
-<span class="sourceLineNo">097</span>      return CellUtil.createCell(row, family, qualifier, timestamp, type, value, tags, memstoreTS);<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    }<a name="line.98"></a>
-<span class="sourceLineNo">099</span><a name="line.99"></a>
-<span class="sourceLineNo">100</span>    /**<a name="line.100"></a>
-<span class="sourceLineNo">101</span>     * @return Byte array read from the stream.<a name="line.101"></a>
-<span class="sourceLineNo">102</span>     * @throws IOException<a name="line.102"></a>
-<span class="sourceLineNo">103</span>     */<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    private byte[] readByteArray(final InputStream in) throws IOException {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      byte[] intArray = new byte[Bytes.SIZEOF_INT];<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      IOUtils.readFully(in, intArray);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      int length = Bytes.toInt(intArray);<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      byte[] bytes = new byte[length];<a name="line.108"></a>
-<span class="sourceLineNo">109</span>      IOUtils.readFully(in, bytes);<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      return bytes;<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  @Override<a name="line.114"></a>
-<span class="sourceLineNo">115</span>  public Decoder getDecoder(InputStream is) {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    return new CellDecoder(is);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  @Override<a name="line.119"></a>
-<span class="sourceLineNo">120</span>  public Encoder getEncoder(OutputStream os) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    return new CellEncoder(os);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  }<a name="line.122"></a>
-<span class="sourceLineNo">123</span>}<a name="line.123"></a>
+<span class="sourceLineNo">023</span>import java.nio.ByteBuffer;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.io.IOUtils;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.Cell;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.io.ByteBufferInputStream;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>/**<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * Basic Cell codec that just writes out all the individual elements of a Cell including the tags.<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * Uses ints delimiting all lengths. Profligate. Needs tune up.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;b&gt;Use this Codec only at server side.&lt;/b&gt;<a name="line.36"></a>
+<span class="sourceLineNo">037</span> */<a name="line.37"></a>
+<span class="sourceLineNo">038</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.38"></a>
+<span class="sourceLineNo">039</span>public class CellCodecWithTags implements Codec {<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  static class CellEncoder extends BaseEncoder {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    CellEncoder(final OutputStream out) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>      super(out);<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    @Override<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    public void write(Cell cell) throws IOException {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>      checkFlushed();<a name="line.47"></a>
+<span class="sourceLineNo">048</span>      // Row<a name="line.48"></a>
+<span class="sourceLineNo">049</span>      write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());<a name="line.49"></a>
+<span class="sourceLineNo">050</span>      // Column family<a name="line.50"></a>
+<span class="sourceLineNo">051</span>      write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());<a name="line.51"></a>
+<span class="sourceLineNo">052</span>      // Qualifier<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());<a name="line.53"></a>
+<span class="sourceLineNo">054</span>      // Version<a name="line.54"></a>
+<span class="sourceLineNo">055</span>      this.out.write(Bytes.toBytes(cell.getTimestamp()));<a name="line.55"></a>
+<span class="sourceLineNo">056</span>      // Type<a name="line.56"></a>
+<span class="sourceLineNo">057</span>      this.out.write(cell.getTypeByte());<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      // Value<a name="line.58"></a>
+<span class="sourceLineNo">059</span>      write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());<a name="line.59"></a>
+<span class="sourceLineNo">060</span>      // Tags<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      write(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength());<a name="line.61"></a>
+<span class="sourceLineNo">062</span>      // MvccVersion<a name="line.62"></a>
+<span class="sourceLineNo">063</span>      this.out.write(Bytes.toBytes(cell.getSequenceId()));<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    }<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>    /**<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * Write int length followed by array bytes.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     *<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * @param bytes<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @param offset<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * @param length<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     * @throws IOException<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     */<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    private void write(final byte[] bytes, final int offset, final int length) throws IOException {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      this.out.write(Bytes.toBytes(length));<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      this.out.write(bytes, offset, length);<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    }<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>  static class CellDecoder extends BaseDecoder {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    public CellDecoder(final InputStream in) {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>      super(in);<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    }<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>    protected Cell parseCell() throws IOException {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>      byte[] row = readByteArray(this.in);<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      byte[] family = readByteArray(in);<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      byte[] qualifier = readByteArray(in);<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      byte[] longArray = new byte[Bytes.SIZEOF_LONG];<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      IOUtils.readFully(this.in, longArray);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      long timestamp = Bytes.toLong(longArray);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      byte type = (byte) this.in.read();<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      byte[] value = readByteArray(in);<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      byte[] tags = readByteArray(in);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      // Read memstore version<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      IOUtils.readFully(this.in, memstoreTSArray);<a name="line.97"></a>
+<span class="sourceLineNo">098</span>      long memstoreTS = Bytes.toLong(memstoreTSArray);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      return CellUtil.createCell(row, family, qualifier, timestamp, type, value, tags, memstoreTS);<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * @return Byte array read from the stream.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     * @throws IOException<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    private byte[] readByteArray(final InputStream in) throws IOException {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>      byte[] intArray = new byte[Bytes.SIZEOF_INT];<a name="line.107"></a>
+<span class="sourceLineNo">108</span>      IOUtils.readFully(in, intArray);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      int length = Bytes.toInt(intArray);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>      byte[] bytes = new byte[length];<a name="line.110"></a>
+<span class="sourceLineNo">111</span>      IOUtils.readFully(in, bytes);<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      return bytes;<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    }<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>  @Override<a name="line.116"></a>
+<span class="sourceLineNo">117</span>  public Decoder getDecoder(InputStream is) {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    return new CellDecoder(is);<a name="line.118"></a>
+<span class="sourceLineNo">119</span>  }<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>  @Override<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  public Decoder getDecoder(ByteBuffer buf) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    return getDecoder(new ByteBufferInputStream(buf));<a name="line.123"></a>
+<span class="sourceLineNo">124</span>  }<a name="line.124"></a>
+<span class="sourceLineNo">125</span><a name="line.125"></a>
+<span class="sourceLineNo">126</span>  @Override<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  public Encoder getEncoder(OutputStream os) {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    return new CellEncoder(os);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  }<a name="line.129"></a>
+<span class="sourceLineNo">130</span>}<a name="line.130"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.html
index 742b06b..b129aea 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/CellCodecWithTags.html
@@ -28,107 +28,114 @@
 <span class="sourceLineNo">020</span>import java.io.IOException;<a name="line.20"></a>
 <span class="sourceLineNo">021</span>import java.io.InputStream;<a name="line.21"></a>
 <span class="sourceLineNo">022</span>import java.io.OutputStream;<a name="line.22"></a>
-<span class="sourceLineNo">023</span><a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.commons.io.IOUtils;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.Cell;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.29"></a>
-<span class="sourceLineNo">030</span><a name="line.30"></a>
-<span class="sourceLineNo">031</span>/**<a name="line.31"></a>
-<span class="sourceLineNo">032</span> * Basic Cell codec that just writes out all the individual elements of a Cell including the tags.<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * Uses ints delimiting all lengths. Profligate. Needs tune up.<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * &lt;b&gt;Use this Codec only at server side.&lt;/b&gt;<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public class CellCodecWithTags implements Codec {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  static class CellEncoder extends BaseEncoder {<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    CellEncoder(final OutputStream out) {<a name="line.39"></a>
-<span class="sourceLineNo">040</span>      super(out);<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    }<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>    @Override<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    public void write(Cell cell) throws IOException {<a name="line.44"></a>
-<span class="sourceLineNo">045</span>      checkFlushed();<a name="line.45"></a>
-<span class="sourceLineNo">046</span>      // Row<a name="line.46"></a>
-<span class="sourceLineNo">047</span>      write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());<a name="line.47"></a>
-<span class="sourceLineNo">048</span>      // Column family<a name="line.48"></a>
-<span class="sourceLineNo">049</span>      write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());<a name="line.49"></a>
-<span class="sourceLineNo">050</span>      // Qualifier<a name="line.50"></a>
-<span class="sourceLineNo">051</span>      write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());<a name="line.51"></a>
-<span class="sourceLineNo">052</span>      // Version<a name="line.52"></a>
-<span class="sourceLineNo">053</span>      this.out.write(Bytes.toBytes(cell.getTimestamp()));<a name="line.53"></a>
-<span class="sourceLineNo">054</span>      // Type<a name="line.54"></a>
-<span class="sourceLineNo">055</span>      this.out.write(cell.getTypeByte());<a name="line.55"></a>
-<span class="sourceLineNo">056</span>      // Value<a name="line.56"></a>
-<span class="sourceLineNo">057</span>      write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());<a name="line.57"></a>
-<span class="sourceLineNo">058</span>      // Tags<a name="line.58"></a>
-<span class="sourceLineNo">059</span>      write(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength());<a name="line.59"></a>
-<span class="sourceLineNo">060</span>      // MvccVersion<a name="line.60"></a>
-<span class="sourceLineNo">061</span>      this.out.write(Bytes.toBytes(cell.getSequenceId()));<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
-<span class="sourceLineNo">063</span><a name="line.63"></a>
-<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>     * Write int length followed by array bytes.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>     *<a name="line.66"></a>
-<span class="sourceLineNo">067</span>     * @param bytes<a name="line.67"></a>
-<span class="sourceLineNo">068</span>     * @param offset<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * @param length<a name="line.69"></a>
-<span class="sourceLineNo">070</span>     * @throws IOException<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     */<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    private void write(final byte[] bytes, final int offset, final int length) throws IOException {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>      this.out.write(Bytes.toBytes(length));<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      this.out.write(bytes, offset, length);<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    }<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  static class CellDecoder extends BaseDecoder {<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    public CellDecoder(final InputStream in) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      super(in);<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span><a name="line.82"></a>
-<span class="sourceLineNo">083</span>    protected Cell parseCell() throws IOException {<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      byte[] row = readByteArray(this.in);<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      byte[] family = readByteArray(in);<a name="line.85"></a>
-<span class="sourceLineNo">086</span>      byte[] qualifier = readByteArray(in);<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      byte[] longArray = new byte[Bytes.SIZEOF_LONG];<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      IOUtils.readFully(this.in, longArray);<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      long timestamp = Bytes.toLong(longArray);<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      byte type = (byte) this.in.read();<a name="line.90"></a>
-<span class="sourceLineNo">091</span>      byte[] value = readByteArray(in);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      byte[] tags = readByteArray(in);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      // Read memstore version<a name="line.93"></a>
-<span class="sourceLineNo">094</span>      byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      IOUtils.readFully(this.in, memstoreTSArray);<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      long memstoreTS = Bytes.toLong(memstoreTSArray);<a name="line.96"></a>
-<span class="sourceLineNo">097</span>      return CellUtil.createCell(row, family, qualifier, timestamp, type, value, tags, memstoreTS);<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    }<a name="line.98"></a>
-<span class="sourceLineNo">099</span><a name="line.99"></a>
-<span class="sourceLineNo">100</span>    /**<a name="line.100"></a>
-<span class="sourceLineNo">101</span>     * @return Byte array read from the stream.<a name="line.101"></a>
-<span class="sourceLineNo">102</span>     * @throws IOException<a name="line.102"></a>
-<span class="sourceLineNo">103</span>     */<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    private byte[] readByteArray(final InputStream in) throws IOException {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      byte[] intArray = new byte[Bytes.SIZEOF_INT];<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      IOUtils.readFully(in, intArray);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      int length = Bytes.toInt(intArray);<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      byte[] bytes = new byte[length];<a name="line.108"></a>
-<span class="sourceLineNo">109</span>      IOUtils.readFully(in, bytes);<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      return bytes;<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  @Override<a name="line.114"></a>
-<span class="sourceLineNo">115</span>  public Decoder getDecoder(InputStream is) {<a name="line.115"></a>
-<span class="sourceLineNo">116</span>    return new CellDecoder(is);<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  @Override<a name="line.119"></a>
-<span class="sourceLineNo">120</span>  public Encoder getEncoder(OutputStream os) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    return new CellEncoder(os);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  }<a name="line.122"></a>
-<span class="sourceLineNo">123</span>}<a name="line.123"></a>
+<span class="sourceLineNo">023</span>import java.nio.ByteBuffer;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.io.IOUtils;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.Cell;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.CellUtil;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.io.ByteBufferInputStream;<a name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.util.Bytes;<a name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>/**<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * Basic Cell codec that just writes out all the individual elements of a Cell including the tags.<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * Uses ints delimiting all lengths. Profligate. Needs tune up.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;b&gt;Use this Codec only at server side.&lt;/b&gt;<a name="line.36"></a>
+<span class="sourceLineNo">037</span> */<a name="line.37"></a>
+<span class="sourceLineNo">038</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.38"></a>
+<span class="sourceLineNo">039</span>public class CellCodecWithTags implements Codec {<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  static class CellEncoder extends BaseEncoder {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    CellEncoder(final OutputStream out) {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>      super(out);<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    @Override<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    public void write(Cell cell) throws IOException {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>      checkFlushed();<a name="line.47"></a>
+<span class="sourceLineNo">048</span>      // Row<a name="line.48"></a>
+<span class="sourceLineNo">049</span>      write(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());<a name="line.49"></a>
+<span class="sourceLineNo">050</span>      // Column family<a name="line.50"></a>
+<span class="sourceLineNo">051</span>      write(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());<a name="line.51"></a>
+<span class="sourceLineNo">052</span>      // Qualifier<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      write(cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength());<a name="line.53"></a>
+<span class="sourceLineNo">054</span>      // Version<a name="line.54"></a>
+<span class="sourceLineNo">055</span>      this.out.write(Bytes.toBytes(cell.getTimestamp()));<a name="line.55"></a>
+<span class="sourceLineNo">056</span>      // Type<a name="line.56"></a>
+<span class="sourceLineNo">057</span>      this.out.write(cell.getTypeByte());<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      // Value<a name="line.58"></a>
+<span class="sourceLineNo">059</span>      write(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());<a name="line.59"></a>
+<span class="sourceLineNo">060</span>      // Tags<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      write(cell.getTagsArray(), cell.getTagsOffset(), cell.getTagsLength());<a name="line.61"></a>
+<span class="sourceLineNo">062</span>      // MvccVersion<a name="line.62"></a>
+<span class="sourceLineNo">063</span>      this.out.write(Bytes.toBytes(cell.getSequenceId()));<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    }<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>    /**<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * Write int length followed by array bytes.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     *<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * @param bytes<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @param offset<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * @param length<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     * @throws IOException<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     */<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    private void write(final byte[] bytes, final int offset, final int length) throws IOException {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>      this.out.write(Bytes.toBytes(length));<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      this.out.write(bytes, offset, length);<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    }<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  }<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>  static class CellDecoder extends BaseDecoder {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    public CellDecoder(final InputStream in) {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>      super(in);<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    }<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>    protected Cell parseCell() throws IOException {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>      byte[] row = readByteArray(this.in);<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      byte[] family = readByteArray(in);<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      byte[] qualifier = readByteArray(in);<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      byte[] longArray = new byte[Bytes.SIZEOF_LONG];<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      IOUtils.readFully(this.in, longArray);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      long timestamp = Bytes.toLong(longArray);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      byte type = (byte) this.in.read();<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      byte[] value = readByteArray(in);<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      byte[] tags = readByteArray(in);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>      // Read memstore version<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      byte[] memstoreTSArray = new byte[Bytes.SIZEOF_LONG];<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      IOUtils.readFully(this.in, memstoreTSArray);<a name="line.97"></a>
+<span class="sourceLineNo">098</span>      long memstoreTS = Bytes.toLong(memstoreTSArray);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      return CellUtil.createCell(row, family, qualifier, timestamp, type, value, tags, memstoreTS);<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * @return Byte array read from the stream.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     * @throws IOException<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    private byte[] readByteArray(final InputStream in) throws IOException {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>      byte[] intArray = new byte[Bytes.SIZEOF_INT];<a name="line.107"></a>
+<span class="sourceLineNo">108</span>      IOUtils.readFully(in, intArray);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      int length = Bytes.toInt(intArray);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>      byte[] bytes = new byte[length];<a name="line.110"></a>
+<span class="sourceLineNo">111</span>      IOUtils.readFully(in, bytes);<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      return bytes;<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    }<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>  @Override<a name="line.116"></a>
+<span class="sourceLineNo">117</span>  public Decoder getDecoder(InputStream is) {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    return new CellDecoder(is);<a name="line.118"></a>
+<span class="sourceLineNo">119</span>  }<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>  @Override<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  public Decoder getDecoder(ByteBuffer buf) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    return getDecoder(new ByteBufferInputStream(buf));<a name="line.123"></a>
+<span class="sourceLineNo">124</span>  }<a name="line.124"></a>
+<span class="sourceLineNo">125</span><a name="line.125"></a>
+<span class="sourceLineNo">126</span>  @Override<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  public Encoder getEncoder(OutputStream os) {<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    return new CellEncoder(os);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>  }<a name="line.129"></a>
+<span class="sourceLineNo">130</span>}<a name="line.130"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Decoder.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Decoder.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Decoder.html
index 5de62d6..039d9c9 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Decoder.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Decoder.html
@@ -27,39 +27,41 @@
 <span class="sourceLineNo">019</span><a name="line.19"></a>
 <span class="sourceLineNo">020</span>import java.io.InputStream;<a name="line.20"></a>
 <span class="sourceLineNo">021</span>import java.io.OutputStream;<a name="line.21"></a>
-<span class="sourceLineNo">022</span><a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>/**<a name="line.28"></a>
-<span class="sourceLineNo">029</span> * Encoder/Decoder for Cell.<a name="line.29"></a>
-<span class="sourceLineNo">030</span> *<a name="line.30"></a>
-<span class="sourceLineNo">031</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.31"></a>
-<span class="sourceLineNo">032</span> * only Cell-based rather than KeyValue version 1 based<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * rpc.<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public interface Codec {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.38"></a>
-<span class="sourceLineNo">039</span>  /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>   * On flush, let go of any resources used by the encoder.<a name="line.41"></a>
-<span class="sourceLineNo">042</span>   */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>  interface Encoder extends CellOutputStream {}<a name="line.43"></a>
-<span class="sourceLineNo">044</span><a name="line.44"></a>
-<span class="sourceLineNo">045</span>  /**<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.46"></a>
-<span class="sourceLineNo">047</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.47"></a>
-<span class="sourceLineNo">048</span>   * call close explicitly.<a name="line.48"></a>
-<span class="sourceLineNo">049</span>   */<a name="line.49"></a>
-<span class="sourceLineNo">050</span>  interface Decoder extends CellScanner {};<a name="line.50"></a>
-<span class="sourceLineNo">051</span><a name="line.51"></a>
-<span class="sourceLineNo">052</span>  Decoder getDecoder(InputStream is);<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  Encoder getEncoder(OutputStream os);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>}<a name="line.54"></a>
+<span class="sourceLineNo">022</span>import java.nio.ByteBuffer;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>/**<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * Encoder/Decoder for Cell.<a name="line.30"></a>
+<span class="sourceLineNo">031</span> *<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.32"></a>
+<span class="sourceLineNo">033</span> * only Cell-based rather than KeyValue version 1 based<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * rpc.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.37"></a>
+<span class="sourceLineNo">038</span>public interface Codec {<a name="line.38"></a>
+<span class="sourceLineNo">039</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  /**<a name="line.40"></a>
+<span class="sourceLineNo">041</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.41"></a>
+<span class="sourceLineNo">042</span>   * On flush, let go of any resources used by the encoder.<a name="line.42"></a>
+<span class="sourceLineNo">043</span>   */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  interface Encoder extends CellOutputStream {}<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  /**<a name="line.46"></a>
+<span class="sourceLineNo">047</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.47"></a>
+<span class="sourceLineNo">048</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * call close explicitly.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  interface Decoder extends CellScanner {};<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>  Decoder getDecoder(InputStream is);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>  Decoder getDecoder(ByteBuffer buf);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>  Encoder getEncoder(OutputStream os);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>}<a name="line.56"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Encoder.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Encoder.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Encoder.html
index 5de62d6..039d9c9 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Encoder.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.Encoder.html
@@ -27,39 +27,41 @@
 <span class="sourceLineNo">019</span><a name="line.19"></a>
 <span class="sourceLineNo">020</span>import java.io.InputStream;<a name="line.20"></a>
 <span class="sourceLineNo">021</span>import java.io.OutputStream;<a name="line.21"></a>
-<span class="sourceLineNo">022</span><a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>/**<a name="line.28"></a>
-<span class="sourceLineNo">029</span> * Encoder/Decoder for Cell.<a name="line.29"></a>
-<span class="sourceLineNo">030</span> *<a name="line.30"></a>
-<span class="sourceLineNo">031</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.31"></a>
-<span class="sourceLineNo">032</span> * only Cell-based rather than KeyValue version 1 based<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * rpc.<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public interface Codec {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.38"></a>
-<span class="sourceLineNo">039</span>  /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>   * On flush, let go of any resources used by the encoder.<a name="line.41"></a>
-<span class="sourceLineNo">042</span>   */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>  interface Encoder extends CellOutputStream {}<a name="line.43"></a>
-<span class="sourceLineNo">044</span><a name="line.44"></a>
-<span class="sourceLineNo">045</span>  /**<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.46"></a>
-<span class="sourceLineNo">047</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.47"></a>
-<span class="sourceLineNo">048</span>   * call close explicitly.<a name="line.48"></a>
-<span class="sourceLineNo">049</span>   */<a name="line.49"></a>
-<span class="sourceLineNo">050</span>  interface Decoder extends CellScanner {};<a name="line.50"></a>
-<span class="sourceLineNo">051</span><a name="line.51"></a>
-<span class="sourceLineNo">052</span>  Decoder getDecoder(InputStream is);<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  Encoder getEncoder(OutputStream os);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>}<a name="line.54"></a>
+<span class="sourceLineNo">022</span>import java.nio.ByteBuffer;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>/**<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * Encoder/Decoder for Cell.<a name="line.30"></a>
+<span class="sourceLineNo">031</span> *<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.32"></a>
+<span class="sourceLineNo">033</span> * only Cell-based rather than KeyValue version 1 based<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * rpc.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.37"></a>
+<span class="sourceLineNo">038</span>public interface Codec {<a name="line.38"></a>
+<span class="sourceLineNo">039</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  /**<a name="line.40"></a>
+<span class="sourceLineNo">041</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.41"></a>
+<span class="sourceLineNo">042</span>   * On flush, let go of any resources used by the encoder.<a name="line.42"></a>
+<span class="sourceLineNo">043</span>   */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  interface Encoder extends CellOutputStream {}<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  /**<a name="line.46"></a>
+<span class="sourceLineNo">047</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.47"></a>
+<span class="sourceLineNo">048</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * call close explicitly.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  interface Decoder extends CellScanner {};<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>  Decoder getDecoder(InputStream is);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>  Decoder getDecoder(ByteBuffer buf);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>  Encoder getEncoder(OutputStream os);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>}<a name="line.56"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.html
index 5de62d6..039d9c9 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/Codec.html
@@ -27,39 +27,41 @@
 <span class="sourceLineNo">019</span><a name="line.19"></a>
 <span class="sourceLineNo">020</span>import java.io.InputStream;<a name="line.20"></a>
 <span class="sourceLineNo">021</span>import java.io.OutputStream;<a name="line.21"></a>
-<span class="sourceLineNo">022</span><a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>/**<a name="line.28"></a>
-<span class="sourceLineNo">029</span> * Encoder/Decoder for Cell.<a name="line.29"></a>
-<span class="sourceLineNo">030</span> *<a name="line.30"></a>
-<span class="sourceLineNo">031</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.31"></a>
-<span class="sourceLineNo">032</span> * only Cell-based rather than KeyValue version 1 based<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * rpc.<a name="line.34"></a>
-<span class="sourceLineNo">035</span> */<a name="line.35"></a>
-<span class="sourceLineNo">036</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public interface Codec {<a name="line.37"></a>
-<span class="sourceLineNo">038</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.38"></a>
-<span class="sourceLineNo">039</span>  /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>   * On flush, let go of any resources used by the encoder.<a name="line.41"></a>
-<span class="sourceLineNo">042</span>   */<a name="line.42"></a>
-<span class="sourceLineNo">043</span>  interface Encoder extends CellOutputStream {}<a name="line.43"></a>
-<span class="sourceLineNo">044</span><a name="line.44"></a>
-<span class="sourceLineNo">045</span>  /**<a name="line.45"></a>
-<span class="sourceLineNo">046</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.46"></a>
-<span class="sourceLineNo">047</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.47"></a>
-<span class="sourceLineNo">048</span>   * call close explicitly.<a name="line.48"></a>
-<span class="sourceLineNo">049</span>   */<a name="line.49"></a>
-<span class="sourceLineNo">050</span>  interface Decoder extends CellScanner {};<a name="line.50"></a>
-<span class="sourceLineNo">051</span><a name="line.51"></a>
-<span class="sourceLineNo">052</span>  Decoder getDecoder(InputStream is);<a name="line.52"></a>
-<span class="sourceLineNo">053</span>  Encoder getEncoder(OutputStream os);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>}<a name="line.54"></a>
+<span class="sourceLineNo">022</span>import java.nio.ByteBuffer;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.hadoop.hbase.CellScanner;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.io.CellOutputStream;<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>/**<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * Encoder/Decoder for Cell.<a name="line.30"></a>
+<span class="sourceLineNo">031</span> *<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * &lt;p&gt;Like {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder} <a name="line.32"></a>
+<span class="sourceLineNo">033</span> * only Cell-based rather than KeyValue version 1 based<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * and without presuming an hfile context.  Intent is an Interface that will work for hfile and<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * rpc.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>@InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})<a name="line.37"></a>
+<span class="sourceLineNo">038</span>public interface Codec {<a name="line.38"></a>
+<span class="sourceLineNo">039</span>  // TODO: interfacing with {@link org.apache.hadoop.hbase.io.encoding.DataBlockEncoder}<a name="line.39"></a>
+<span class="sourceLineNo">040</span>  /**<a name="line.40"></a>
+<span class="sourceLineNo">041</span>   * Call flush when done.  Some encoders may not put anything on the stream until flush is called.<a name="line.41"></a>
+<span class="sourceLineNo">042</span>   * On flush, let go of any resources used by the encoder.<a name="line.42"></a>
+<span class="sourceLineNo">043</span>   */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  interface Encoder extends CellOutputStream {}<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  /**<a name="line.46"></a>
+<span class="sourceLineNo">047</span>   * Implementations should implicitly clean up any resources allocated when the<a name="line.47"></a>
+<span class="sourceLineNo">048</span>   * Decoder/CellScanner runs off the end of the cell block. Do this rather than require the user<a name="line.48"></a>
+<span class="sourceLineNo">049</span>   * call close explicitly.<a name="line.49"></a>
+<span class="sourceLineNo">050</span>   */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  interface Decoder extends CellScanner {};<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>  Decoder getDecoder(InputStream is);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>  Decoder getDecoder(ByteBuffer buf);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>  Encoder getEncoder(OutputStream os);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>}<a name="line.56"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/0b785cb2/devapidocs/src-html/org/apache/hadoop/hbase/codec/KeyValueCodec.ByteBufferedKeyValueDecoder.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/codec/KeyValueCodec.ByteBufferedKeyValueDecoder.html b/devapidocs/src-html/org/apache/hadoop/hbase/codec/KeyValueCodec.ByteBufferedKeyValueDecoder.html
new file mode 100644
index 0000000..b9d5f36
--- /dev/null
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/codec/KeyValueCodec.ByteBufferedKeyValueDecoder.html
@@ -0,0 +1,195 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * or more contributor license agreements.  See the NOTICE file<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * distributed with this work for additional information<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * regarding copyright ownership.  The ASF licenses this file<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * to you under the Apache License, Version 2.0 (the<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * "License"); you may not use this file except in compliance<a name="line.7"></a>
+<span class="sourceLineNo">008</span> * with the License.  You may obtain a copy of the License at<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.10"></a>
+<span class="sourceLineNo">011</span> *<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * Unless required by applicable law or agreed to in writing, software<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * See the License for the specific language governing permissions and<a name="line.15"></a>
+<span class="sourceLineNo">016</span> * limitations under the License.<a name="line.16"></a>
+<span class="sourceLineNo">017</span> */<a name="line.17"></a>
+<span class="sourceLineNo">018</span>package org.apache.hadoop.hbase.codec;<a name="line.18"></a>
+<span class="sourceLineNo">019</span><a name="line.19"></a>
+<span class="sourceLineNo">020</span>import java.io.IOException;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.io.InputStream;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.io.OutputStream;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.nio.ByteBuffer;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.hbase.Cell;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.HBaseInterfaceAudience;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.KeyValueUtil;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.NoTagsKeyValue;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.util.ByteBufferUtils;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * Codec that does KeyValue version 1 serialization.<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * <a name="line.34"></a>
+<span class="sourceLineNo">035</span> * &lt;p&gt;Encodes Cell as serialized in KeyValue with total length prefix.<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * This is how KVs were serialized in Puts, Deletes and Results pre-0.96.  Its what would<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * happen if you called the Writable#write KeyValue implementation.  This encoder will fail<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * if the passed Cell is not an old-school pre-0.96 KeyValue.  Does not copy bytes writing.<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * It just writes them direct to the passed stream.<a name="line.39"></a>
+<span class="sourceLineNo">040</span> *<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * &lt;p&gt;If you wrote two KeyValues to this encoder, it would look like this in the stream:<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * &lt;pre&gt;<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * length-of-KeyValue1 // A java int with the length of KeyValue1 backing array<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * KeyValue1 backing array filled with a KeyValue serialized in its particular format<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * length-of-KeyValue2<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * KeyValue2 backing array<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * &lt;/pre&gt;<a name="line.47"></a>
+<span class="sourceLineNo">048</span> */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.CONFIG)<a name="line.49"></a>
+<span class="sourceLineNo">050</span>public class KeyValueCodec implements Codec {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  public static class KeyValueEncoder extends BaseEncoder {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    public KeyValueEncoder(final OutputStream out) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>      super(out);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>    @Override<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    public void write(Cell cell) throws IOException {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>      checkFlushed();<a name="line.58"></a>
+<span class="sourceLineNo">059</span>      // Do not write tags over RPC<a name="line.59"></a>
+<span class="sourceLineNo">060</span>      KeyValueUtil.oswrite(cell, out, false);<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    }<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>  public static class KeyValueDecoder extends BaseDecoder {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    public KeyValueDecoder(final InputStream in) {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>      super(in);<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>    protected Cell parseCell() throws IOException {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>      // No tags here<a name="line.70"></a>
+<span class="sourceLineNo">071</span>      return KeyValueUtil.iscreate(in, false);<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    }<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  }<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>  public static class ByteBufferedKeyValueDecoder implements Codec.Decoder {<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>    protected final ByteBuffer buf;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    protected Cell current = null;<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>    public ByteBufferedKeyValueDecoder(ByteBuffer buf) {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>      this.buf = buf;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    }<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span>    @Override<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    public boolean advance() throws IOException {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>      if (this.buf.remaining() &lt;= 0) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        return false;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      }<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      int len = ByteBufferUtils.toInt(buf);<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      assert buf.hasArray();<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      this.current = createCell(buf.array(), buf.arrayOffset() + buf.position(), len);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      buf.position(buf.position() + len);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      return true;<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    }<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>    @Override<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    public Cell current() {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>      return this.current;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>    protected Cell createCell(byte[] buf, int offset, int len) {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>      return new NoTagsKeyValue(buf, offset, len);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    }<a name="line.103"></a>
+<span class="sourceLineNo">104</span>  }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>  /**<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * Implementation depends on {@link InputStream#available()}<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   */<a name="line.108"></a>
+<span class="sourceLineNo">109</span>  @Override<a name="line.109"></a>
+<span class="sourceLineNo">110</span>  public Decoder getDecoder(final InputStream is) {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    return new KeyValueDecoder(is);<a name="line.111"></a>
+<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
+<span class="sourceLineNo">113</span><a name="line.113"></a>
+<span class="sourceLineNo">114</span>  @Override<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  public Decoder getDecoder(ByteBuffer buf) {<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    return new ByteBufferedKeyValueDecoder(buf);<a name="line.116"></a>
+<span class="sourceLineNo">117</span>  }<a name="line.117"></a>
+<span class="sourceLineNo">118</span><a name="line.118"></a>
+<span class="sourceLineNo">119</span>  @Override<a name="line.119"></a>
+<span class="sourceLineNo">120</span>  public Encoder getEncoder(OutputStream os) {<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    return new KeyValueEncoder(os);<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  }<a name="line.122"></a>
+<span class="sourceLineNo">123</span>}<a name="line.123"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>


Mime
View raw message