hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [46/51] [partial] hbase-site git commit: Published site at 0de221a19d799ad515f8f4556cacd05e6b4e74f8.
Date Fri, 29 Jan 2016 17:14:05 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c6155501/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/PutSortReducer.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/PutSortReducer.html b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/PutSortReducer.html
index 7aeda8d..a5f6e5e 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/PutSortReducer.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/mapreduce/PutSortReducer.html
@@ -75,30 +75,29 @@
 <span class="sourceLineNo">067</span>        for (List&lt;Cell&gt; cells: p.getFamilyCellMap().values()) {<a name="line.67"></a>
 <span class="sourceLineNo">068</span>          for (Cell cell: cells) {<a name="line.68"></a>
 <span class="sourceLineNo">069</span>            KeyValue kv = KeyValueUtil.ensureKeyValue(cell);<a name="line.69"></a>
-<span class="sourceLineNo">070</span>            map.add(kv);<a name="line.70"></a>
-<span class="sourceLineNo">071</span>          }<a name="line.71"></a>
-<span class="sourceLineNo">072</span>        }<a name="line.72"></a>
-<span class="sourceLineNo">073</span>        for(KeyValue kv: map){<a name="line.73"></a>
-<span class="sourceLineNo">074</span>          curSize +=kv.heapSize();<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>      context.setStatus("Read " + map.size() + " entries of " + map.getClass()<a name="line.77"></a>
-<span class="sourceLineNo">078</span>          + "(" + StringUtils.humanReadableInt(curSize) + ")");<a name="line.78"></a>
-<span class="sourceLineNo">079</span>      int index = 0;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      for (KeyValue kv : map) {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>        context.write(row, kv);<a name="line.81"></a>
-<span class="sourceLineNo">082</span>        if (++index % 100 == 0)<a name="line.82"></a>
-<span class="sourceLineNo">083</span>          context.setStatus("Wrote " + index);<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      }<a name="line.84"></a>
-<span class="sourceLineNo">085</span><a name="line.85"></a>
-<span class="sourceLineNo">086</span>      // if we have more entries to process<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      if (iter.hasNext()) {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>        // force flush because we cannot guarantee intra-row sorted order<a name="line.88"></a>
-<span class="sourceLineNo">089</span>        context.write(null, null);<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      }<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    }<a name="line.91"></a>
-<span class="sourceLineNo">092</span>  }<a name="line.92"></a>
-<span class="sourceLineNo">093</span>}<a name="line.93"></a>
+<span class="sourceLineNo">070</span>            if (map.add(kv)) {// don't count duplicated kv into size<a name="line.70"></a>
+<span class="sourceLineNo">071</span>              curSize += kv.heapSize();<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>      }<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      context.setStatus("Read " + map.size() + " entries of " + map.getClass()<a name="line.76"></a>
+<span class="sourceLineNo">077</span>          + "(" + StringUtils.humanReadableInt(curSize) + ")");<a name="line.77"></a>
+<span class="sourceLineNo">078</span>      int index = 0;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>      for (KeyValue kv : map) {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>        context.write(row, kv);<a name="line.80"></a>
+<span class="sourceLineNo">081</span>        if (++index % 100 == 0)<a name="line.81"></a>
+<span class="sourceLineNo">082</span>          context.setStatus("Wrote " + index);<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>      // if we have more entries to process<a name="line.85"></a>
+<span class="sourceLineNo">086</span>      if (iter.hasNext()) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        // force flush because we cannot guarantee intra-row sorted order<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        context.write(null, null);<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      }<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    }<a name="line.90"></a>
+<span class="sourceLineNo">091</span>  }<a name="line.91"></a>
+<span class="sourceLineNo">092</span>}<a name="line.92"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c6155501/apidocs/src-html/org/apache/hadoop/hbase/util/ByteBufferUtils.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/util/ByteBufferUtils.html b/apidocs/src-html/org/apache/hadoop/hbase/util/ByteBufferUtils.html
index 4c1ef5d..2969881 100644
--- a/apidocs/src-html/org/apache/hadoop/hbase/util/ByteBufferUtils.html
+++ b/apidocs/src-html/org/apache/hadoop/hbase/util/ByteBufferUtils.html
@@ -587,384 +587,400 @@
 <span class="sourceLineNo">579</span>    return compareTo(buf1, o1, l1, buf2, o2, l2) == 0;<a name="line.579"></a>
 <span class="sourceLineNo">580</span>  }<a name="line.580"></a>
 <span class="sourceLineNo">581</span><a name="line.581"></a>
-<span class="sourceLineNo">582</span>  public static int compareTo(ByteBuffer buf1, int o1, int l1, ByteBuffer buf2, int o2, int l2) {<a name="line.582"></a>
-<span class="sourceLineNo">583</span>    if (UNSAFE_UNALIGNED) {<a name="line.583"></a>
-<span class="sourceLineNo">584</span>      long offset1Adj, offset2Adj;<a name="line.584"></a>
-<span class="sourceLineNo">585</span>      Object refObj1 = null, refObj2 = null;<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      if (buf1.isDirect()) {<a name="line.586"></a>
-<span class="sourceLineNo">587</span>        offset1Adj = o1 + ((DirectBuffer) buf1).address();<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      } else {<a name="line.588"></a>
-<span class="sourceLineNo">589</span>        offset1Adj = o1 + buf1.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.589"></a>
-<span class="sourceLineNo">590</span>        refObj1 = buf1.array();<a name="line.590"></a>
-<span class="sourceLineNo">591</span>      }<a name="line.591"></a>
-<span class="sourceLineNo">592</span>      if (buf2.isDirect()) {<a name="line.592"></a>
-<span class="sourceLineNo">593</span>        offset2Adj = o2 + ((DirectBuffer) buf2).address();<a name="line.593"></a>
-<span class="sourceLineNo">594</span>      } else {<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        offset2Adj = o2 + buf2.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        refObj2 = buf2.array();<a name="line.596"></a>
-<span class="sourceLineNo">597</span>      }<a name="line.597"></a>
-<span class="sourceLineNo">598</span>      return compareToUnsafe(refObj1, offset1Adj, l1, refObj2, offset2Adj, l2);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>    }<a name="line.599"></a>
-<span class="sourceLineNo">600</span>    int end1 = o1 + l1;<a name="line.600"></a>
-<span class="sourceLineNo">601</span>    int end2 = o2 + l2;<a name="line.601"></a>
-<span class="sourceLineNo">602</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>      int a = buf1.get(i) &amp; 0xFF;<a name="line.603"></a>
-<span class="sourceLineNo">604</span>      int b = buf2.get(j) &amp; 0xFF;<a name="line.604"></a>
-<span class="sourceLineNo">605</span>      if (a != b) {<a name="line.605"></a>
-<span class="sourceLineNo">606</span>        return a - b;<a name="line.606"></a>
+<span class="sourceLineNo">582</span>  /**<a name="line.582"></a>
+<span class="sourceLineNo">583</span>   * @param buf<a name="line.583"></a>
+<span class="sourceLineNo">584</span>   *          ByteBuffer to hash<a name="line.584"></a>
+<span class="sourceLineNo">585</span>   * @param offset<a name="line.585"></a>
+<span class="sourceLineNo">586</span>   *          offset to start from<a name="line.586"></a>
+<span class="sourceLineNo">587</span>   * @param length<a name="line.587"></a>
+<span class="sourceLineNo">588</span>   *          length to hash<a name="line.588"></a>
+<span class="sourceLineNo">589</span>   */<a name="line.589"></a>
+<span class="sourceLineNo">590</span>  public static int hashCode(ByteBuffer buf, int offset, int length) {<a name="line.590"></a>
+<span class="sourceLineNo">591</span>    int hash = 1;<a name="line.591"></a>
+<span class="sourceLineNo">592</span>    for (int i = offset; i &lt; offset + length; i++) {<a name="line.592"></a>
+<span class="sourceLineNo">593</span>      hash = (31 * hash) + (int) toByte(buf, i);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>    }<a name="line.594"></a>
+<span class="sourceLineNo">595</span>    return hash;<a name="line.595"></a>
+<span class="sourceLineNo">596</span>  }<a name="line.596"></a>
+<span class="sourceLineNo">597</span><a name="line.597"></a>
+<span class="sourceLineNo">598</span>  public static int compareTo(ByteBuffer buf1, int o1, int l1, ByteBuffer buf2, int o2, int l2) {<a name="line.598"></a>
+<span class="sourceLineNo">599</span>    if (UNSAFE_UNALIGNED) {<a name="line.599"></a>
+<span class="sourceLineNo">600</span>      long offset1Adj, offset2Adj;<a name="line.600"></a>
+<span class="sourceLineNo">601</span>      Object refObj1 = null, refObj2 = null;<a name="line.601"></a>
+<span class="sourceLineNo">602</span>      if (buf1.isDirect()) {<a name="line.602"></a>
+<span class="sourceLineNo">603</span>        offset1Adj = o1 + ((DirectBuffer) buf1).address();<a name="line.603"></a>
+<span class="sourceLineNo">604</span>      } else {<a name="line.604"></a>
+<span class="sourceLineNo">605</span>        offset1Adj = o1 + buf1.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.605"></a>
+<span class="sourceLineNo">606</span>        refObj1 = buf1.array();<a name="line.606"></a>
 <span class="sourceLineNo">607</span>      }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>    }<a name="line.608"></a>
-<span class="sourceLineNo">609</span>    return l1 - l2;<a name="line.609"></a>
-<span class="sourceLineNo">610</span>  }<a name="line.610"></a>
-<span class="sourceLineNo">611</span><a name="line.611"></a>
-<span class="sourceLineNo">612</span>  public static boolean equals(ByteBuffer buf1, int o1, int l1, byte[] buf2, int o2, int l2) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>    // Since we're often comparing adjacent sorted data,<a name="line.613"></a>
-<span class="sourceLineNo">614</span>    // it's usual to have equal arrays except for the very last byte<a name="line.614"></a>
-<span class="sourceLineNo">615</span>    // so check that first<a name="line.615"></a>
-<span class="sourceLineNo">616</span>    if (toByte(buf1, o1 + l1 - 1) != buf2[o2 + l2 - 1]) return false;<a name="line.616"></a>
-<span class="sourceLineNo">617</span>    return compareTo(buf1, o1, l1, buf2, o2, l2) == 0;<a name="line.617"></a>
-<span class="sourceLineNo">618</span>  }<a name="line.618"></a>
-<span class="sourceLineNo">619</span><a name="line.619"></a>
-<span class="sourceLineNo">620</span>  public static int compareTo(byte [] buf1, int o1, int l1, ByteBuffer buf2, int o2, int l2) {<a name="line.620"></a>
-<span class="sourceLineNo">621</span>    // This method is nearly same as the compareTo that follows but hard sharing code given<a name="line.621"></a>
-<span class="sourceLineNo">622</span>    // byte array and bytebuffer types and this is a hot code path<a name="line.622"></a>
-<span class="sourceLineNo">623</span>    if (UNSAFE_UNALIGNED) {<a name="line.623"></a>
-<span class="sourceLineNo">624</span>      long offset2Adj;<a name="line.624"></a>
-<span class="sourceLineNo">625</span>      Object refObj2 = null;<a name="line.625"></a>
-<span class="sourceLineNo">626</span>      if (buf2.isDirect()) {<a name="line.626"></a>
-<span class="sourceLineNo">627</span>        offset2Adj = o2 + ((DirectBuffer)buf2).address();<a name="line.627"></a>
-<span class="sourceLineNo">628</span>      } else {<a name="line.628"></a>
-<span class="sourceLineNo">629</span>        offset2Adj = o2 + buf2.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.629"></a>
-<span class="sourceLineNo">630</span>        refObj2 = buf2.array();<a name="line.630"></a>
-<span class="sourceLineNo">631</span>      }<a name="line.631"></a>
-<span class="sourceLineNo">632</span>      return compareToUnsafe(buf1, o1 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET, l1,<a name="line.632"></a>
-<span class="sourceLineNo">633</span>          refObj2, offset2Adj, l2);<a name="line.633"></a>
-<span class="sourceLineNo">634</span>    }<a name="line.634"></a>
-<span class="sourceLineNo">635</span>    int end1 = o1 + l1;<a name="line.635"></a>
-<span class="sourceLineNo">636</span>    int end2 = o2 + l2;<a name="line.636"></a>
-<span class="sourceLineNo">637</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.637"></a>
-<span class="sourceLineNo">638</span>      int a = buf1[i] &amp; 0xFF;<a name="line.638"></a>
-<span class="sourceLineNo">639</span>      int b = buf2.get(i) &amp; 0xFF;<a name="line.639"></a>
-<span class="sourceLineNo">640</span>      if (a != b) {<a name="line.640"></a>
-<span class="sourceLineNo">641</span>        return a - b;<a name="line.641"></a>
-<span class="sourceLineNo">642</span>      }<a name="line.642"></a>
-<span class="sourceLineNo">643</span>    }<a name="line.643"></a>
-<span class="sourceLineNo">644</span>    return l1 - l2;<a name="line.644"></a>
-<span class="sourceLineNo">645</span>  }<a name="line.645"></a>
-<span class="sourceLineNo">646</span><a name="line.646"></a>
-<span class="sourceLineNo">647</span>  public static int compareTo(ByteBuffer buf1, int o1, int l1, byte[] buf2, int o2, int l2) {<a name="line.647"></a>
-<span class="sourceLineNo">648</span>    if (UNSAFE_UNALIGNED) {<a name="line.648"></a>
-<span class="sourceLineNo">649</span>      long offset1Adj;<a name="line.649"></a>
-<span class="sourceLineNo">650</span>      Object refObj1 = null;<a name="line.650"></a>
-<span class="sourceLineNo">651</span>      if (buf1.isDirect()) {<a name="line.651"></a>
-<span class="sourceLineNo">652</span>        offset1Adj = o1 + ((DirectBuffer) buf1).address();<a name="line.652"></a>
-<span class="sourceLineNo">653</span>      } else {<a name="line.653"></a>
-<span class="sourceLineNo">654</span>        offset1Adj = o1 + buf1.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.654"></a>
-<span class="sourceLineNo">655</span>        refObj1 = buf1.array();<a name="line.655"></a>
-<span class="sourceLineNo">656</span>      }<a name="line.656"></a>
-<span class="sourceLineNo">657</span>      return compareToUnsafe(refObj1, offset1Adj, l1,<a name="line.657"></a>
-<span class="sourceLineNo">658</span>          buf2, o2 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET, l2);<a name="line.658"></a>
+<span class="sourceLineNo">608</span>      if (buf2.isDirect()) {<a name="line.608"></a>
+<span class="sourceLineNo">609</span>        offset2Adj = o2 + ((DirectBuffer) buf2).address();<a name="line.609"></a>
+<span class="sourceLineNo">610</span>      } else {<a name="line.610"></a>
+<span class="sourceLineNo">611</span>        offset2Adj = o2 + buf2.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.611"></a>
+<span class="sourceLineNo">612</span>        refObj2 = buf2.array();<a name="line.612"></a>
+<span class="sourceLineNo">613</span>      }<a name="line.613"></a>
+<span class="sourceLineNo">614</span>      return compareToUnsafe(refObj1, offset1Adj, l1, refObj2, offset2Adj, l2);<a name="line.614"></a>
+<span class="sourceLineNo">615</span>    }<a name="line.615"></a>
+<span class="sourceLineNo">616</span>    int end1 = o1 + l1;<a name="line.616"></a>
+<span class="sourceLineNo">617</span>    int end2 = o2 + l2;<a name="line.617"></a>
+<span class="sourceLineNo">618</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.618"></a>
+<span class="sourceLineNo">619</span>      int a = buf1.get(i) &amp; 0xFF;<a name="line.619"></a>
+<span class="sourceLineNo">620</span>      int b = buf2.get(j) &amp; 0xFF;<a name="line.620"></a>
+<span class="sourceLineNo">621</span>      if (a != b) {<a name="line.621"></a>
+<span class="sourceLineNo">622</span>        return a - b;<a name="line.622"></a>
+<span class="sourceLineNo">623</span>      }<a name="line.623"></a>
+<span class="sourceLineNo">624</span>    }<a name="line.624"></a>
+<span class="sourceLineNo">625</span>    return l1 - l2;<a name="line.625"></a>
+<span class="sourceLineNo">626</span>  }<a name="line.626"></a>
+<span class="sourceLineNo">627</span><a name="line.627"></a>
+<span class="sourceLineNo">628</span>  public static boolean equals(ByteBuffer buf1, int o1, int l1, byte[] buf2, int o2, int l2) {<a name="line.628"></a>
+<span class="sourceLineNo">629</span>    // Since we're often comparing adjacent sorted data,<a name="line.629"></a>
+<span class="sourceLineNo">630</span>    // it's usual to have equal arrays except for the very last byte<a name="line.630"></a>
+<span class="sourceLineNo">631</span>    // so check that first<a name="line.631"></a>
+<span class="sourceLineNo">632</span>    if (toByte(buf1, o1 + l1 - 1) != buf2[o2 + l2 - 1]) return false;<a name="line.632"></a>
+<span class="sourceLineNo">633</span>    return compareTo(buf1, o1, l1, buf2, o2, l2) == 0;<a name="line.633"></a>
+<span class="sourceLineNo">634</span>  }<a name="line.634"></a>
+<span class="sourceLineNo">635</span><a name="line.635"></a>
+<span class="sourceLineNo">636</span>  public static int compareTo(byte [] buf1, int o1, int l1, ByteBuffer buf2, int o2, int l2) {<a name="line.636"></a>
+<span class="sourceLineNo">637</span>    // This method is nearly same as the compareTo that follows but hard sharing code given<a name="line.637"></a>
+<span class="sourceLineNo">638</span>    // byte array and bytebuffer types and this is a hot code path<a name="line.638"></a>
+<span class="sourceLineNo">639</span>    if (UNSAFE_UNALIGNED) {<a name="line.639"></a>
+<span class="sourceLineNo">640</span>      long offset2Adj;<a name="line.640"></a>
+<span class="sourceLineNo">641</span>      Object refObj2 = null;<a name="line.641"></a>
+<span class="sourceLineNo">642</span>      if (buf2.isDirect()) {<a name="line.642"></a>
+<span class="sourceLineNo">643</span>        offset2Adj = o2 + ((DirectBuffer)buf2).address();<a name="line.643"></a>
+<span class="sourceLineNo">644</span>      } else {<a name="line.644"></a>
+<span class="sourceLineNo">645</span>        offset2Adj = o2 + buf2.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.645"></a>
+<span class="sourceLineNo">646</span>        refObj2 = buf2.array();<a name="line.646"></a>
+<span class="sourceLineNo">647</span>      }<a name="line.647"></a>
+<span class="sourceLineNo">648</span>      return compareToUnsafe(buf1, o1 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET, l1,<a name="line.648"></a>
+<span class="sourceLineNo">649</span>          refObj2, offset2Adj, l2);<a name="line.649"></a>
+<span class="sourceLineNo">650</span>    }<a name="line.650"></a>
+<span class="sourceLineNo">651</span>    int end1 = o1 + l1;<a name="line.651"></a>
+<span class="sourceLineNo">652</span>    int end2 = o2 + l2;<a name="line.652"></a>
+<span class="sourceLineNo">653</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.653"></a>
+<span class="sourceLineNo">654</span>      int a = buf1[i] &amp; 0xFF;<a name="line.654"></a>
+<span class="sourceLineNo">655</span>      int b = buf2.get(i) &amp; 0xFF;<a name="line.655"></a>
+<span class="sourceLineNo">656</span>      if (a != b) {<a name="line.656"></a>
+<span class="sourceLineNo">657</span>        return a - b;<a name="line.657"></a>
+<span class="sourceLineNo">658</span>      }<a name="line.658"></a>
 <span class="sourceLineNo">659</span>    }<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    int end1 = o1 + l1;<a name="line.660"></a>
-<span class="sourceLineNo">661</span>    int end2 = o2 + l2;<a name="line.661"></a>
-<span class="sourceLineNo">662</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.662"></a>
-<span class="sourceLineNo">663</span>      int a = buf1.get(i) &amp; 0xFF;<a name="line.663"></a>
-<span class="sourceLineNo">664</span>      int b = buf2[j] &amp; 0xFF;<a name="line.664"></a>
-<span class="sourceLineNo">665</span>      if (a != b) {<a name="line.665"></a>
-<span class="sourceLineNo">666</span>        return a - b;<a name="line.666"></a>
-<span class="sourceLineNo">667</span>      }<a name="line.667"></a>
-<span class="sourceLineNo">668</span>    }<a name="line.668"></a>
-<span class="sourceLineNo">669</span>    return l1 - l2;<a name="line.669"></a>
-<span class="sourceLineNo">670</span>  }<a name="line.670"></a>
-<span class="sourceLineNo">671</span><a name="line.671"></a>
-<span class="sourceLineNo">672</span>  static int compareToUnsafe(Object obj1, long o1, int l1, Object obj2, long o2, int l2) {<a name="line.672"></a>
-<span class="sourceLineNo">673</span>    final int minLength = Math.min(l1, l2);<a name="line.673"></a>
-<span class="sourceLineNo">674</span>    final int minWords = minLength / Bytes.SIZEOF_LONG;<a name="line.674"></a>
-<span class="sourceLineNo">675</span><a name="line.675"></a>
-<span class="sourceLineNo">676</span>    /*<a name="line.676"></a>
-<span class="sourceLineNo">677</span>     * Compare 8 bytes at a time. Benchmarking shows comparing 8 bytes at a time is no slower than<a name="line.677"></a>
-<span class="sourceLineNo">678</span>     * comparing 4 bytes at a time even on 32-bit. On the other hand, it is substantially faster on<a name="line.678"></a>
-<span class="sourceLineNo">679</span>     * 64-bit.<a name="line.679"></a>
-<span class="sourceLineNo">680</span>     */<a name="line.680"></a>
-<span class="sourceLineNo">681</span>    int j = minWords &lt;&lt; 3; // Same as minWords * SIZEOF_LONG<a name="line.681"></a>
-<span class="sourceLineNo">682</span>    for (int i = 0; i &lt; j; i += Bytes.SIZEOF_LONG) {<a name="line.682"></a>
-<span class="sourceLineNo">683</span>      long lw = UnsafeAccess.theUnsafe.getLong(obj1, o1 + i);<a name="line.683"></a>
-<span class="sourceLineNo">684</span>      long rw = UnsafeAccess.theUnsafe.getLong(obj2, o2 + i);<a name="line.684"></a>
-<span class="sourceLineNo">685</span>      long diff = lw ^ rw;<a name="line.685"></a>
-<span class="sourceLineNo">686</span>      if (diff != 0) {<a name="line.686"></a>
-<span class="sourceLineNo">687</span>        return lessThanUnsignedLong(lw, rw) ? -1 : 1;<a name="line.687"></a>
-<span class="sourceLineNo">688</span>      }<a name="line.688"></a>
-<span class="sourceLineNo">689</span>    }<a name="line.689"></a>
-<span class="sourceLineNo">690</span>    int offset = j;<a name="line.690"></a>
+<span class="sourceLineNo">660</span>    return l1 - l2;<a name="line.660"></a>
+<span class="sourceLineNo">661</span>  }<a name="line.661"></a>
+<span class="sourceLineNo">662</span><a name="line.662"></a>
+<span class="sourceLineNo">663</span>  public static int compareTo(ByteBuffer buf1, int o1, int l1, byte[] buf2, int o2, int l2) {<a name="line.663"></a>
+<span class="sourceLineNo">664</span>    if (UNSAFE_UNALIGNED) {<a name="line.664"></a>
+<span class="sourceLineNo">665</span>      long offset1Adj;<a name="line.665"></a>
+<span class="sourceLineNo">666</span>      Object refObj1 = null;<a name="line.666"></a>
+<span class="sourceLineNo">667</span>      if (buf1.isDirect()) {<a name="line.667"></a>
+<span class="sourceLineNo">668</span>        offset1Adj = o1 + ((DirectBuffer) buf1).address();<a name="line.668"></a>
+<span class="sourceLineNo">669</span>      } else {<a name="line.669"></a>
+<span class="sourceLineNo">670</span>        offset1Adj = o1 + buf1.arrayOffset() + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET;<a name="line.670"></a>
+<span class="sourceLineNo">671</span>        refObj1 = buf1.array();<a name="line.671"></a>
+<span class="sourceLineNo">672</span>      }<a name="line.672"></a>
+<span class="sourceLineNo">673</span>      return compareToUnsafe(refObj1, offset1Adj, l1,<a name="line.673"></a>
+<span class="sourceLineNo">674</span>          buf2, o2 + UnsafeAccess.BYTE_ARRAY_BASE_OFFSET, l2);<a name="line.674"></a>
+<span class="sourceLineNo">675</span>    }<a name="line.675"></a>
+<span class="sourceLineNo">676</span>    int end1 = o1 + l1;<a name="line.676"></a>
+<span class="sourceLineNo">677</span>    int end2 = o2 + l2;<a name="line.677"></a>
+<span class="sourceLineNo">678</span>    for (int i = o1, j = o2; i &lt; end1 &amp;&amp; j &lt; end2; i++, j++) {<a name="line.678"></a>
+<span class="sourceLineNo">679</span>      int a = buf1.get(i) &amp; 0xFF;<a name="line.679"></a>
+<span class="sourceLineNo">680</span>      int b = buf2[j] &amp; 0xFF;<a name="line.680"></a>
+<span class="sourceLineNo">681</span>      if (a != b) {<a name="line.681"></a>
+<span class="sourceLineNo">682</span>        return a - b;<a name="line.682"></a>
+<span class="sourceLineNo">683</span>      }<a name="line.683"></a>
+<span class="sourceLineNo">684</span>    }<a name="line.684"></a>
+<span class="sourceLineNo">685</span>    return l1 - l2;<a name="line.685"></a>
+<span class="sourceLineNo">686</span>  }<a name="line.686"></a>
+<span class="sourceLineNo">687</span><a name="line.687"></a>
+<span class="sourceLineNo">688</span>  static int compareToUnsafe(Object obj1, long o1, int l1, Object obj2, long o2, int l2) {<a name="line.688"></a>
+<span class="sourceLineNo">689</span>    final int minLength = Math.min(l1, l2);<a name="line.689"></a>
+<span class="sourceLineNo">690</span>    final int minWords = minLength / Bytes.SIZEOF_LONG;<a name="line.690"></a>
 <span class="sourceLineNo">691</span><a name="line.691"></a>
-<span class="sourceLineNo">692</span>    if (minLength - offset &gt;= Bytes.SIZEOF_INT) {<a name="line.692"></a>
-<span class="sourceLineNo">693</span>      int il = UnsafeAccess.theUnsafe.getInt(obj1, o1 + offset);<a name="line.693"></a>
-<span class="sourceLineNo">694</span>      int ir = UnsafeAccess.theUnsafe.getInt(obj2, o2 + offset);<a name="line.694"></a>
-<span class="sourceLineNo">695</span>      if (il != ir) {<a name="line.695"></a>
-<span class="sourceLineNo">696</span>        return lessThanUnsignedInt(il, ir) ? -1 : 1;<a name="line.696"></a>
-<span class="sourceLineNo">697</span>      }<a name="line.697"></a>
-<span class="sourceLineNo">698</span>      offset += Bytes.SIZEOF_INT;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>    }<a name="line.699"></a>
-<span class="sourceLineNo">700</span>    if (minLength - offset &gt;= Bytes.SIZEOF_SHORT) {<a name="line.700"></a>
-<span class="sourceLineNo">701</span>      short sl = UnsafeAccess.theUnsafe.getShort(obj1, o1 + offset);<a name="line.701"></a>
-<span class="sourceLineNo">702</span>      short sr = UnsafeAccess.theUnsafe.getShort(obj2, o2 + offset);<a name="line.702"></a>
-<span class="sourceLineNo">703</span>      if (sl != sr) {<a name="line.703"></a>
-<span class="sourceLineNo">704</span>        return lessThanUnsignedShort(sl, sr) ? -1 : 1;<a name="line.704"></a>
-<span class="sourceLineNo">705</span>      }<a name="line.705"></a>
-<span class="sourceLineNo">706</span>      offset += Bytes.SIZEOF_SHORT;<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    }<a name="line.707"></a>
-<span class="sourceLineNo">708</span>    if (minLength - offset == 1) {<a name="line.708"></a>
-<span class="sourceLineNo">709</span>      int a = (UnsafeAccess.theUnsafe.getByte(obj1, o1 + offset) &amp; 0xff);<a name="line.709"></a>
-<span class="sourceLineNo">710</span>      int b = (UnsafeAccess.theUnsafe.getByte(obj2, o2 + offset) &amp; 0xff);<a name="line.710"></a>
-<span class="sourceLineNo">711</span>      if (a != b) {<a name="line.711"></a>
-<span class="sourceLineNo">712</span>        return a - b;<a name="line.712"></a>
+<span class="sourceLineNo">692</span>    /*<a name="line.692"></a>
+<span class="sourceLineNo">693</span>     * Compare 8 bytes at a time. Benchmarking shows comparing 8 bytes at a time is no slower than<a name="line.693"></a>
+<span class="sourceLineNo">694</span>     * comparing 4 bytes at a time even on 32-bit. On the other hand, it is substantially faster on<a name="line.694"></a>
+<span class="sourceLineNo">695</span>     * 64-bit.<a name="line.695"></a>
+<span class="sourceLineNo">696</span>     */<a name="line.696"></a>
+<span class="sourceLineNo">697</span>    int j = minWords &lt;&lt; 3; // Same as minWords * SIZEOF_LONG<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    for (int i = 0; i &lt; j; i += Bytes.SIZEOF_LONG) {<a name="line.698"></a>
+<span class="sourceLineNo">699</span>      long lw = UnsafeAccess.theUnsafe.getLong(obj1, o1 + i);<a name="line.699"></a>
+<span class="sourceLineNo">700</span>      long rw = UnsafeAccess.theUnsafe.getLong(obj2, o2 + i);<a name="line.700"></a>
+<span class="sourceLineNo">701</span>      long diff = lw ^ rw;<a name="line.701"></a>
+<span class="sourceLineNo">702</span>      if (diff != 0) {<a name="line.702"></a>
+<span class="sourceLineNo">703</span>        return lessThanUnsignedLong(lw, rw) ? -1 : 1;<a name="line.703"></a>
+<span class="sourceLineNo">704</span>      }<a name="line.704"></a>
+<span class="sourceLineNo">705</span>    }<a name="line.705"></a>
+<span class="sourceLineNo">706</span>    int offset = j;<a name="line.706"></a>
+<span class="sourceLineNo">707</span><a name="line.707"></a>
+<span class="sourceLineNo">708</span>    if (minLength - offset &gt;= Bytes.SIZEOF_INT) {<a name="line.708"></a>
+<span class="sourceLineNo">709</span>      int il = UnsafeAccess.theUnsafe.getInt(obj1, o1 + offset);<a name="line.709"></a>
+<span class="sourceLineNo">710</span>      int ir = UnsafeAccess.theUnsafe.getInt(obj2, o2 + offset);<a name="line.710"></a>
+<span class="sourceLineNo">711</span>      if (il != ir) {<a name="line.711"></a>
+<span class="sourceLineNo">712</span>        return lessThanUnsignedInt(il, ir) ? -1 : 1;<a name="line.712"></a>
 <span class="sourceLineNo">713</span>      }<a name="line.713"></a>
-<span class="sourceLineNo">714</span>    }<a name="line.714"></a>
-<span class="sourceLineNo">715</span>    return l1 - l2;<a name="line.715"></a>
-<span class="sourceLineNo">716</span>  }<a name="line.716"></a>
-<span class="sourceLineNo">717</span><a name="line.717"></a>
-<span class="sourceLineNo">718</span>  /*<a name="line.718"></a>
-<span class="sourceLineNo">719</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.719"></a>
-<span class="sourceLineNo">720</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.720"></a>
-<span class="sourceLineNo">721</span>   */<a name="line.721"></a>
-<span class="sourceLineNo">722</span>  private static boolean lessThanUnsignedLong(long x1, long x2) {<a name="line.722"></a>
-<span class="sourceLineNo">723</span>    if (UnsafeAccess.littleEndian) {<a name="line.723"></a>
-<span class="sourceLineNo">724</span>      x1 = Long.reverseBytes(x1);<a name="line.724"></a>
-<span class="sourceLineNo">725</span>      x2 = Long.reverseBytes(x2);<a name="line.725"></a>
-<span class="sourceLineNo">726</span>    }<a name="line.726"></a>
-<span class="sourceLineNo">727</span>    return (x1 + Long.MIN_VALUE) &lt; (x2 + Long.MIN_VALUE);<a name="line.727"></a>
-<span class="sourceLineNo">728</span>  }<a name="line.728"></a>
-<span class="sourceLineNo">729</span><a name="line.729"></a>
-<span class="sourceLineNo">730</span>  /*<a name="line.730"></a>
-<span class="sourceLineNo">731</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.731"></a>
-<span class="sourceLineNo">732</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.732"></a>
-<span class="sourceLineNo">733</span>   */<a name="line.733"></a>
-<span class="sourceLineNo">734</span>  private static boolean lessThanUnsignedInt(int x1, int x2) {<a name="line.734"></a>
-<span class="sourceLineNo">735</span>    if (UnsafeAccess.littleEndian) {<a name="line.735"></a>
-<span class="sourceLineNo">736</span>      x1 = Integer.reverseBytes(x1);<a name="line.736"></a>
-<span class="sourceLineNo">737</span>      x2 = Integer.reverseBytes(x2);<a name="line.737"></a>
-<span class="sourceLineNo">738</span>    }<a name="line.738"></a>
-<span class="sourceLineNo">739</span>    return (x1 &amp; 0xffffffffL) &lt; (x2 &amp; 0xffffffffL);<a name="line.739"></a>
-<span class="sourceLineNo">740</span>  }<a name="line.740"></a>
-<span class="sourceLineNo">741</span><a name="line.741"></a>
-<span class="sourceLineNo">742</span>  /*<a name="line.742"></a>
-<span class="sourceLineNo">743</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.743"></a>
-<span class="sourceLineNo">744</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.744"></a>
-<span class="sourceLineNo">745</span>   */<a name="line.745"></a>
-<span class="sourceLineNo">746</span>  private static boolean lessThanUnsignedShort(short x1, short x2) {<a name="line.746"></a>
-<span class="sourceLineNo">747</span>    if (UnsafeAccess.littleEndian) {<a name="line.747"></a>
-<span class="sourceLineNo">748</span>      x1 = Short.reverseBytes(x1);<a name="line.748"></a>
-<span class="sourceLineNo">749</span>      x2 = Short.reverseBytes(x2);<a name="line.749"></a>
-<span class="sourceLineNo">750</span>    }<a name="line.750"></a>
-<span class="sourceLineNo">751</span>    return (x1 &amp; 0xffff) &lt; (x2 &amp; 0xffff);<a name="line.751"></a>
-<span class="sourceLineNo">752</span>  }<a name="line.752"></a>
-<span class="sourceLineNo">753</span><a name="line.753"></a>
-<span class="sourceLineNo">754</span>  /**<a name="line.754"></a>
-<span class="sourceLineNo">755</span>   * Reads a short value at the given buffer's offset.<a name="line.755"></a>
-<span class="sourceLineNo">756</span>   * @param buffer<a name="line.756"></a>
-<span class="sourceLineNo">757</span>   * @param offset<a name="line.757"></a>
-<span class="sourceLineNo">758</span>   * @return short value at offset<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   */<a name="line.759"></a>
-<span class="sourceLineNo">760</span>  public static short toShort(ByteBuffer buffer, int offset) {<a name="line.760"></a>
-<span class="sourceLineNo">761</span>    if (UNSAFE_UNALIGNED) {<a name="line.761"></a>
-<span class="sourceLineNo">762</span>      return UnsafeAccess.toShort(buffer, offset);<a name="line.762"></a>
-<span class="sourceLineNo">763</span>    } else {<a name="line.763"></a>
-<span class="sourceLineNo">764</span>      return buffer.getShort(offset);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>    }<a name="line.765"></a>
-<span class="sourceLineNo">766</span>  }<a name="line.766"></a>
-<span class="sourceLineNo">767</span><a name="line.767"></a>
-<span class="sourceLineNo">768</span>  /**<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   * Reads an int value at the given buffer's offset.<a name="line.769"></a>
-<span class="sourceLineNo">770</span>   * @param buffer<a name="line.770"></a>
-<span class="sourceLineNo">771</span>   * @param offset<a name="line.771"></a>
-<span class="sourceLineNo">772</span>   * @return int value at offset<a name="line.772"></a>
-<span class="sourceLineNo">773</span>   */<a name="line.773"></a>
-<span class="sourceLineNo">774</span>  public static int toInt(ByteBuffer buffer, int offset) {<a name="line.774"></a>
-<span class="sourceLineNo">775</span>    if (UNSAFE_UNALIGNED) {<a name="line.775"></a>
-<span class="sourceLineNo">776</span>      return UnsafeAccess.toInt(buffer, offset);<a name="line.776"></a>
-<span class="sourceLineNo">777</span>    } else {<a name="line.777"></a>
-<span class="sourceLineNo">778</span>      return buffer.getInt(offset);<a name="line.778"></a>
-<span class="sourceLineNo">779</span>    }<a name="line.779"></a>
-<span class="sourceLineNo">780</span>  }<a name="line.780"></a>
-<span class="sourceLineNo">781</span><a name="line.781"></a>
-<span class="sourceLineNo">782</span>  /**<a name="line.782"></a>
-<span class="sourceLineNo">783</span>   * Converts a ByteBuffer to an int value<a name="line.783"></a>
-<span class="sourceLineNo">784</span>   *<a name="line.784"></a>
-<span class="sourceLineNo">785</span>   * @param buf The ByteBuffer<a name="line.785"></a>
-<span class="sourceLineNo">786</span>   * @param offset Offset to int value<a name="line.786"></a>
-<span class="sourceLineNo">787</span>   * @param length Number of bytes used to store the int value.<a name="line.787"></a>
-<span class="sourceLineNo">788</span>   * @return the int value<a name="line.788"></a>
-<span class="sourceLineNo">789</span>   * @throws IllegalArgumentException<a name="line.789"></a>
-<span class="sourceLineNo">790</span>   *           if there's not enough bytes left in the buffer after the given offset<a name="line.790"></a>
-<span class="sourceLineNo">791</span>   */<a name="line.791"></a>
-<span class="sourceLineNo">792</span>  public static int readAsInt(ByteBuffer buf, int offset, final int length) {<a name="line.792"></a>
-<span class="sourceLineNo">793</span>    if (offset + length &gt; buf.limit()) {<a name="line.793"></a>
-<span class="sourceLineNo">794</span>      throw new IllegalArgumentException("offset (" + offset + ") + length (" + length<a name="line.794"></a>
-<span class="sourceLineNo">795</span>          + ") exceed the" + " limit of the buffer: " + buf.limit());<a name="line.795"></a>
-<span class="sourceLineNo">796</span>    }<a name="line.796"></a>
-<span class="sourceLineNo">797</span>    int n = 0;<a name="line.797"></a>
-<span class="sourceLineNo">798</span>    for(int i = offset; i &lt; (offset + length); i++) {<a name="line.798"></a>
-<span class="sourceLineNo">799</span>      n &lt;&lt;= 8;<a name="line.799"></a>
-<span class="sourceLineNo">800</span>      n ^= toByte(buf, i) &amp; 0xFF;<a name="line.800"></a>
-<span class="sourceLineNo">801</span>    }<a name="line.801"></a>
-<span class="sourceLineNo">802</span>    return n;<a name="line.802"></a>
-<span class="sourceLineNo">803</span>  }<a name="line.803"></a>
-<span class="sourceLineNo">804</span><a name="line.804"></a>
-<span class="sourceLineNo">805</span>  /**<a name="line.805"></a>
-<span class="sourceLineNo">806</span>   * Reads a long value at the given buffer's offset.<a name="line.806"></a>
-<span class="sourceLineNo">807</span>   * @param buffer<a name="line.807"></a>
-<span class="sourceLineNo">808</span>   * @param offset<a name="line.808"></a>
-<span class="sourceLineNo">809</span>   * @return long value at offset<a name="line.809"></a>
-<span class="sourceLineNo">810</span>   */<a name="line.810"></a>
-<span class="sourceLineNo">811</span>  public static long toLong(ByteBuffer buffer, int offset) {<a name="line.811"></a>
-<span class="sourceLineNo">812</span>    if (UNSAFE_UNALIGNED) {<a name="line.812"></a>
-<span class="sourceLineNo">813</span>      return UnsafeAccess.toLong(buffer, offset);<a name="line.813"></a>
-<span class="sourceLineNo">814</span>    } else {<a name="line.814"></a>
-<span class="sourceLineNo">815</span>      return buffer.getLong(offset);<a name="line.815"></a>
-<span class="sourceLineNo">816</span>    }<a name="line.816"></a>
-<span class="sourceLineNo">817</span>  }<a name="line.817"></a>
-<span class="sourceLineNo">818</span><a name="line.818"></a>
-<span class="sourceLineNo">819</span>  /**<a name="line.819"></a>
-<span class="sourceLineNo">820</span>   * Put an int value out to the given ByteBuffer's current position in big-endian format.<a name="line.820"></a>
-<span class="sourceLineNo">821</span>   * This also advances the position in buffer by int size.<a name="line.821"></a>
-<span class="sourceLineNo">822</span>   * @param buffer the ByteBuffer to write to<a name="line.822"></a>
-<span class="sourceLineNo">823</span>   * @param val int to write out<a name="line.823"></a>
-<span class="sourceLineNo">824</span>   */<a name="line.824"></a>
-<span class="sourceLineNo">825</span>  public static void putInt(ByteBuffer buffer, int val) {<a name="line.825"></a>
-<span class="sourceLineNo">826</span>    if (UNSAFE_UNALIGNED) {<a name="line.826"></a>
-<span class="sourceLineNo">827</span>      int newPos = UnsafeAccess.putInt(buffer, buffer.position(), val);<a name="line.827"></a>
-<span class="sourceLineNo">828</span>      buffer.position(newPos);<a name="line.828"></a>
-<span class="sourceLineNo">829</span>    } else {<a name="line.829"></a>
-<span class="sourceLineNo">830</span>      buffer.putInt(val);<a name="line.830"></a>
-<span class="sourceLineNo">831</span>    }<a name="line.831"></a>
-<span class="sourceLineNo">832</span>  }<a name="line.832"></a>
-<span class="sourceLineNo">833</span><a name="line.833"></a>
-<span class="sourceLineNo">834</span>  /**<a name="line.834"></a>
-<span class="sourceLineNo">835</span>   * Reads a double value at the given buffer's offset.<a name="line.835"></a>
-<span class="sourceLineNo">836</span>   * @param buffer<a name="line.836"></a>
-<span class="sourceLineNo">837</span>   * @param offset offset where double is<a name="line.837"></a>
-<span class="sourceLineNo">838</span>   * @return double value at offset<a name="line.838"></a>
-<span class="sourceLineNo">839</span>   */<a name="line.839"></a>
-<span class="sourceLineNo">840</span>  public static double toDouble(ByteBuffer buffer, int offset) {<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    return Double.longBitsToDouble(toLong(buffer, offset));<a name="line.841"></a>
-<span class="sourceLineNo">842</span>  }<a name="line.842"></a>
-<span class="sourceLineNo">843</span><a name="line.843"></a>
-<span class="sourceLineNo">844</span>  /**<a name="line.844"></a>
-<span class="sourceLineNo">845</span>   * Reads a BigDecimal value at the given buffer's offset.<a name="line.845"></a>
-<span class="sourceLineNo">846</span>   * @param buffer<a name="line.846"></a>
-<span class="sourceLineNo">847</span>   * @param offset<a name="line.847"></a>
-<span class="sourceLineNo">848</span>   * @return BigDecimal value at offset<a name="line.848"></a>
-<span class="sourceLineNo">849</span>   */<a name="line.849"></a>
-<span class="sourceLineNo">850</span>  public static BigDecimal toBigDecimal(ByteBuffer buffer, int offset, int length) {<a name="line.850"></a>
-<span class="sourceLineNo">851</span>    if (buffer == null || length &lt; Bytes.SIZEOF_INT + 1 ||<a name="line.851"></a>
-<span class="sourceLineNo">852</span>      (offset + length &gt; buffer.limit())) {<a name="line.852"></a>
-<span class="sourceLineNo">853</span>      return null;<a name="line.853"></a>
-<span class="sourceLineNo">854</span>    }<a name="line.854"></a>
-<span class="sourceLineNo">855</span><a name="line.855"></a>
-<span class="sourceLineNo">856</span>    int scale = toInt(buffer, offset);<a name="line.856"></a>
-<span class="sourceLineNo">857</span>    byte[] tcBytes = new byte[length - Bytes.SIZEOF_INT];<a name="line.857"></a>
-<span class="sourceLineNo">858</span>    copyFromBufferToArray(tcBytes, buffer, offset + Bytes.SIZEOF_INT, 0, length - Bytes.SIZEOF_INT);<a name="line.858"></a>
-<span class="sourceLineNo">859</span>    return new BigDecimal(new BigInteger(tcBytes), scale);<a name="line.859"></a>
-<span class="sourceLineNo">860</span>  }<a name="line.860"></a>
-<span class="sourceLineNo">861</span><a name="line.861"></a>
-<span class="sourceLineNo">862</span>  /**<a name="line.862"></a>
-<span class="sourceLineNo">863</span>   * Put a short value out to the given ByteBuffer's current position in big-endian format.<a name="line.863"></a>
-<span class="sourceLineNo">864</span>   * This also advances the position in buffer by short size.<a name="line.864"></a>
-<span class="sourceLineNo">865</span>   * @param buffer the ByteBuffer to write to<a name="line.865"></a>
-<span class="sourceLineNo">866</span>   * @param val short to write out<a name="line.866"></a>
-<span class="sourceLineNo">867</span>   */<a name="line.867"></a>
-<span class="sourceLineNo">868</span>  public static void putShort(ByteBuffer buffer, short val) {<a name="line.868"></a>
-<span class="sourceLineNo">869</span>    if (UNSAFE_UNALIGNED) {<a name="line.869"></a>
-<span class="sourceLineNo">870</span>      int newPos = UnsafeAccess.putShort(buffer, buffer.position(), val);<a name="line.870"></a>
-<span class="sourceLineNo">871</span>      buffer.position(newPos);<a name="line.871"></a>
-<span class="sourceLineNo">872</span>    } else {<a name="line.872"></a>
-<span class="sourceLineNo">873</span>      buffer.putShort(val);<a name="line.873"></a>
-<span class="sourceLineNo">874</span>    }<a name="line.874"></a>
-<span class="sourceLineNo">875</span>  }<a name="line.875"></a>
-<span class="sourceLineNo">876</span><a name="line.876"></a>
-<span class="sourceLineNo">877</span>  /**<a name="line.877"></a>
-<span class="sourceLineNo">878</span>   * Put a long value out to the given ByteBuffer's current position in big-endian format.<a name="line.878"></a>
-<span class="sourceLineNo">879</span>   * This also advances the position in buffer by long size.<a name="line.879"></a>
-<span class="sourceLineNo">880</span>   * @param buffer the ByteBuffer to write to<a name="line.880"></a>
-<span class="sourceLineNo">881</span>   * @param val long to write out<a name="line.881"></a>
-<span class="sourceLineNo">882</span>   */<a name="line.882"></a>
-<span class="sourceLineNo">883</span>  public static void putLong(ByteBuffer buffer, long val) {<a name="line.883"></a>
-<span class="sourceLineNo">884</span>    if (UNSAFE_UNALIGNED) {<a name="line.884"></a>
-<span class="sourceLineNo">885</span>      int newPos = UnsafeAccess.putLong(buffer, buffer.position(), val);<a name="line.885"></a>
-<span class="sourceLineNo">886</span>      buffer.position(newPos);<a name="line.886"></a>
-<span class="sourceLineNo">887</span>    } else {<a name="line.887"></a>
-<span class="sourceLineNo">888</span>      buffer.putLong(val);<a name="line.888"></a>
-<span class="sourceLineNo">889</span>    }<a name="line.889"></a>
-<span class="sourceLineNo">890</span>  }<a name="line.890"></a>
-<span class="sourceLineNo">891</span>  /**<a name="line.891"></a>
-<span class="sourceLineNo">892</span>   * Copies the bytes from given array's offset to length part into the given buffer. Puts the bytes<a name="line.892"></a>
-<span class="sourceLineNo">893</span>   * to buffer's current position. This also advances the position in the 'out' buffer by 'length'<a name="line.893"></a>
-<span class="sourceLineNo">894</span>   * @param out<a name="line.894"></a>
-<span class="sourceLineNo">895</span>   * @param in<a name="line.895"></a>
-<span class="sourceLineNo">896</span>   * @param inOffset<a name="line.896"></a>
-<span class="sourceLineNo">897</span>   * @param length<a name="line.897"></a>
+<span class="sourceLineNo">714</span>      offset += Bytes.SIZEOF_INT;<a name="line.714"></a>
+<span class="sourceLineNo">715</span>    }<a name="line.715"></a>
+<span class="sourceLineNo">716</span>    if (minLength - offset &gt;= Bytes.SIZEOF_SHORT) {<a name="line.716"></a>
+<span class="sourceLineNo">717</span>      short sl = UnsafeAccess.theUnsafe.getShort(obj1, o1 + offset);<a name="line.717"></a>
+<span class="sourceLineNo">718</span>      short sr = UnsafeAccess.theUnsafe.getShort(obj2, o2 + offset);<a name="line.718"></a>
+<span class="sourceLineNo">719</span>      if (sl != sr) {<a name="line.719"></a>
+<span class="sourceLineNo">720</span>        return lessThanUnsignedShort(sl, sr) ? -1 : 1;<a name="line.720"></a>
+<span class="sourceLineNo">721</span>      }<a name="line.721"></a>
+<span class="sourceLineNo">722</span>      offset += Bytes.SIZEOF_SHORT;<a name="line.722"></a>
+<span class="sourceLineNo">723</span>    }<a name="line.723"></a>
+<span class="sourceLineNo">724</span>    if (minLength - offset == 1) {<a name="line.724"></a>
+<span class="sourceLineNo">725</span>      int a = (UnsafeAccess.theUnsafe.getByte(obj1, o1 + offset) &amp; 0xff);<a name="line.725"></a>
+<span class="sourceLineNo">726</span>      int b = (UnsafeAccess.theUnsafe.getByte(obj2, o2 + offset) &amp; 0xff);<a name="line.726"></a>
+<span class="sourceLineNo">727</span>      if (a != b) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>        return a - b;<a name="line.728"></a>
+<span class="sourceLineNo">729</span>      }<a name="line.729"></a>
+<span class="sourceLineNo">730</span>    }<a name="line.730"></a>
+<span class="sourceLineNo">731</span>    return l1 - l2;<a name="line.731"></a>
+<span class="sourceLineNo">732</span>  }<a name="line.732"></a>
+<span class="sourceLineNo">733</span><a name="line.733"></a>
+<span class="sourceLineNo">734</span>  /*<a name="line.734"></a>
+<span class="sourceLineNo">735</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.735"></a>
+<span class="sourceLineNo">736</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.736"></a>
+<span class="sourceLineNo">737</span>   */<a name="line.737"></a>
+<span class="sourceLineNo">738</span>  private static boolean lessThanUnsignedLong(long x1, long x2) {<a name="line.738"></a>
+<span class="sourceLineNo">739</span>    if (UnsafeAccess.littleEndian) {<a name="line.739"></a>
+<span class="sourceLineNo">740</span>      x1 = Long.reverseBytes(x1);<a name="line.740"></a>
+<span class="sourceLineNo">741</span>      x2 = Long.reverseBytes(x2);<a name="line.741"></a>
+<span class="sourceLineNo">742</span>    }<a name="line.742"></a>
+<span class="sourceLineNo">743</span>    return (x1 + Long.MIN_VALUE) &lt; (x2 + Long.MIN_VALUE);<a name="line.743"></a>
+<span class="sourceLineNo">744</span>  }<a name="line.744"></a>
+<span class="sourceLineNo">745</span><a name="line.745"></a>
+<span class="sourceLineNo">746</span>  /*<a name="line.746"></a>
+<span class="sourceLineNo">747</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.747"></a>
+<span class="sourceLineNo">748</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.748"></a>
+<span class="sourceLineNo">749</span>   */<a name="line.749"></a>
+<span class="sourceLineNo">750</span>  private static boolean lessThanUnsignedInt(int x1, int x2) {<a name="line.750"></a>
+<span class="sourceLineNo">751</span>    if (UnsafeAccess.littleEndian) {<a name="line.751"></a>
+<span class="sourceLineNo">752</span>      x1 = Integer.reverseBytes(x1);<a name="line.752"></a>
+<span class="sourceLineNo">753</span>      x2 = Integer.reverseBytes(x2);<a name="line.753"></a>
+<span class="sourceLineNo">754</span>    }<a name="line.754"></a>
+<span class="sourceLineNo">755</span>    return (x1 &amp; 0xffffffffL) &lt; (x2 &amp; 0xffffffffL);<a name="line.755"></a>
+<span class="sourceLineNo">756</span>  }<a name="line.756"></a>
+<span class="sourceLineNo">757</span><a name="line.757"></a>
+<span class="sourceLineNo">758</span>  /*<a name="line.758"></a>
+<span class="sourceLineNo">759</span>   * Both values are passed as is read by Unsafe. When platform is Little Endian, have to convert<a name="line.759"></a>
+<span class="sourceLineNo">760</span>   * to corresponding Big Endian value and then do compare. We do all writes in Big Endian format.<a name="line.760"></a>
+<span class="sourceLineNo">761</span>   */<a name="line.761"></a>
+<span class="sourceLineNo">762</span>  private static boolean lessThanUnsignedShort(short x1, short x2) {<a name="line.762"></a>
+<span class="sourceLineNo">763</span>    if (UnsafeAccess.littleEndian) {<a name="line.763"></a>
+<span class="sourceLineNo">764</span>      x1 = Short.reverseBytes(x1);<a name="line.764"></a>
+<span class="sourceLineNo">765</span>      x2 = Short.reverseBytes(x2);<a name="line.765"></a>
+<span class="sourceLineNo">766</span>    }<a name="line.766"></a>
+<span class="sourceLineNo">767</span>    return (x1 &amp; 0xffff) &lt; (x2 &amp; 0xffff);<a name="line.767"></a>
+<span class="sourceLineNo">768</span>  }<a name="line.768"></a>
+<span class="sourceLineNo">769</span><a name="line.769"></a>
+<span class="sourceLineNo">770</span>  /**<a name="line.770"></a>
+<span class="sourceLineNo">771</span>   * Reads a short value at the given buffer's offset.<a name="line.771"></a>
+<span class="sourceLineNo">772</span>   * @param buffer<a name="line.772"></a>
+<span class="sourceLineNo">773</span>   * @param offset<a name="line.773"></a>
+<span class="sourceLineNo">774</span>   * @return short value at offset<a name="line.774"></a>
+<span class="sourceLineNo">775</span>   */<a name="line.775"></a>
+<span class="sourceLineNo">776</span>  public static short toShort(ByteBuffer buffer, int offset) {<a name="line.776"></a>
+<span class="sourceLineNo">777</span>    if (UNSAFE_UNALIGNED) {<a name="line.777"></a>
+<span class="sourceLineNo">778</span>      return UnsafeAccess.toShort(buffer, offset);<a name="line.778"></a>
+<span class="sourceLineNo">779</span>    } else {<a name="line.779"></a>
+<span class="sourceLineNo">780</span>      return buffer.getShort(offset);<a name="line.780"></a>
+<span class="sourceLineNo">781</span>    }<a name="line.781"></a>
+<span class="sourceLineNo">782</span>  }<a name="line.782"></a>
+<span class="sourceLineNo">783</span><a name="line.783"></a>
+<span class="sourceLineNo">784</span>  /**<a name="line.784"></a>
+<span class="sourceLineNo">785</span>   * Reads an int value at the given buffer's offset.<a name="line.785"></a>
+<span class="sourceLineNo">786</span>   * @param buffer<a name="line.786"></a>
+<span class="sourceLineNo">787</span>   * @param offset<a name="line.787"></a>
+<span class="sourceLineNo">788</span>   * @return int value at offset<a name="line.788"></a>
+<span class="sourceLineNo">789</span>   */<a name="line.789"></a>
+<span class="sourceLineNo">790</span>  public static int toInt(ByteBuffer buffer, int offset) {<a name="line.790"></a>
+<span class="sourceLineNo">791</span>    if (UNSAFE_UNALIGNED) {<a name="line.791"></a>
+<span class="sourceLineNo">792</span>      return UnsafeAccess.toInt(buffer, offset);<a name="line.792"></a>
+<span class="sourceLineNo">793</span>    } else {<a name="line.793"></a>
+<span class="sourceLineNo">794</span>      return buffer.getInt(offset);<a name="line.794"></a>
+<span class="sourceLineNo">795</span>    }<a name="line.795"></a>
+<span class="sourceLineNo">796</span>  }<a name="line.796"></a>
+<span class="sourceLineNo">797</span><a name="line.797"></a>
+<span class="sourceLineNo">798</span>  /**<a name="line.798"></a>
+<span class="sourceLineNo">799</span>   * Converts a ByteBuffer to an int value<a name="line.799"></a>
+<span class="sourceLineNo">800</span>   *<a name="line.800"></a>
+<span class="sourceLineNo">801</span>   * @param buf The ByteBuffer<a name="line.801"></a>
+<span class="sourceLineNo">802</span>   * @param offset Offset to int value<a name="line.802"></a>
+<span class="sourceLineNo">803</span>   * @param length Number of bytes used to store the int value.<a name="line.803"></a>
+<span class="sourceLineNo">804</span>   * @return the int value<a name="line.804"></a>
+<span class="sourceLineNo">805</span>   * @throws IllegalArgumentException<a name="line.805"></a>
+<span class="sourceLineNo">806</span>   *           if there's not enough bytes left in the buffer after the given offset<a name="line.806"></a>
+<span class="sourceLineNo">807</span>   */<a name="line.807"></a>
+<span class="sourceLineNo">808</span>  public static int readAsInt(ByteBuffer buf, int offset, final int length) {<a name="line.808"></a>
+<span class="sourceLineNo">809</span>    if (offset + length &gt; buf.limit()) {<a name="line.809"></a>
+<span class="sourceLineNo">810</span>      throw new IllegalArgumentException("offset (" + offset + ") + length (" + length<a name="line.810"></a>
+<span class="sourceLineNo">811</span>          + ") exceed the" + " limit of the buffer: " + buf.limit());<a name="line.811"></a>
+<span class="sourceLineNo">812</span>    }<a name="line.812"></a>
+<span class="sourceLineNo">813</span>    int n = 0;<a name="line.813"></a>
+<span class="sourceLineNo">814</span>    for(int i = offset; i &lt; (offset + length); i++) {<a name="line.814"></a>
+<span class="sourceLineNo">815</span>      n &lt;&lt;= 8;<a name="line.815"></a>
+<span class="sourceLineNo">816</span>      n ^= toByte(buf, i) &amp; 0xFF;<a name="line.816"></a>
+<span class="sourceLineNo">817</span>    }<a name="line.817"></a>
+<span class="sourceLineNo">818</span>    return n;<a name="line.818"></a>
+<span class="sourceLineNo">819</span>  }<a name="line.819"></a>
+<span class="sourceLineNo">820</span><a name="line.820"></a>
+<span class="sourceLineNo">821</span>  /**<a name="line.821"></a>
+<span class="sourceLineNo">822</span>   * Reads a long value at the given buffer's offset.<a name="line.822"></a>
+<span class="sourceLineNo">823</span>   * @param buffer<a name="line.823"></a>
+<span class="sourceLineNo">824</span>   * @param offset<a name="line.824"></a>
+<span class="sourceLineNo">825</span>   * @return long value at offset<a name="line.825"></a>
+<span class="sourceLineNo">826</span>   */<a name="line.826"></a>
+<span class="sourceLineNo">827</span>  public static long toLong(ByteBuffer buffer, int offset) {<a name="line.827"></a>
+<span class="sourceLineNo">828</span>    if (UNSAFE_UNALIGNED) {<a name="line.828"></a>
+<span class="sourceLineNo">829</span>      return UnsafeAccess.toLong(buffer, offset);<a name="line.829"></a>
+<span class="sourceLineNo">830</span>    } else {<a name="line.830"></a>
+<span class="sourceLineNo">831</span>      return buffer.getLong(offset);<a name="line.831"></a>
+<span class="sourceLineNo">832</span>    }<a name="line.832"></a>
+<span class="sourceLineNo">833</span>  }<a name="line.833"></a>
+<span class="sourceLineNo">834</span><a name="line.834"></a>
+<span class="sourceLineNo">835</span>  /**<a name="line.835"></a>
+<span class="sourceLineNo">836</span>   * Put an int value out to the given ByteBuffer's current position in big-endian format.<a name="line.836"></a>
+<span class="sourceLineNo">837</span>   * This also advances the position in buffer by int size.<a name="line.837"></a>
+<span class="sourceLineNo">838</span>   * @param buffer the ByteBuffer to write to<a name="line.838"></a>
+<span class="sourceLineNo">839</span>   * @param val int to write out<a name="line.839"></a>
+<span class="sourceLineNo">840</span>   */<a name="line.840"></a>
+<span class="sourceLineNo">841</span>  public static void putInt(ByteBuffer buffer, int val) {<a name="line.841"></a>
+<span class="sourceLineNo">842</span>    if (UNSAFE_UNALIGNED) {<a name="line.842"></a>
+<span class="sourceLineNo">843</span>      int newPos = UnsafeAccess.putInt(buffer, buffer.position(), val);<a name="line.843"></a>
+<span class="sourceLineNo">844</span>      buffer.position(newPos);<a name="line.844"></a>
+<span class="sourceLineNo">845</span>    } else {<a name="line.845"></a>
+<span class="sourceLineNo">846</span>      buffer.putInt(val);<a name="line.846"></a>
+<span class="sourceLineNo">847</span>    }<a name="line.847"></a>
+<span class="sourceLineNo">848</span>  }<a name="line.848"></a>
+<span class="sourceLineNo">849</span><a name="line.849"></a>
+<span class="sourceLineNo">850</span>  /**<a name="line.850"></a>
+<span class="sourceLineNo">851</span>   * Reads a double value at the given buffer's offset.<a name="line.851"></a>
+<span class="sourceLineNo">852</span>   * @param buffer<a name="line.852"></a>
+<span class="sourceLineNo">853</span>   * @param offset offset where double is<a name="line.853"></a>
+<span class="sourceLineNo">854</span>   * @return double value at offset<a name="line.854"></a>
+<span class="sourceLineNo">855</span>   */<a name="line.855"></a>
+<span class="sourceLineNo">856</span>  public static double toDouble(ByteBuffer buffer, int offset) {<a name="line.856"></a>
+<span class="sourceLineNo">857</span>    return Double.longBitsToDouble(toLong(buffer, offset));<a name="line.857"></a>
+<span class="sourceLineNo">858</span>  }<a name="line.858"></a>
+<span class="sourceLineNo">859</span><a name="line.859"></a>
+<span class="sourceLineNo">860</span>  /**<a name="line.860"></a>
+<span class="sourceLineNo">861</span>   * Reads a BigDecimal value at the given buffer's offset.<a name="line.861"></a>
+<span class="sourceLineNo">862</span>   * @param buffer<a name="line.862"></a>
+<span class="sourceLineNo">863</span>   * @param offset<a name="line.863"></a>
+<span class="sourceLineNo">864</span>   * @return BigDecimal value at offset<a name="line.864"></a>
+<span class="sourceLineNo">865</span>   */<a name="line.865"></a>
+<span class="sourceLineNo">866</span>  public static BigDecimal toBigDecimal(ByteBuffer buffer, int offset, int length) {<a name="line.866"></a>
+<span class="sourceLineNo">867</span>    if (buffer == null || length &lt; Bytes.SIZEOF_INT + 1 ||<a name="line.867"></a>
+<span class="sourceLineNo">868</span>      (offset + length &gt; buffer.limit())) {<a name="line.868"></a>
+<span class="sourceLineNo">869</span>      return null;<a name="line.869"></a>
+<span class="sourceLineNo">870</span>    }<a name="line.870"></a>
+<span class="sourceLineNo">871</span><a name="line.871"></a>
+<span class="sourceLineNo">872</span>    int scale = toInt(buffer, offset);<a name="line.872"></a>
+<span class="sourceLineNo">873</span>    byte[] tcBytes = new byte[length - Bytes.SIZEOF_INT];<a name="line.873"></a>
+<span class="sourceLineNo">874</span>    copyFromBufferToArray(tcBytes, buffer, offset + Bytes.SIZEOF_INT, 0, length - Bytes.SIZEOF_INT);<a name="line.874"></a>
+<span class="sourceLineNo">875</span>    return new BigDecimal(new BigInteger(tcBytes), scale);<a name="line.875"></a>
+<span class="sourceLineNo">876</span>  }<a name="line.876"></a>
+<span class="sourceLineNo">877</span><a name="line.877"></a>
+<span class="sourceLineNo">878</span>  /**<a name="line.878"></a>
+<span class="sourceLineNo">879</span>   * Put a short value out to the given ByteBuffer's current position in big-endian format.<a name="line.879"></a>
+<span class="sourceLineNo">880</span>   * This also advances the position in buffer by short size.<a name="line.880"></a>
+<span class="sourceLineNo">881</span>   * @param buffer the ByteBuffer to write to<a name="line.881"></a>
+<span class="sourceLineNo">882</span>   * @param val short to write out<a name="line.882"></a>
+<span class="sourceLineNo">883</span>   */<a name="line.883"></a>
+<span class="sourceLineNo">884</span>  public static void putShort(ByteBuffer buffer, short val) {<a name="line.884"></a>
+<span class="sourceLineNo">885</span>    if (UNSAFE_UNALIGNED) {<a name="line.885"></a>
+<span class="sourceLineNo">886</span>      int newPos = UnsafeAccess.putShort(buffer, buffer.position(), val);<a name="line.886"></a>
+<span class="sourceLineNo">887</span>      buffer.position(newPos);<a name="line.887"></a>
+<span class="sourceLineNo">888</span>    } else {<a name="line.888"></a>
+<span class="sourceLineNo">889</span>      buffer.putShort(val);<a name="line.889"></a>
+<span class="sourceLineNo">890</span>    }<a name="line.890"></a>
+<span class="sourceLineNo">891</span>  }<a name="line.891"></a>
+<span class="sourceLineNo">892</span><a name="line.892"></a>
+<span class="sourceLineNo">893</span>  /**<a name="line.893"></a>
+<span class="sourceLineNo">894</span>   * Put a long value out to the given ByteBuffer's current position in big-endian format.<a name="line.894"></a>
+<span class="sourceLineNo">895</span>   * This also advances the position in buffer by long size.<a name="line.895"></a>
+<span class="sourceLineNo">896</span>   * @param buffer the ByteBuffer to write to<a name="line.896"></a>
+<span class="sourceLineNo">897</span>   * @param val long to write out<a name="line.897"></a>
 <span class="sourceLineNo">898</span>   */<a name="line.898"></a>
-<span class="sourceLineNo">899</span>  public static void copyFromArrayToBuffer(ByteBuffer out, byte[] in, int inOffset, int length) {<a name="line.899"></a>
-<span class="sourceLineNo">900</span>    if (out.hasArray()) {<a name="line.900"></a>
-<span class="sourceLineNo">901</span>      System.arraycopy(in, inOffset, out.array(), out.arrayOffset() + out.position(), length);<a name="line.901"></a>
-<span class="sourceLineNo">902</span>      // Move the position in out by length<a name="line.902"></a>
-<span class="sourceLineNo">903</span>      out.position(out.position() + length);<a name="line.903"></a>
-<span class="sourceLineNo">904</span>    } else if (UNSAFE_AVAIL) {<a name="line.904"></a>
-<span class="sourceLineNo">905</span>      UnsafeAccess.copy(in, inOffset, out, out.position(), length);<a name="line.905"></a>
-<span class="sourceLineNo">906</span>      // Move the position in out by length<a name="line.906"></a>
-<span class="sourceLineNo">907</span>      out.position(out.position() + length);<a name="line.907"></a>
-<span class="sourceLineNo">908</span>    } else {<a name="line.908"></a>
-<span class="sourceLineNo">909</span>      out.put(in, inOffset, length);<a name="line.909"></a>
-<span class="sourceLineNo">910</span>    }<a name="line.910"></a>
-<span class="sourceLineNo">911</span>  }<a name="line.911"></a>
-<span class="sourceLineNo">912</span><a name="line.912"></a>
-<span class="sourceLineNo">913</span>  /**<a name="line.913"></a>
-<span class="sourceLineNo">914</span>   * Copies specified number of bytes from given offset of 'in' ByteBuffer to<a name="line.914"></a>
-<span class="sourceLineNo">915</span>   * the array.<a name="line.915"></a>
-<span class="sourceLineNo">916</span>   * @param out<a name="line.916"></a>
-<span class="sourceLineNo">917</span>   * @param in<a name="line.917"></a>
-<span class="sourceLineNo">918</span>   * @param sourceOffset<a name="line.918"></a>
-<span class="sourceLineNo">919</span>   * @param destinationOffset<a name="line.919"></a>
-<span class="sourceLineNo">920</span>   * @param length<a name="line.920"></a>
-<span class="sourceLineNo">921</span>   */<a name="line.921"></a>
-<span class="sourceLineNo">922</span>  public static void copyFromBufferToArray(byte[] out, ByteBuffer in, int sourceOffset,<a name="line.922"></a>
-<span class="sourceLineNo">923</span>      int destinationOffset, int length) {<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    if (in.hasArray()) {<a name="line.924"></a>
-<span class="sourceLineNo">925</span>      System.arraycopy(in.array(), sourceOffset + in.arrayOffset(), out, destinationOffset, length);<a name="line.925"></a>
-<span class="sourceLineNo">926</span>    } else if (UNSAFE_AVAIL) {<a name="line.926"></a>
-<span class="sourceLineNo">927</span>      UnsafeAccess.copy(in, sourceOffset, out, destinationOffset, length);<a name="line.927"></a>
-<span class="sourceLineNo">928</span>    } else {<a name="line.928"></a>
-<span class="sourceLineNo">929</span>      int oldPos = in.position();<a name="line.929"></a>
-<span class="sourceLineNo">930</span>      in.position(sourceOffset);<a name="line.930"></a>
-<span class="sourceLineNo">931</span>      in.get(out, destinationOffset, length);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>      in.position(oldPos);<a name="line.932"></a>
-<span class="sourceLineNo">933</span>    }<a name="line.933"></a>
-<span class="sourceLineNo">934</span>  }<a name="line.934"></a>
-<span class="sourceLineNo">935</span><a name="line.935"></a>
-<span class="sourceLineNo">936</span>  // For testing purpose<a name="line.936"></a>
-<span class="sourceLineNo">937</span>  public static String toStringBinary(final ByteBuffer b, int off, int len) {<a name="line.937"></a>
-<span class="sourceLineNo">938</span>    StringBuilder result = new StringBuilder();<a name="line.938"></a>
-<span class="sourceLineNo">939</span>    // Just in case we are passed a 'len' that is &gt; buffer length...<a name="line.939"></a>
-<span class="sourceLineNo">940</span>    if (off &gt;= b.capacity())<a name="line.940"></a>
-<span class="sourceLineNo">941</span>      return result.toString();<a name="line.941"></a>
-<span class="sourceLineNo">942</span>    if (off + len &gt; b.capacity())<a name="line.942"></a>
-<span class="sourceLineNo">943</span>      len = b.capacity() - off;<a name="line.943"></a>
-<span class="sourceLineNo">944</span>    for (int i = off; i &lt; off + len; ++i) {<a name="line.944"></a>
-<span class="sourceLineNo">945</span>      int ch = b.get(i) &amp; 0xFF;<a name="line.945"></a>
-<span class="sourceLineNo">946</span>      if ((ch &gt;= '0' &amp;&amp; ch &lt;= '9') || (ch &gt;= 'A' &amp;&amp; ch &lt;= 'Z') || (ch &gt;= 'a' &amp;&amp; ch &lt;= 'z')<a name="line.946"></a>
-<span class="sourceLineNo">947</span>          || " `~!@#$%^&amp;*()-_=+[]{}|;:'\",.&lt;&gt;/?".indexOf(ch) &gt;= 0) {<a name="line.947"></a>
-<span class="sourceLineNo">948</span>        result.append((char) ch);<a name="line.948"></a>
-<span class="sourceLineNo">949</span>      } else {<a name="line.949"></a>
-<span class="sourceLineNo">950</span>        result.append(String.format("\\x%02X", ch));<a name="line.950"></a>
-<span class="sourceLineNo">951</span>      }<a name="line.951"></a>
-<span class="sourceLineNo">952</span>    }<a name="line.952"></a>
-<span class="sourceLineNo">953</span>    return result.toString();<a name="line.953"></a>
-<span class="sourceLineNo">954</span>  }<a name="line.954"></a>
-<span class="sourceLineNo">955</span><a name="line.955"></a>
-<span class="sourceLineNo">956</span>  public static String toStringBinary(final ByteBuffer b) {<a name="line.956"></a>
-<span class="sourceLineNo">957</span>    return toStringBinary(b, 0, b.capacity());<a name="line.957"></a>
-<span class="sourceLineNo">958</span>  }<a name="line.958"></a>
-<span class="sourceLineNo">959</span>}<a name="line.959"></a>
+<span class="sourceLineNo">899</span>  public static void putLong(ByteBuffer buffer, long val) {<a name="line.899"></a>
+<span class="sourceLineNo">900</span>    if (UNSAFE_UNALIGNED) {<a name="line.900"></a>
+<span class="sourceLineNo">901</span>      int newPos = UnsafeAccess.putLong(buffer, buffer.position(), val);<a name="line.901"></a>
+<span class="sourceLineNo">902</span>      buffer.position(newPos);<a name="line.902"></a>
+<span class="sourceLineNo">903</span>    } else {<a name="line.903"></a>
+<span class="sourceLineNo">904</span>      buffer.putLong(val);<a name="line.904"></a>
+<span class="sourceLineNo">905</span>    }<a name="line.905"></a>
+<span class="sourceLineNo">906</span>  }<a name="line.906"></a>
+<span class="sourceLineNo">907</span>  /**<a name="line.907"></a>
+<span class="sourceLineNo">908</span>   * Copies the bytes from given array's offset to length part into the given buffer. Puts the bytes<a name="line.908"></a>
+<span class="sourceLineNo">909</span>   * to buffer's current position. This also advances the position in the 'out' buffer by 'length'<a name="line.909"></a>
+<span class="sourceLineNo">910</span>   * @param out<a name="line.910"></a>
+<span class="sourceLineNo">911</span>   * @param in<a name="line.911"></a>
+<span class="sourceLineNo">912</span>   * @param inOffset<a name="line.912"></a>
+<span class="sourceLineNo">913</span>   * @param length<a name="line.913"></a>
+<span class="sourceLineNo">914</span>   */<a name="line.914"></a>
+<span class="sourceLineNo">915</span>  public static void copyFromArrayToBuffer(ByteBuffer out, byte[] in, int inOffset, int length) {<a name="line.915"></a>
+<span class="sourceLineNo">916</span>    if (out.hasArray()) {<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      System.arraycopy(in, inOffset, out.array(), out.arrayOffset() + out.position(), length);<a name="line.917"></a>
+<span class="sourceLineNo">918</span>      // Move the position in out by length<a name="line.918"></a>
+<span class="sourceLineNo">919</span>      out.position(out.position() + length);<a name="line.919"></a>
+<span class="sourceLineNo">920</span>    } else if (UNSAFE_AVAIL) {<a name="line.920"></a>
+<span class="sourceLineNo">921</span>      UnsafeAccess.copy(in, inOffset, out, out.position(), length);<a name="line.921"></a>
+<span class="sourceLineNo">922</span>      // Move the position in out by length<a name="line.922"></a>
+<span class="sourceLineNo">923</span>      out.position(out.position() + length);<a name="line.923"></a>
+<span class="sourceLineNo">924</span>    } else {<a name="line.924"></a>
+<span class="sourceLineNo">925</span>      out.put(in, inOffset, length);<a name="line.925"></a>
+<span class="sourceLineNo">926</span>    }<a name="line.926"></a>
+<span class="sourceLineNo">927</span>  }<a name="line.927"></a>
+<span class="sourceLineNo">928</span><a name="line.928"></a>
+<span class="sourceLineNo">929</span>  /**<a name="line.929"></a>
+<span class="sourceLineNo">930</span>   * Copies specified number of bytes from given offset of 'in' ByteBuffer to<a name="line.930"></a>
+<span class="sourceLineNo">931</span>   * the array.<a name="line.931"></a>
+<span class="sourceLineNo">932</span>   * @param out<a name="line.932"></a>
+<span class="sourceLineNo">933</span>   * @param in<a name="line.933"></a>
+<span class="sourceLineNo">934</span>   * @param sourceOffset<a name="line.934"></a>
+<span class="sourceLineNo">935</span>   * @param destinationOffset<a name="line.935"></a>
+<span class="sourceLineNo">936</span>   * @param length<a name="line.936"></a>
+<span class="sourceLineNo">937</span>   */<a name="line.937"></a>
+<span class="sourceLineNo">938</span>  public static void copyFromBufferToArray(byte[] out, ByteBuffer in, int sourceOffset,<a name="line.938"></a>
+<span class="sourceLineNo">939</span>      int destinationOffset, int length) {<a name="line.939"></a>
+<span class="sourceLineNo">940</span>    if (in.hasArray()) {<a name="line.940"></a>
+<span class="sourceLineNo">941</span>      System.arraycopy(in.array(), sourceOffset + in.arrayOffset(), out, destinationOffset, length);<a name="line.941"></a>
+<span class="sourceLineNo">942</span>    } else if (UNSAFE_AVAIL) {<a name="line.942"></a>
+<span class="sourceLineNo">943</span>      UnsafeAccess.copy(in, sourceOffset, out, destinationOffset, length);<a name="line.943"></a>
+<span class="sourceLineNo">944</span>    } else {<a name="line.944"></a>
+<span class="sourceLineNo">945</span>      int oldPos = in.position();<a name="line.945"></a>
+<span class="sourceLineNo">946</span>      in.position(sourceOffset);<a name="line.946"></a>
+<span class="sourceLineNo">947</span>      in.get(out, destinationOffset, length);<a name="line.947"></a>
+<span class="sourceLineNo">948</span>      in.position(oldPos);<a name="line.948"></a>
+<span class="sourceLineNo">949</span>    }<a name="line.949"></a>
+<span class="sourceLineNo">950</span>  }<a name="line.950"></a>
+<span class="sourceLineNo">951</span><a name="line.951"></a>
+<span class="sourceLineNo">952</span>  // For testing purpose<a name="line.952"></a>
+<span class="sourceLineNo">953</span>  public static String toStringBinary(final ByteBuffer b, int off, int len) {<a name="line.953"></a>
+<span class="sourceLineNo">954</span>    StringBuilder result = new StringBuilder();<a name="line.954"></a>
+<span class="sourceLineNo">955</span>    // Just in case we are passed a 'len' that is &gt; buffer length...<a name="line.955"></a>
+<span class="sourceLineNo">956</span>    if (off &gt;= b.capacity())<a name="line.956"></a>
+<span class="sourceLineNo">957</span>      return result.toString();<a name="line.957"></a>
+<span class="sourceLineNo">958</span>    if (off + len &gt; b.capacity())<a name="line.958"></a>
+<span class="sourceLineNo">959</span>      len = b.capacity() - off;<a name="line.959"></a>
+<span class="sourceLineNo">960</span>    for (int i = off; i &lt; off + len; ++i) {<a name="line.960"></a>
+<span class="sourceLineNo">961</span>      int ch = b.get(i) &amp; 0xFF;<a name="line.961"></a>
+<span class="sourceLineNo">962</span>      if ((ch &gt;= '0' &amp;&amp; ch &lt;= '9') || (ch &gt;= 'A' &amp;&amp; ch &lt;= 'Z') || (ch &gt;= 'a' &amp;&amp; ch &lt;= 'z')<a name="line.962"></a>
+<span class="sourceLineNo">963</span>          || " `~!@#$%^&amp;*()-_=+[]{}|;:'\",.&lt;&gt;/?".indexOf(ch) &gt;= 0) {<a name="line.963"></a>
+<span class="sourceLineNo">964</span>        result.append((char) ch);<a name="line.964"></a>
+<span class="sourceLineNo">965</span>      } else {<a name="line.965"></a>
+<span class="sourceLineNo">966</span>        result.append(String.format("\\x%02X", ch));<a name="line.966"></a>
+<span class="sourceLineNo">967</span>      }<a name="line.967"></a>
+<span class="sourceLineNo">968</span>    }<a name="line.968"></a>
+<span class="sourceLineNo">969</span>    return result.toString();<a name="line.969"></a>
+<span class="sourceLineNo">970</span>  }<a name="line.970"></a>
+<span class="sourceLineNo">971</span><a name="line.971"></a>
+<span class="sourceLineNo">972</span>  public static String toStringBinary(final ByteBuffer b) {<a name="line.972"></a>
+<span class="sourceLineNo">973</span>    return toStringBinary(b, 0, b.capacity());<a name="line.973"></a>
+<span class="sourceLineNo">974</span>  }<a name="line.974"></a>
+<span class="sourceLineNo">975</span>}<a name="line.975"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c6155501/apidocs/src-html/org/apache/hadoop/hbase/util/LeaseNotRecoveredException.html
----------------------------------------------------------------------
diff --git a/apidocs/src-html/org/apache/hadoop/hbase/util/LeaseNotRecoveredException.html b/apidocs/src-html/org/apache/hadoop/hbase/util/LeaseNotRecoveredException.html
new file mode 100644
index 0000000..dddedc9
--- /dev/null
+++ b/apidocs/src-html/org/apache/hadoop/hbase/util/LeaseNotRecoveredException.html
@@ -0,0 +1,119 @@
+<!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> *<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * or more contributor license agreements.  See the NOTICE file<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * distributed with this work for additional information<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * regarding copyright ownership.  The ASF licenses this file<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * to you under the Apache License, Version 2.0 (the<a name="line.7"></a>
+<span class="sourceLineNo">008</span> * "License"); you may not use this file except in compliance<a name="line.8"></a>
+<span class="sourceLineNo">009</span> * with the License.  You may obtain a copy of the License at<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.11"></a>
+<span class="sourceLineNo">012</span> *<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * Unless required by applicable law or agreed to in writing, software<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> * See the License for the specific language governing permissions and<a name="line.16"></a>
+<span class="sourceLineNo">017</span> * limitations under the License.<a name="line.17"></a>
+<span class="sourceLineNo">018</span> */<a name="line.18"></a>
+<span class="sourceLineNo">019</span>package org.apache.hadoop.hbase.util;<a name="line.19"></a>
+<span class="sourceLineNo">020</span><a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.hadoop.hbase.HBaseIOException;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.hadoop.hbase.classification.InterfaceStability;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>/**<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * Thrown when the lease was expected to be recovered,<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * but the file can't be opened.<a name="line.27"></a>
+<span class="sourceLineNo">028</span> */<a name="line.28"></a>
+<span class="sourceLineNo">029</span>@InterfaceAudience.Public<a name="line.29"></a>
+<span class="sourceLineNo">030</span>@InterfaceStability.Stable<a name="line.30"></a>
+<span class="sourceLineNo">031</span>public class LeaseNotRecoveredException extends HBaseIOException {<a name="line.31"></a>
+<span class="sourceLineNo">032</span>  public LeaseNotRecoveredException() {<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    super();<a name="line.33"></a>
+<span class="sourceLineNo">034</span>  }<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>  public LeaseNotRecoveredException(String message) {<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    super(message);<a name="line.37"></a>
+<span class="sourceLineNo">038</span>  }<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>  public LeaseNotRecoveredException(String message, Throwable cause) {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>      super(message, cause);<a name="line.41"></a>
+<span class="sourceLineNo">042</span>  }<a name="line.42"></a>
+<span class="sourceLineNo">043</span><a name="line.43"></a>
+<span class="sourceLineNo">044</span>  public LeaseNotRecoveredException(Throwable cause) {<a name="line.44"></a>
+<span class="sourceLineNo">045</span>      super(cause);<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  }<a name="line.46"></a>
+<span class="sourceLineNo">047</span>}<a name="line.47"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c6155501/book.html
----------------------------------------------------------------------
diff --git a/book.html b/book.html
index ba12ef4..02adb7a 100644
--- a/book.html
+++ b/book.html
@@ -33005,7 +33005,7 @@ The server will return cellblocks compressed using this same compressor as long
 <div id="footer">
 <div id="footer-text">
 Version 2.0.0-SNAPSHOT<br>
-Last updated 2016-01-28 14:49:38 UTC
+Last updated 2016-01-29 14:48:00 UTC
 </div>
 </div>
 </body>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c6155501/bulk-loads.html
----------------------------------------------------------------------
diff --git a/bulk-loads.html b/bulk-loads.html
index 6b599db..0f3a8c8 100644
--- a/bulk-loads.html
+++ b/bulk-loads.html
@@ -7,7 +7,7 @@
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <meta name="Date-Revision-yyyymmdd" content="20160128" />
+    <meta name="Date-Revision-yyyymmdd" content="20160129" />
     <meta http-equiv="Content-Language" content="en" />
     <title>Apache HBase &#x2013;  
       Bulk Loads in Apache HBase (TM)
@@ -244,9 +244,9 @@
         <div class="container">
           <div id="banner">
         <div class="pull-left">
-                                <div id="bannerLeft">
-                <h2></h2>
-                </div>
+                                    <a href="http://hbasecon.com/" id="bannerLeft">
+                                                                                                <img src="images/hbasecon2016-stack-logo.jpg"  alt="hbasecon2016"/>
+                </a>
                       </div>
         <div class="pull-right">                                <a href="./" id="bannerRight">
                                                                                                 <img src="images/hbase_logo_with_orca_large.png"  alt="Apache HBase"/>
@@ -305,7 +305,7 @@ under the License. -->
                         <a href="http://www.apache.org/">The Apache Software Foundation</a>.
             All rights reserved.      
                     
-                  <li id="publishDate" class="pull-right">Last Published: 2016-01-28</li>
+                  <li id="publishDate" class="pull-right">Last Published: 2016-01-29</li>
             </p>
                 </div>
 


Mime
View raw message