hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [06/51] [partial] hbase-site git commit: Published site at .
Date Fri, 01 Sep 2017 15:13:57 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7ebe345d/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowColByteBufferCell.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowColByteBufferCell.html b/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowColByteBufferCell.html
index 6b0729b..9adaf3b 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowColByteBufferCell.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowColByteBufferCell.html
@@ -1559,1681 +1559,1662 @@
 <span class="sourceLineNo">1551</span>    };<a name="line.1551"></a>
 <span class="sourceLineNo">1552</span>  }<a name="line.1552"></a>
 <span class="sourceLineNo">1553</span><a name="line.1553"></a>
-<span class="sourceLineNo">1554</span>  private static final Iterator&lt;Tag&gt; EMPTY_TAGS_ITR = new Iterator&lt;Tag&gt;() {<a name="line.1554"></a>
-<span class="sourceLineNo">1555</span>    @Override<a name="line.1555"></a>
-<span class="sourceLineNo">1556</span>    public boolean hasNext() {<a name="line.1556"></a>
-<span class="sourceLineNo">1557</span>      return false;<a name="line.1557"></a>
-<span class="sourceLineNo">1558</span>    }<a name="line.1558"></a>
-<span class="sourceLineNo">1559</span><a name="line.1559"></a>
-<span class="sourceLineNo">1560</span>    @Override<a name="line.1560"></a>
-<span class="sourceLineNo">1561</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IT_NO_SUCH_ELEMENT",<a name="line.1561"></a>
-<span class="sourceLineNo">1562</span>      justification="Intentional")<a name="line.1562"></a>
-<span class="sourceLineNo">1563</span>    public Tag next() {<a name="line.1563"></a>
-<span class="sourceLineNo">1564</span>      return null;<a name="line.1564"></a>
+<span class="sourceLineNo">1554</span>  /**<a name="line.1554"></a>
+<span class="sourceLineNo">1555</span>   * Util method to iterate through the tags in the given cell.<a name="line.1555"></a>
+<span class="sourceLineNo">1556</span>   *<a name="line.1556"></a>
+<span class="sourceLineNo">1557</span>   * @param cell The Cell over which tags iterator is needed.<a name="line.1557"></a>
+<span class="sourceLineNo">1558</span>   * @return iterator for the tags<a name="line.1558"></a>
+<span class="sourceLineNo">1559</span>   */<a name="line.1559"></a>
+<span class="sourceLineNo">1560</span>  public static Iterator&lt;Tag&gt; tagsIterator(final Cell cell) {<a name="line.1560"></a>
+<span class="sourceLineNo">1561</span>    final int tagsLength = cell.getTagsLength();<a name="line.1561"></a>
+<span class="sourceLineNo">1562</span>    // Save an object allocation where we can<a name="line.1562"></a>
+<span class="sourceLineNo">1563</span>    if (tagsLength == 0) {<a name="line.1563"></a>
+<span class="sourceLineNo">1564</span>      return TagUtil.EMPTY_TAGS_ITR;<a name="line.1564"></a>
 <span class="sourceLineNo">1565</span>    }<a name="line.1565"></a>
-<span class="sourceLineNo">1566</span><a name="line.1566"></a>
-<span class="sourceLineNo">1567</span>    @Override<a name="line.1567"></a>
-<span class="sourceLineNo">1568</span>    public void remove() {<a name="line.1568"></a>
-<span class="sourceLineNo">1569</span>      throw new UnsupportedOperationException();<a name="line.1569"></a>
-<span class="sourceLineNo">1570</span>    }<a name="line.1570"></a>
-<span class="sourceLineNo">1571</span>  };<a name="line.1571"></a>
+<span class="sourceLineNo">1566</span>    if (cell instanceof ByteBufferCell) {<a name="line.1566"></a>
+<span class="sourceLineNo">1567</span>      return tagsIterator(((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1567"></a>
+<span class="sourceLineNo">1568</span>          ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1568"></a>
+<span class="sourceLineNo">1569</span>    }<a name="line.1569"></a>
+<span class="sourceLineNo">1570</span>    return tagsIterator(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1570"></a>
+<span class="sourceLineNo">1571</span>  }<a name="line.1571"></a>
 <span class="sourceLineNo">1572</span><a name="line.1572"></a>
 <span class="sourceLineNo">1573</span>  /**<a name="line.1573"></a>
-<span class="sourceLineNo">1574</span>   * Util method to iterate through the tags in the given cell.<a name="line.1574"></a>
-<span class="sourceLineNo">1575</span>   *<a name="line.1575"></a>
-<span class="sourceLineNo">1576</span>   * @param cell The Cell over which tags iterator is needed.<a name="line.1576"></a>
-<span class="sourceLineNo">1577</span>   * @return iterator for the tags<a name="line.1577"></a>
-<span class="sourceLineNo">1578</span>   */<a name="line.1578"></a>
-<span class="sourceLineNo">1579</span>  public static Iterator&lt;Tag&gt; tagsIterator(final Cell cell) {<a name="line.1579"></a>
-<span class="sourceLineNo">1580</span>    final int tagsLength = cell.getTagsLength();<a name="line.1580"></a>
-<span class="sourceLineNo">1581</span>    // Save an object allocation where we can<a name="line.1581"></a>
-<span class="sourceLineNo">1582</span>    if (tagsLength == 0) {<a name="line.1582"></a>
-<span class="sourceLineNo">1583</span>      return TagUtil.EMPTY_TAGS_ITR;<a name="line.1583"></a>
-<span class="sourceLineNo">1584</span>    }<a name="line.1584"></a>
-<span class="sourceLineNo">1585</span>    if (cell instanceof ByteBufferCell) {<a name="line.1585"></a>
-<span class="sourceLineNo">1586</span>      return tagsIterator(((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1586"></a>
-<span class="sourceLineNo">1587</span>          ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1587"></a>
-<span class="sourceLineNo">1588</span>    }<a name="line.1588"></a>
-<span class="sourceLineNo">1589</span>    return tagsIterator(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1589"></a>
-<span class="sourceLineNo">1590</span>  }<a name="line.1590"></a>
-<span class="sourceLineNo">1591</span><a name="line.1591"></a>
-<span class="sourceLineNo">1592</span>  /**<a name="line.1592"></a>
-<span class="sourceLineNo">1593</span>   * @param cell The Cell<a name="line.1593"></a>
-<span class="sourceLineNo">1594</span>   * @return Tags in the given Cell as a List<a name="line.1594"></a>
-<span class="sourceLineNo">1595</span>   */<a name="line.1595"></a>
-<span class="sourceLineNo">1596</span>  public static List&lt;Tag&gt; getTags(Cell cell) {<a name="line.1596"></a>
-<span class="sourceLineNo">1597</span>    List&lt;Tag&gt; tags = new ArrayList&lt;&gt;();<a name="line.1597"></a>
-<span class="sourceLineNo">1598</span>    Iterator&lt;Tag&gt; tagsItr = tagsIterator(cell);<a name="line.1598"></a>
-<span class="sourceLineNo">1599</span>    while (tagsItr.hasNext()) {<a name="line.1599"></a>
-<span class="sourceLineNo">1600</span>      tags.add(tagsItr.next());<a name="line.1600"></a>
-<span class="sourceLineNo">1601</span>    }<a name="line.1601"></a>
-<span class="sourceLineNo">1602</span>    return tags;<a name="line.1602"></a>
-<span class="sourceLineNo">1603</span>  }<a name="line.1603"></a>
-<span class="sourceLineNo">1604</span><a name="line.1604"></a>
-<span class="sourceLineNo">1605</span>  /**<a name="line.1605"></a>
-<span class="sourceLineNo">1606</span>   * Retrieve Cell's first tag, matching the passed in type<a name="line.1606"></a>
-<span class="sourceLineNo">1607</span>   *<a name="line.1607"></a>
-<span class="sourceLineNo">1608</span>   * @param cell The Cell<a name="line.1608"></a>
-<span class="sourceLineNo">1609</span>   * @param type Type of the Tag to retrieve<a name="line.1609"></a>
-<span class="sourceLineNo">1610</span>   * @return null if there is no tag of the passed in tag type<a name="line.1610"></a>
-<span class="sourceLineNo">1611</span>   */<a name="line.1611"></a>
-<span class="sourceLineNo">1612</span>  public static Tag getTag(Cell cell, byte type){<a name="line.1612"></a>
-<span class="sourceLineNo">1613</span>    boolean bufferBacked = cell instanceof ByteBufferCell;<a name="line.1613"></a>
-<span class="sourceLineNo">1614</span>    int length = cell.getTagsLength();<a name="line.1614"></a>
-<span class="sourceLineNo">1615</span>    int offset = bufferBacked? ((ByteBufferCell)cell).getTagsPosition():cell.getTagsOffset();<a name="line.1615"></a>
-<span class="sourceLineNo">1616</span>    int pos = offset;<a name="line.1616"></a>
-<span class="sourceLineNo">1617</span>    while (pos &lt; offset + length) {<a name="line.1617"></a>
-<span class="sourceLineNo">1618</span>      int tagLen;<a name="line.1618"></a>
-<span class="sourceLineNo">1619</span>      if (bufferBacked) {<a name="line.1619"></a>
-<span class="sourceLineNo">1620</span>        ByteBuffer tagsBuffer = ((ByteBufferCell)cell).getTagsByteBuffer();<a name="line.1620"></a>
-<span class="sourceLineNo">1621</span>        tagLen = ByteBufferUtils.readAsInt(tagsBuffer, pos, TAG_LENGTH_SIZE);<a name="line.1621"></a>
-<span class="sourceLineNo">1622</span>        if (ByteBufferUtils.toByte(tagsBuffer, pos + TAG_LENGTH_SIZE) == type) {<a name="line.1622"></a>
-<span class="sourceLineNo">1623</span>          return new ByteBufferTag(tagsBuffer, pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1623"></a>
-<span class="sourceLineNo">1624</span>        }<a name="line.1624"></a>
-<span class="sourceLineNo">1625</span>      } else {<a name="line.1625"></a>
-<span class="sourceLineNo">1626</span>        tagLen = Bytes.readAsInt(cell.getTagsArray(), pos, TAG_LENGTH_SIZE);<a name="line.1626"></a>
-<span class="sourceLineNo">1627</span>        if (cell.getTagsArray()[pos + TAG_LENGTH_SIZE] == type) {<a name="line.1627"></a>
-<span class="sourceLineNo">1628</span>          return new ArrayBackedTag(cell.getTagsArray(), pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1628"></a>
-<span class="sourceLineNo">1629</span>        }<a name="line.1629"></a>
-<span class="sourceLineNo">1630</span>      }<a name="line.1630"></a>
-<span class="sourceLineNo">1631</span>      pos += TAG_LENGTH_SIZE + tagLen;<a name="line.1631"></a>
-<span class="sourceLineNo">1632</span>    }<a name="line.1632"></a>
-<span class="sourceLineNo">1633</span>    return null;<a name="line.1633"></a>
-<span class="sourceLineNo">1634</span>  }<a name="line.1634"></a>
-<span class="sourceLineNo">1635</span><a name="line.1635"></a>
-<span class="sourceLineNo">1636</span>  /**<a name="line.1636"></a>
-<span class="sourceLineNo">1637</span>   * Returns true if the first range start1...end1 overlaps with the second range<a name="line.1637"></a>
-<span class="sourceLineNo">1638</span>   * start2...end2, assuming the byte arrays represent row keys<a name="line.1638"></a>
-<span class="sourceLineNo">1639</span>   */<a name="line.1639"></a>
-<span class="sourceLineNo">1640</span>  public static boolean overlappingKeys(final byte[] start1, final byte[] end1,<a name="line.1640"></a>
-<span class="sourceLineNo">1641</span>      final byte[] start2, final byte[] end2) {<a name="line.1641"></a>
-<span class="sourceLineNo">1642</span>    return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1,<a name="line.1642"></a>
-<span class="sourceLineNo">1643</span>        end2) &lt; 0)<a name="line.1643"></a>
-<span class="sourceLineNo">1644</span>        &amp;&amp; (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2,<a name="line.1644"></a>
-<span class="sourceLineNo">1645</span>            end1) &lt; 0);<a name="line.1645"></a>
-<span class="sourceLineNo">1646</span>  }<a name="line.1646"></a>
-<span class="sourceLineNo">1647</span><a name="line.1647"></a>
-<span class="sourceLineNo">1648</span>  /**<a name="line.1648"></a>
-<span class="sourceLineNo">1649</span>   * Sets the given seqId to the cell.<a name="line.1649"></a>
-<span class="sourceLineNo">1650</span>   * Marked as audience Private as of 1.2.0.<a name="line.1650"></a>
-<span class="sourceLineNo">1651</span>   * Setting a Cell sequenceid is an internal implementation detail not for general public use.<a name="line.1651"></a>
-<span class="sourceLineNo">1652</span>   * @param cell<a name="line.1652"></a>
-<span class="sourceLineNo">1653</span>   * @param seqId<a name="line.1653"></a>
-<span class="sourceLineNo">1654</span>   * @throws IOException when the passed cell is not of type {@link SettableSequenceId}<a name="line.1654"></a>
-<span class="sourceLineNo">1655</span>   */<a name="line.1655"></a>
-<span class="sourceLineNo">1656</span>  @InterfaceAudience.Private<a name="line.1656"></a>
-<span class="sourceLineNo">1657</span>  public static void setSequenceId(Cell cell, long seqId) throws IOException {<a name="line.1657"></a>
-<span class="sourceLineNo">1658</span>    if (cell instanceof SettableSequenceId) {<a name="line.1658"></a>
-<span class="sourceLineNo">1659</span>      ((SettableSequenceId) cell).setSequenceId(seqId);<a name="line.1659"></a>
-<span class="sourceLineNo">1660</span>    } else {<a name="line.1660"></a>
-<span class="sourceLineNo">1661</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1661"></a>
-<span class="sourceLineNo">1662</span>          + SettableSequenceId.class.getName()));<a name="line.1662"></a>
-<span class="sourceLineNo">1663</span>    }<a name="line.1663"></a>
-<span class="sourceLineNo">1664</span>  }<a name="line.1664"></a>
-<span class="sourceLineNo">1665</span><a name="line.1665"></a>
-<span class="sourceLineNo">1666</span>  /**<a name="line.1666"></a>
-<span class="sourceLineNo">1667</span>   * Sets the given timestamp to the cell.<a name="line.1667"></a>
-<span class="sourceLineNo">1668</span>   * @param cell<a name="line.1668"></a>
-<span class="sourceLineNo">1669</span>   * @param ts<a name="line.1669"></a>
-<span class="sourceLineNo">1670</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1670"></a>
-<span class="sourceLineNo">1671</span>   */<a name="line.1671"></a>
-<span class="sourceLineNo">1672</span>  public static void setTimestamp(Cell cell, long ts) throws IOException {<a name="line.1672"></a>
-<span class="sourceLineNo">1673</span>    if (cell instanceof SettableTimestamp) {<a name="line.1673"></a>
-<span class="sourceLineNo">1674</span>      ((SettableTimestamp) cell).setTimestamp(ts);<a name="line.1674"></a>
-<span class="sourceLineNo">1675</span>    } else {<a name="line.1675"></a>
-<span class="sourceLineNo">1676</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1676"></a>
-<span class="sourceLineNo">1677</span>          + SettableTimestamp.class.getName()));<a name="line.1677"></a>
-<span class="sourceLineNo">1678</span>    }<a name="line.1678"></a>
-<span class="sourceLineNo">1679</span>  }<a name="line.1679"></a>
-<span class="sourceLineNo">1680</span><a name="line.1680"></a>
-<span class="sourceLineNo">1681</span>  /**<a name="line.1681"></a>
-<span class="sourceLineNo">1682</span>   * Sets the given timestamp to the cell.<a name="line.1682"></a>
-<span class="sourceLineNo">1683</span>   * @param cell<a name="line.1683"></a>
-<span class="sourceLineNo">1684</span>   * @param ts buffer containing the timestamp value<a name="line.1684"></a>
-<span class="sourceLineNo">1685</span>   * @param tsOffset offset to the new timestamp<a name="line.1685"></a>
-<span class="sourceLineNo">1686</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1686"></a>
-<span class="sourceLineNo">1687</span>   */<a name="line.1687"></a>
-<span class="sourceLineNo">1688</span>  public static void setTimestamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1688"></a>
-<span class="sourceLineNo">1689</span>    if (cell instanceof SettableTimestamp) {<a name="line.1689"></a>
-<span class="sourceLineNo">1690</span>      ((SettableTimestamp) cell).setTimestamp(ts, tsOffset);<a name="line.1690"></a>
-<span class="sourceLineNo">1691</span>    } else {<a name="line.1691"></a>
-<span class="sourceLineNo">1692</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1692"></a>
-<span class="sourceLineNo">1693</span>          + SettableTimestamp.class.getName()));<a name="line.1693"></a>
-<span class="sourceLineNo">1694</span>    }<a name="line.1694"></a>
-<span class="sourceLineNo">1695</span>  }<a name="line.1695"></a>
-<span class="sourceLineNo">1696</span><a name="line.1696"></a>
-<span class="sourceLineNo">1697</span>  /**<a name="line.1697"></a>
-<span class="sourceLineNo">1698</span>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1698"></a>
-<span class="sourceLineNo">1699</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1699"></a>
-<span class="sourceLineNo">1700</span>   * @param cell<a name="line.1700"></a>
-<span class="sourceLineNo">1701</span>   * @param ts<a name="line.1701"></a>
-<span class="sourceLineNo">1702</span>   * @return True if cell timestamp is modified.<a name="line.1702"></a>
-<span class="sourceLineNo">1703</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1703"></a>
-<span class="sourceLineNo">1704</span>   */<a name="line.1704"></a>
-<span class="sourceLineNo">1705</span>  public static boolean updateLatestStamp(Cell cell, long ts) throws IOException {<a name="line.1705"></a>
-<span class="sourceLineNo">1706</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1706"></a>
-<span class="sourceLineNo">1707</span>      setTimestamp(cell, ts);<a name="line.1707"></a>
-<span class="sourceLineNo">1708</span>      return true;<a name="line.1708"></a>
-<span class="sourceLineNo">1709</span>    }<a name="line.1709"></a>
-<span class="sourceLineNo">1710</span>    return false;<a name="line.1710"></a>
-<span class="sourceLineNo">1711</span>  }<a name="line.1711"></a>
-<span class="sourceLineNo">1712</span><a name="line.1712"></a>
-<span class="sourceLineNo">1713</span>  /**<a name="line.1713"></a>
-<span class="sourceLineNo">1714</span>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1714"></a>
-<span class="sourceLineNo">1715</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1715"></a>
-<span class="sourceLineNo">1716</span>   * @param cell<a name="line.1716"></a>
-<span class="sourceLineNo">1717</span>   * @param ts buffer containing the timestamp value<a name="line.1717"></a>
-<span class="sourceLineNo">1718</span>   * @param tsOffset offset to the new timestamp<a name="line.1718"></a>
-<span class="sourceLineNo">1719</span>   * @return True if cell timestamp is modified.<a name="line.1719"></a>
-<span class="sourceLineNo">1720</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1720"></a>
-<span class="sourceLineNo">1721</span>   */<a name="line.1721"></a>
-<span class="sourceLineNo">1722</span>  public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1722"></a>
-<span class="sourceLineNo">1723</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1723"></a>
-<span class="sourceLineNo">1724</span>      setTimestamp(cell, ts, tsOffset);<a name="line.1724"></a>
-<span class="sourceLineNo">1725</span>      return true;<a name="line.1725"></a>
-<span class="sourceLineNo">1726</span>    }<a name="line.1726"></a>
-<span class="sourceLineNo">1727</span>    return false;<a name="line.1727"></a>
-<span class="sourceLineNo">1728</span>  }<a name="line.1728"></a>
-<span class="sourceLineNo">1729</span><a name="line.1729"></a>
-<span class="sourceLineNo">1730</span>  /**<a name="line.1730"></a>
-<span class="sourceLineNo">1731</span>   * Writes the Cell's key part as it would have serialized in a KeyValue. The format is &amp;lt;2 bytes<a name="line.1731"></a>
-<span class="sourceLineNo">1732</span>   * rk len&amp;gt;&amp;lt;rk&amp;gt;&amp;lt;1 byte cf len&amp;gt;&amp;lt;cf&amp;gt;&amp;lt;qualifier&amp;gt;&amp;lt;8 bytes<a name="line.1732"></a>
-<span class="sourceLineNo">1733</span>   * timestamp&amp;gt;&amp;lt;1 byte type&amp;gt;<a name="line.1733"></a>
-<span class="sourceLineNo">1734</span>   * @param cell<a name="line.1734"></a>
-<span class="sourceLineNo">1735</span>   * @param out<a name="line.1735"></a>
-<span class="sourceLineNo">1736</span>   * @throws IOException<a name="line.1736"></a>
-<span class="sourceLineNo">1737</span>   */<a name="line.1737"></a>
-<span class="sourceLineNo">1738</span>  public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException {<a name="line.1738"></a>
-<span class="sourceLineNo">1739</span>    short rowLen = cell.getRowLength();<a name="line.1739"></a>
-<span class="sourceLineNo">1740</span>    byte fLen = cell.getFamilyLength();<a name="line.1740"></a>
-<span class="sourceLineNo">1741</span>    int qLen = cell.getQualifierLength();<a name="line.1741"></a>
-<span class="sourceLineNo">1742</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1742"></a>
-<span class="sourceLineNo">1743</span>    // component of cell<a name="line.1743"></a>
-<span class="sourceLineNo">1744</span>    if (cell instanceof ByteBufferCell) {<a name="line.1744"></a>
-<span class="sourceLineNo">1745</span>      out.writeShort(rowLen);<a name="line.1745"></a>
-<span class="sourceLineNo">1746</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1746"></a>
-<span class="sourceLineNo">1747</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1747"></a>
-<span class="sourceLineNo">1748</span>      out.writeByte(fLen);<a name="line.1748"></a>
-<span class="sourceLineNo">1749</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1749"></a>
-<span class="sourceLineNo">1750</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1750"></a>
-<span class="sourceLineNo">1751</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1751"></a>
-<span class="sourceLineNo">1752</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1752"></a>
-<span class="sourceLineNo">1753</span>    } else {<a name="line.1753"></a>
-<span class="sourceLineNo">1754</span>      out.writeShort(rowLen);<a name="line.1754"></a>
-<span class="sourceLineNo">1755</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1755"></a>
-<span class="sourceLineNo">1756</span>      out.writeByte(fLen);<a name="line.1756"></a>
-<span class="sourceLineNo">1757</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1757"></a>
-<span class="sourceLineNo">1758</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>    }<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span>    out.writeLong(cell.getTimestamp());<a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>    out.writeByte(cell.getTypeByte());<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span>  }<a name="line.1762"></a>
-<span class="sourceLineNo">1763</span><a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>  public static int writeFlatKey(Cell cell, OutputStream out) throws IOException {<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>    short rowLen = cell.getRowLength();<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span>    byte fLen = cell.getFamilyLength();<a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>    int qLen = cell.getQualifierLength();<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>    // component of cell<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>    if (cell instanceof ByteBufferCell) {<a name="line.1770"></a>
-<span class="sourceLineNo">1771</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1771"></a>
-<span class="sourceLineNo">1772</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1772"></a>
-<span class="sourceLineNo">1773</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1773"></a>
-<span class="sourceLineNo">1774</span>      out.write(fLen);<a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1775"></a>
-<span class="sourceLineNo">1776</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1776"></a>
-<span class="sourceLineNo">1777</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1777"></a>
-<span class="sourceLineNo">1778</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1778"></a>
-<span class="sourceLineNo">1779</span>    } else {<a name="line.1779"></a>
-<span class="sourceLineNo">1780</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1780"></a>
-<span class="sourceLineNo">1781</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>      out.write(fLen);<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>    }<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span>    StreamUtils.writeLong(out, cell.getTimestamp());<a name="line.1786"></a>
-<span class="sourceLineNo">1787</span>    out.write(cell.getTypeByte());<a name="line.1787"></a>
-<span class="sourceLineNo">1788</span>    return Bytes.SIZEOF_SHORT + rowLen + Bytes.SIZEOF_BYTE + fLen + qLen + Bytes.SIZEOF_LONG<a name="line.1788"></a>
-<span class="sourceLineNo">1789</span>        + Bytes.SIZEOF_BYTE;<a name="line.1789"></a>
-<span class="sourceLineNo">1790</span>  }<a name="line.1790"></a>
-<span class="sourceLineNo">1791</span><a name="line.1791"></a>
-<span class="sourceLineNo">1792</span>  /**<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>   * Writes the row from the given cell to the output stream<a name="line.1793"></a>
-<span class="sourceLineNo">1794</span>   * @param out The outputstream to which the data has to be written<a name="line.1794"></a>
-<span class="sourceLineNo">1795</span>   * @param cell The cell whose contents has to be written<a name="line.1795"></a>
-<span class="sourceLineNo">1796</span>   * @param rlength the row length<a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>   * @throws IOException<a name="line.1797"></a>
-<span class="sourceLineNo">1798</span>   */<a name="line.1798"></a>
-<span class="sourceLineNo">1799</span>  public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span>    if (cell instanceof ByteBufferCell) {<a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>        ((ByteBufferCell) cell).getRowPosition(), rlength);<a name="line.1802"></a>
-<span class="sourceLineNo">1803</span>    } else {<a name="line.1803"></a>
-<span class="sourceLineNo">1804</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rlength);<a name="line.1804"></a>
-<span class="sourceLineNo">1805</span>    }<a name="line.1805"></a>
-<span class="sourceLineNo">1806</span>  }<a name="line.1806"></a>
-<span class="sourceLineNo">1807</span><a name="line.1807"></a>
-<span class="sourceLineNo">1808</span>  /**<a name="line.1808"></a>
-<span class="sourceLineNo">1809</span>   * Writes the row from the given cell to the output stream excluding the common prefix<a name="line.1809"></a>
-<span class="sourceLineNo">1810</span>   * @param out The dataoutputstream to which the data has to be written<a name="line.1810"></a>
-<span class="sourceLineNo">1811</span>   * @param cell The cell whose contents has to be written<a name="line.1811"></a>
-<span class="sourceLineNo">1812</span>   * @param rlength the row length<a name="line.1812"></a>
-<span class="sourceLineNo">1813</span>   * @throws IOException<a name="line.1813"></a>
-<span class="sourceLineNo">1814</span>   */<a name="line.1814"></a>
-<span class="sourceLineNo">1815</span>  public static void writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength,<a name="line.1815"></a>
-<span class="sourceLineNo">1816</span>      int commonPrefix) throws IOException {<a name="line.1816"></a>
-<span class="sourceLineNo">1817</span>    if (cell instanceof ByteBufferCell) {<a name="line.1817"></a>
-<span class="sourceLineNo">1818</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1818"></a>
-<span class="sourceLineNo">1819</span>        ((ByteBufferCell) cell).getRowPosition() + commonPrefix, rlength - commonPrefix);<a name="line.1819"></a>
-<span class="sourceLineNo">1820</span>    } else {<a name="line.1820"></a>
-<span class="sourceLineNo">1821</span>      out.write(cell.getRowArray(), cell.getRowOffset() + commonPrefix, rlength - commonPrefix);<a name="line.1821"></a>
-<span class="sourceLineNo">1822</span>    }<a name="line.1822"></a>
-<span class="sourceLineNo">1823</span>  }<a name="line.1823"></a>
-<span class="sourceLineNo">1824</span><a name="line.1824"></a>
-<span class="sourceLineNo">1825</span>  /**<a name="line.1825"></a>
-<span class="sourceLineNo">1826</span>   * Writes the family from the given cell to the output stream<a name="line.1826"></a>
-<span class="sourceLineNo">1827</span>   * @param out The outputstream to which the data has to be written<a name="line.1827"></a>
-<span class="sourceLineNo">1828</span>   * @param cell The cell whose contents has to be written<a name="line.1828"></a>
-<span class="sourceLineNo">1829</span>   * @param flength the family length<a name="line.1829"></a>
-<span class="sourceLineNo">1830</span>   * @throws IOException<a name="line.1830"></a>
-<span class="sourceLineNo">1831</span>   */<a name="line.1831"></a>
-<span class="sourceLineNo">1832</span>  public static void writeFamily(OutputStream out, Cell cell, byte flength) throws IOException {<a name="line.1832"></a>
-<span class="sourceLineNo">1833</span>    if (cell instanceof ByteBufferCell) {<a name="line.1833"></a>
-<span class="sourceLineNo">1834</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1834"></a>
-<span class="sourceLineNo">1835</span>        ((ByteBufferCell) cell).getFamilyPosition(), flength);<a name="line.1835"></a>
-<span class="sourceLineNo">1836</span>    } else {<a name="line.1836"></a>
-<span class="sourceLineNo">1837</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), flength);<a name="line.1837"></a>
-<span class="sourceLineNo">1838</span>    }<a name="line.1838"></a>
-<span class="sourceLineNo">1839</span>  }<a name="line.1839"></a>
-<span class="sourceLineNo">1840</span><a name="line.1840"></a>
-<span class="sourceLineNo">1841</span>  /**<a name="line.1841"></a>
-<span class="sourceLineNo">1842</span>   * Writes the qualifier from the given cell to the output stream<a name="line.1842"></a>
-<span class="sourceLineNo">1843</span>   * @param out The outputstream to which the data has to be written<a name="line.1843"></a>
-<span class="sourceLineNo">1844</span>   * @param cell The cell whose contents has to be written<a name="line.1844"></a>
-<span class="sourceLineNo">1845</span>   * @param qlength the qualifier length<a name="line.1845"></a>
-<span class="sourceLineNo">1846</span>   * @throws IOException<a name="line.1846"></a>
-<span class="sourceLineNo">1847</span>   */<a name="line.1847"></a>
-<span class="sourceLineNo">1848</span>  public static void writeQualifier(OutputStream out, Cell cell, int qlength)<a name="line.1848"></a>
-<span class="sourceLineNo">1849</span>      throws IOException {<a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>    if (cell instanceof ByteBufferCell) {<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span>        ((ByteBufferCell) cell).getQualifierPosition(), qlength);<a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>    } else {<a name="line.1853"></a>
-<span class="sourceLineNo">1854</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qlength);<a name="line.1854"></a>
-<span class="sourceLineNo">1855</span>    }<a name="line.1855"></a>
-<span class="sourceLineNo">1856</span>  }<a name="line.1856"></a>
-<span class="sourceLineNo">1857</span><a name="line.1857"></a>
-<span class="sourceLineNo">1858</span>  /**<a name="line.1858"></a>
-<span class="sourceLineNo">1859</span>   * Writes the qualifier from the given cell to the output stream excluding the common prefix<a name="line.1859"></a>
-<span class="sourceLineNo">1860</span>   * @param out The dataoutputstream to which the data has to be written<a name="line.1860"></a>
-<span class="sourceLineNo">1861</span>   * @param cell The cell whose contents has to be written<a name="line.1861"></a>
-<span class="sourceLineNo">1862</span>   * @param qlength the qualifier length<a name="line.1862"></a>
-<span class="sourceLineNo">1863</span>   * @throws IOException<a name="line.1863"></a>
-<span class="sourceLineNo">1864</span>   */<a name="line.1864"></a>
-<span class="sourceLineNo">1865</span>  public static void writeQualifierSkippingBytes(DataOutputStream out, Cell cell,<a name="line.1865"></a>
-<span class="sourceLineNo">1866</span>      int qlength, int commonPrefix) throws IOException {<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>    if (cell instanceof ByteBufferCell) {<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>        ((ByteBufferCell) cell).getQualifierPosition() + commonPrefix, qlength - commonPrefix);<a name="line.1869"></a>
-<span class="sourceLineNo">1870</span>    } else {<a name="line.1870"></a>
-<span class="sourceLineNo">1871</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset() + commonPrefix,<a name="line.1871"></a>
-<span class="sourceLineNo">1872</span>        qlength - commonPrefix);<a name="line.1872"></a>
-<span class="sourceLineNo">1873</span>    }<a name="line.1873"></a>
-<span class="sourceLineNo">1874</span>  }<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span><a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>  /**<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>   * Writes the value from the given cell to the output stream<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>   * @param out The outputstream to which the data has to be written<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>   * @param cell The cell whose contents has to be written<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>   * @param vlength the value length<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>   * @throws IOException<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>   */<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>  public static void writeValue(OutputStream out, Cell cell, int vlength) throws IOException {<a name="line.1883"></a>
-<span class="sourceLineNo">1884</span>    if (cell instanceof ByteBufferCell) {<a name="line.1884"></a>
-<span class="sourceLineNo">1885</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getValueByteBuffer(),<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span>        ((ByteBufferCell) cell).getValuePosition(), vlength);<a name="line.1886"></a>
-<span class="sourceLineNo">1887</span>    } else {<a name="line.1887"></a>
-<span class="sourceLineNo">1888</span>      out.write(cell.getValueArray(), cell.getValueOffset(), vlength);<a name="line.1888"></a>
-<span class="sourceLineNo">1889</span>    }<a name="line.1889"></a>
-<span class="sourceLineNo">1890</span>  }<a name="line.1890"></a>
-<span class="sourceLineNo">1891</span><a name="line.1891"></a>
-<span class="sourceLineNo">1892</span>  /**<a name="line.1892"></a>
-<span class="sourceLineNo">1893</span>   * Writes the tag from the given cell to the output stream<a name="line.1893"></a>
-<span class="sourceLineNo">1894</span>   * @param out The outputstream to which the data has to be written<a name="line.1894"></a>
-<span class="sourceLineNo">1895</span>   * @param cell The cell whose contents has to be written<a name="line.1895"></a>
-<span class="sourceLineNo">1896</span>   * @param tagsLength the tag length<a name="line.1896"></a>
-<span class="sourceLineNo">1897</span>   * @throws IOException<a name="line.1897"></a>
-<span class="sourceLineNo">1898</span>   */<a name="line.1898"></a>
-<span class="sourceLineNo">1899</span>  public static void writeTags(OutputStream out, Cell cell, int tagsLength) throws IOException {<a name="line.1899"></a>
-<span class="sourceLineNo">1900</span>    if (cell instanceof ByteBufferCell) {<a name="line.1900"></a>
-<span class="sourceLineNo">1901</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1901"></a>
-<span class="sourceLineNo">1902</span>        ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1902"></a>
-<span class="sourceLineNo">1903</span>    } else {<a name="line.1903"></a>
-<span class="sourceLineNo">1904</span>      out.write(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1904"></a>
-<span class="sourceLineNo">1905</span>    }<a name="line.1905"></a>
-<span class="sourceLineNo">1906</span>  }<a name="line.1906"></a>
-<span class="sourceLineNo">1907</span><a name="line.1907"></a>
-<span class="sourceLineNo">1908</span>  /**<a name="line.1908"></a>
-<span class="sourceLineNo">1909</span>   * @param cell<a name="line.1909"></a>
-<span class="sourceLineNo">1910</span>   * @return The Key portion of the passed &lt;code&gt;cell&lt;/code&gt; as a String.<a name="line.1910"></a>
-<span class="sourceLineNo">1911</span>   */<a name="line.1911"></a>
-<span class="sourceLineNo">1912</span>  public static String getCellKeyAsString(Cell cell) {<a name="line.1912"></a>
-<span class="sourceLineNo">1913</span>    StringBuilder sb = new StringBuilder(Bytes.toStringBinary(<a name="line.1913"></a>
-<span class="sourceLineNo">1914</span>      cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));<a name="line.1914"></a>
-<span class="sourceLineNo">1915</span>    sb.append('/');<a name="line.1915"></a>
-<span class="sourceLineNo">1916</span>    sb.append(cell.getFamilyLength() == 0? "":<a name="line.1916"></a>
-<span class="sourceLineNo">1917</span>      Bytes.toStringBinary(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()));<a name="line.1917"></a>
-<span class="sourceLineNo">1918</span>    // KeyValue only added ':' if family is non-null.  Do same.<a name="line.1918"></a>
-<span class="sourceLineNo">1919</span>    if (cell.getFamilyLength() &gt; 0) sb.append(':');<a name="line.1919"></a>
-<span class="sourceLineNo">1920</span>    sb.append(cell.getQualifierLength() == 0? "":<a name="line.1920"></a>
-<span class="sourceLineNo">1921</span>      Bytes.toStringBinary(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.1921"></a>
-<span class="sourceLineNo">1922</span>        cell.getQualifierLength()));<a name="line.1922"></a>
-<span class="sourceLineNo">1923</span>    sb.append('/');<a name="line.1923"></a>
-<span class="sourceLineNo">1924</span>    sb.append(KeyValue.humanReadableTimestamp(cell.getTimestamp()));<a name="line.1924"></a>
-<span class="sourceLineNo">1925</span>    sb.append('/');<a name="line.1925"></a>
-<span class="sourceLineNo">1926</span>    sb.append(Type.codeToType(cell.getTypeByte()));<a name="line.1926"></a>
-<span class="sourceLineNo">1927</span>    if (!(cell instanceof KeyValue.KeyOnlyKeyValue)) {<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>      sb.append("/vlen=");<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span>      sb.append(cell.getValueLength());<a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>    }<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>    sb.append("/seqid=");<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>    sb.append(cell.getSequenceId());<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>    return sb.toString();<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>  }<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span><a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>  /**<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>   * This method exists just to encapsulate how we serialize keys.  To be replaced by a factory<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>   * that we query to figure what the Cell implementation is and then, what serialization engine<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>   * to use and further, how to serialize the key for inclusion in hfile index. TODO.<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>   * @param cell<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>   * @return The key portion of the Cell serialized in the old-school KeyValue way or null if<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>   * passed a null &lt;code&gt;cell&lt;/code&gt;<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span>   */<a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>  public static byte [] getCellKeySerializedAsKeyValueKey(final Cell cell) {<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>    if (cell == null) return null;<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>    byte [] b = new byte[KeyValueUtil.keyLength(cell)];<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span>    KeyValueUtil.appendKeyTo(cell, b, 0);<a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>    return b;<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>  }<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span><a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>  /**<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>   * Write rowkey excluding the common part.<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>   * @param cell<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>   * @param rLen<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span>   * @param commonPrefix<a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>   * @param out<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>   * @throws IOException<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span>   */<a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>  public static void writeRowKeyExcludingCommon(Cell cell, short rLen, int commonPrefix,<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>      DataOutputStream out) throws IOException {<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span>    if (commonPrefix == 0) {<a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>      out.writeShort(rLen);<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>    } else if (commonPrefix == 1) {<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>      out.writeByte((byte) rLen);<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>      commonPrefix--;<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>    } else {<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span>      commonPrefix -= KeyValue.ROW_LENGTH_SIZE;<a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>    }<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>    if (rLen &gt; commonPrefix) {<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span>      writeRowSkippingBytes(out, cell, rLen, commonPrefix);<a name="line.1970"></a>
-<span class="sourceLineNo">1971</span>    }<a name="line.1971"></a>
-<span class="sourceLineNo">1972</span>  }<a name="line.1972"></a>
-<span class="sourceLineNo">1973</span><a name="line.1973"></a>
-<span class="sourceLineNo">1974</span>  /**<a name="line.1974"></a>
-<span class="sourceLineNo">1975</span>   * Find length of common prefix in keys of the cells, considering key as byte[] if serialized in<a name="line.1975"></a>
-<span class="sourceLineNo">1976</span>   * {@link KeyValue}. The key format is &amp;lt;2 bytes rk len&amp;gt;&amp;lt;rk&amp;gt;&amp;lt;1 byte cf<a name="line.1976"></a>
-<span class="sourceLineNo">1977</span>   * len&amp;gt;&amp;lt;cf&amp;gt;&amp;lt;qualifier&amp;gt;&amp;lt;8 bytes timestamp&amp;gt;&amp;lt;1 byte type&amp;gt;<a name="line.1977"></a>
-<span class="sourceLineNo">1978</span>   * @param c1<a name="line.1978"></a>
-<span class="sourceLineNo">1979</span>   *          the cell<a name="line.1979"></a>
-<span class="sourceLineNo">1980</span>   * @param c2<a name="line.1980"></a>
-<span class="sourceLineNo">1981</span>   *          the cell<a name="line.1981"></a>
-<span class="sourceLineNo">1982</span>   * @param bypassFamilyCheck<a name="line.1982"></a>
-<span class="sourceLineNo">1983</span>   *          when true assume the family bytes same in both cells. Pass it as true when dealing<a name="line.1983"></a>
-<span class="sourceLineNo">1984</span>   *          with Cells in same CF so as to avoid some checks<a name="line.1984"></a>
-<span class="sourceLineNo">1985</span>   * @param withTsType<a name="line.1985"></a>
-<span class="sourceLineNo">1986</span>   *          when true check timestamp and type bytes also.<a name="line.1986"></a>
-<span class="sourceLineNo">1987</span>   * @return length of common prefix<a name="line.1987"></a>
-<span class="sourceLineNo">1988</span>   */<a name="line.1988"></a>
-<span class="sourceLineNo">1989</span>  public static int findCommonPrefixInFlatKey(Cell c1, Cell c2, boolean bypassFamilyCheck,<a name="line.1989"></a>
-<span class="sourceLineNo">1990</span>      boolean withTsType) {<a name="line.1990"></a>
-<span class="sourceLineNo">1991</span>    // Compare the 2 bytes in RK length part<a name="line.1991"></a>
-<span class="sourceLineNo">1992</span>    short rLen1 = c1.getRowLength();<a name="line.1992"></a>
-<span class="sourceLineNo">1993</span>    short rLen2 = c2.getRowLength();<a name="line.1993"></a>
-<span class="sourceLineNo">1994</span>    int commonPrefix = KeyValue.ROW_LENGTH_SIZE;<a name="line.1994"></a>
-<span class="sourceLineNo">1995</span>    if (rLen1 != rLen2) {<a name="line.1995"></a>
-<span class="sourceLineNo">1996</span>      // early out when the RK length itself is not matching<a name="line.1996"></a>
-<span class="sourceLineNo">1997</span>      return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE,<a name="line.1997"></a>
-<span class="sourceLineNo">1998</span>          Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE);<a name="line.1998"></a>
-<span class="sourceLineNo">1999</span>    }<a name="line.1999"></a>
-<span class="sourceLineNo">2000</span>    // Compare the RKs<a name="line.2000"></a>
-<span class="sourceLineNo">2001</span>    int rkCommonPrefix = 0;<a name="line.2001"></a>
-<span class="sourceLineNo">2002</span>    if (c1 instanceof ByteBufferCell &amp;&amp; c2 instanceof ByteBufferCell) {<a name="line.2002"></a>
-<span class="sourceLineNo">2003</span>      rkCommonPrefix = ByteBufferUtils.findCommonPrefix(((ByteBufferCell) c1).getRowByteBuffer(),<a name="line.2003"></a>
-<span class="sourceLineNo">2004</span>        ((ByteBufferCell) c1).getRowPosition(), rLen1, ((ByteBufferCell) c2).getRowByteBuffer(),<a name="line.2004"></a>
-<span class="sourceLineNo">2005</span>        ((ByteBufferCell) c2).getRowPosition(), rLen2);<a name="line.2005"></a>
-<span class="sourceLineNo">2006</span>    } else {<a name="line.2006"></a>
-<span class="sourceLineNo">2007</span>      // There cannot be a case where one cell is BBCell and other is KeyValue. This flow comes either<a name="line.2007"></a>
-<span class="sourceLineNo">2008</span>      // in flush or compactions. In flushes both cells are KV and in case of compaction it will be either<a name="line.2008"></a>
-<span class="sourceLineNo">2009</span>      // KV or BBCell<a name="line.2009"></a>
-<span class="sourceLineNo">2010</span>      rkCommonPrefix = ByteBufferUtils.findCommonPrefix(c1.getRowArray(), c1.getRowOffset(),<a name="line.2010"></a>
-<span class="sourceLineNo">2011</span>        rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2);<a name="line.2011"></a>
-<span class="sourceLineNo">2012</span>    }<a name="line.2012"></a>
-<span class="sourceLineNo">2013</span>    commonPrefix += rkCommonPrefix;<a name="line.2013"></a>
-<span class="sourceLineNo">2014</span>    if (rkCommonPrefix != rLen1) {<a name="line.2014"></a>
-<span class="sourceLineNo">2015</span>      // Early out when RK is not fully matching.<a name="line.2015"></a>
-<span class="sourceLineNo">2016</span>      return commonPrefix;<a name="line.2016"></a>
-<span class="sourceLineNo">2017</span>    }<a name="line.2017"></a>
-<span class="sourceLineNo">2018</span>    // Compare 1 byte CF length part<a name="line.2018"></a>
-<span class="sourceLineNo">2019</span>    byte fLen1 = c1.getFamilyLength();<a name="line.2019"></a>
-<span class="sourceLineNo">2020</span>    if (bypassFamilyCheck) {<a name="line.2020"></a>
-<span class="sourceLineNo">2021</span>      // This flag will be true when caller is sure that the family will be same for both the cells<a name="line.2021"></a>
-<span class="sourceLineNo">2022</span>      // Just make commonPrefix to increment by the family part<a name="line.2022"></a>
-<span class="sourceLineNo">2023</span>      commonPrefix += KeyValue.FAMILY_LENGTH_SIZE + fLen1;<a name="line.2023"></a>
-<span class="sourceLineNo">2024</span>    } else {<a name="line.2024"></a>
-<span class="sourceLineNo">2025</span>      byte fLen2 = c2.getFamilyLength();<a name="line.2025"></a>
-<span class="sourceLineNo">2026</span>      if (fLen1 != fLen2) {<a name="line.2026"></a>
-<span class="sourceLineNo">2027</span>        // early out when the CF length itself is not matching<a name="line.2027"></a>
-<span class="sourceLineNo">2028</span>        return commonPrefix;<a name="line.2028"></a>
-<span class="sourceLineNo">2029</span>      }<a name="line.2029"></a>
-<span class="sourceLineNo">2030</span>      // CF lengths are same so there is one more byte common in key part<a name="line.2030"></a>
-<span class="sourceLineNo">2031</span>      commonPrefix += KeyValue.FAMILY_LENGTH_SIZE;<a name="line.2031"></a>
-<span class="sourceLineNo">2032</span>      // Compare the CF names<a name="line.2032"></a>
-<span class="sourceLineNo">2033</span>      int fCommonPrefix;<a name="line.2033"></a>
-<span class="sourceLineNo">2034</span>      if (c1 instanceof ByteBufferCell &amp;&amp; c2 instanceof ByteBufferCell) {<a name="line.2034"></a>
-<span class="sourceLineNo">2035</span>        fCommonPrefix =<a name="line.2035"></a>
-<span class="sourceLineNo">2036</span>            ByteBufferUtils.findCommonPrefix(((ByteBufferCell) c1).getFamilyByteBuffer(),<a name="line.2036"></a>
-<span class="sourceLineNo">2037</span>              ((ByteBufferCell) c1).getFamilyPosition(), fLen1,<a name="line.2037"></a>
-<span class="sourceLineNo">2038</span>              ((ByteBufferCell) c2).getFamilyByteBuffer(),<a name="line.2038"></a>
-<span class="sourceLineNo">2039</span>              ((ByteBufferCell) c2).getFamilyPosition(), fLen2);<a name="line.2039"></a>
-<span class="sourceLineNo">2040</span>      } else {<a name="line.2040"></a>
-<span class="sourceLineNo">2041</span>        fCommonPrefix = ByteBufferUtils.findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(),<a name="line.2041"></a>
-<span class="sourceLineNo">2042</span>          fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2);<a name="line.2042"></a>
-<span class="sourceLineNo">2043</span>      }<a name="line.2043"></a>
-<span class="sourceLineNo">2044</span>      commonPrefix += fCommonPrefix;<a name="line.2044"></a>
-<span class="sourceLineNo">2045</span>      if (fCommonPrefix != fLen1) {<a name="line.2045"></a>
-<span class="sourceLineNo">2046</span>        return commonPrefix;<a name="line.2046"></a>
-<span class="sourceLineNo">2047</span>      }<a name="line.2047"></a>
-<span class="sourceLineNo">2048</span>    }<a name="line.2048"></a>
-<span class="sourceLineNo">2049</span>    // Compare the Qualifiers<a name="line.2049"></a>
-<span class="sourceLineNo">2050</span>    int qLen1 = c1.getQualifierLength();<a name="line.2050"></a>
-<span class="sourceLineNo">2051</span>    int qLen2 = c2.getQualifierLength();<a name="line.2051"></a>
-<span class="sourceLineNo">2052</span>    int qCommon;<a name="line.2052"></a>
-<span class="sourceLineNo">2053</span>    if (c1 instanceof ByteBufferCell &amp;&amp; c2 instanceof ByteBufferCell) {<a name="line.2053"></a>
-<span class="sourceLineNo">2054</span>      qCommon = ByteBufferUtils.findCommonPrefix(((ByteBufferCell) c1).getQualifierByteBuffer(),<a name="line.2054"></a>
-<span class="sourceLineNo">2055</span>        ((ByteBufferCell) c1).getQualifierPosition(), qLen1,<a name="line.2055"></a>
-<span class="sourceLineNo">2056</span>        ((ByteBufferCell) c2).getQualifierByteBuffer(),<a name="line.2056"></a>
-<span class="sourceLineNo">2057</span>        ((ByteBufferCell) c2).getQualifierPosition(), qLen2);<a name="line.2057"></a>
-<span class="sourceLineNo">2058</span>    } else {<a name="line.2058"></a>
-<span class="sourceLineNo">2059</span>      qCommon = ByteBufferUtils.findCommonPrefix(c1.getQualifierArray(), c1.getQualifierOffset(),<a name="line.2059"></a>
-<span class="sourceLineNo">2060</span>        qLen1, c2.getQualifierArray(), c2.getQualifierOffset(), qLen2);<a name="line.2060"></a>
-<span class="sourceLineNo">2061</span>    }<a name="line.2061"></a>
-<span class="sourceLineNo">2062</span>    commonPrefix += qCommon;<a name="line.2062"></a>
-<span class="sourceLineNo">2063</span>    if (!withTsType || Math.max(qLen1, qLen2) != qCommon) {<a name="line.2063"></a>
-<span class="sourceLineNo">2064</span>      return commonPrefix;<a name="line.2064"></a>
+<span class="sourceLineNo">1574</span>   * @param cell The Cell<a name="line.1574"></a>
+<span class="sourceLineNo">1575</span>   * @return Tags in the given Cell as a List<a name="line.1575"></a>
+<span class="sourceLineNo">1576</span>   */<a name="line.1576"></a>
+<span class="sourceLineNo">1577</span>  public static List&lt;Tag&gt; getTags(Cell cell) {<a name="line.1577"></a>
+<span class="sourceLineNo">1578</span>    List&lt;Tag&gt; tags = new ArrayList&lt;&gt;();<a name="line.1578"></a>
+<span class="sourceLineNo">1579</span>    Iterator&lt;Tag&gt; tagsItr = tagsIterator(cell);<a name="line.1579"></a>
+<span class="sourceLineNo">1580</span>    while (tagsItr.hasNext()) {<a name="line.1580"></a>
+<span class="sourceLineNo">1581</span>      tags.add(tagsItr.next());<a name="line.1581"></a>
+<span class="sourceLineNo">1582</span>    }<a name="line.1582"></a>
+<span class="sourceLineNo">1583</span>    return tags;<a name="line.1583"></a>
+<span class="sourceLineNo">1584</span>  }<a name="line.1584"></a>
+<span class="sourceLineNo">1585</span><a name="line.1585"></a>
+<span class="sourceLineNo">1586</span>  /**<a name="line.1586"></a>
+<span class="sourceLineNo">1587</span>   * Retrieve Cell's first tag, matching the passed in type<a name="line.1587"></a>
+<span class="sourceLineNo">1588</span>   *<a name="line.1588"></a>
+<span class="sourceLineNo">1589</span>   * @param cell The Cell<a name="line.1589"></a>
+<span class="sourceLineNo">1590</span>   * @param type Type of the Tag to retrieve<a name="line.1590"></a>
+<span class="sourceLineNo">1591</span>   * @return null if there is no tag of the passed in tag type<a name="line.1591"></a>
+<span class="sourceLineNo">1592</span>   */<a name="line.1592"></a>
+<span class="sourceLineNo">1593</span>  public static Tag getTag(Cell cell, byte type){<a name="line.1593"></a>
+<span class="sourceLineNo">1594</span>    boolean bufferBacked = cell instanceof ByteBufferCell;<a name="line.1594"></a>
+<span class="sourceLineNo">1595</span>    int length = cell.getTagsLength();<a name="line.1595"></a>
+<span class="sourceLineNo">1596</span>    int offset = bufferBacked? ((ByteBufferCell)cell).getTagsPosition():cell.getTagsOffset();<a name="line.1596"></a>
+<span class="sourceLineNo">1597</span>    int pos = offset;<a name="line.1597"></a>
+<span class="sourceLineNo">1598</span>    while (pos &lt; offset + length) {<a name="line.1598"></a>
+<span class="sourceLineNo">1599</span>      int tagLen;<a name="line.1599"></a>
+<span class="sourceLineNo">1600</span>      if (bufferBacked) {<a name="line.1600"></a>
+<span class="sourceLineNo">1601</span>        ByteBuffer tagsBuffer = ((ByteBufferCell)cell).getTagsByteBuffer();<a name="line.1601"></a>
+<span class="sourceLineNo">1602</span>        tagLen = ByteBufferUtils.readAsInt(tagsBuffer, pos, TAG_LENGTH_SIZE);<a name="line.1602"></a>
+<span class="sourceLineNo">1603</span>        if (ByteBufferUtils.toByte(tagsBuffer, pos + TAG_LENGTH_SIZE) == type) {<a name="line.1603"></a>
+<span class="sourceLineNo">1604</span>          return new ByteBufferTag(tagsBuffer, pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1604"></a>
+<span class="sourceLineNo">1605</span>        }<a name="line.1605"></a>
+<span class="sourceLineNo">1606</span>      } else {<a name="line.1606"></a>
+<span class="sourceLineNo">1607</span>        tagLen = Bytes.readAsInt(cell.getTagsArray(), pos, TAG_LENGTH_SIZE);<a name="line.1607"></a>
+<span class="sourceLineNo">1608</span>        if (cell.getTagsArray()[pos + TAG_LENGTH_SIZE] == type) {<a name="line.1608"></a>
+<span class="sourceLineNo">1609</span>          return new ArrayBackedTag(cell.getTagsArray(), pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1609"></a>
+<span class="sourceLineNo">1610</span>        }<a name="line.1610"></a>
+<span class="sourceLineNo">1611</span>      }<a name="line.1611"></a>
+<span class="sourceLineNo">1612</span>      pos += TAG_LENGTH_SIZE + tagLen;<a name="line.1612"></a>
+<span class="sourceLineNo">1613</span>    }<a name="line.1613"></a>
+<span class="sourceLineNo">1614</span>    return null;<a name="line.1614"></a>
+<span class="sourceLineNo">1615</span>  }<a name="line.1615"></a>
+<span class="sourceLineNo">1616</span><a name="line.1616"></a>
+<span class="sourceLineNo">1617</span>  /**<a name="line.1617"></a>
+<span class="sourceLineNo">1618</span>   * Returns true if the first range start1...end1 overlaps with the second range<a name="line.1618"></a>
+<span class="sourceLineNo">1619</span>   * start2...end2, assuming the byte arrays represent row keys<a name="line.1619"></a>
+<span class="sourceLineNo">1620</span>   */<a name="line.1620"></a>
+<span class="sourceLineNo">1621</span>  public static boolean overlappingKeys(final byte[] start1, final byte[] end1,<a name="line.1621"></a>
+<span class="sourceLineNo">1622</span>      final byte[] start2, final byte[] end2) {<a name="line.1622"></a>
+<span class="sourceLineNo">1623</span>    return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1,<a name="line.1623"></a>
+<span class="sourceLineNo">1624</span>        end2) &lt; 0)<a name="line.1624"></a>
+<span class="sourceLineNo">1625</span>        &amp;&amp; (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2,<a name="line.1625"></a>
+<span class="sourceLineNo">1626</span>            end1) &lt; 0);<a name="line.1626"></a>
+<span class="sourceLineNo">1627</span>  }<a name="line.1627"></a>
+<span class="sourceLineNo">1628</span><a name="line.1628"></a>
+<span class="sourceLineNo">1629</span>  /**<a name="line.1629"></a>
+<span class="sourceLineNo">1630</span>   * Sets the given seqId to the cell.<a name="line.1630"></a>
+<span class="sourceLineNo">1631</span>   * Marked as audience Private as of 1.2.0.<a name="line.1631"></a>
+<span class="sourceLineNo">1632</span>   * Setting a Cell sequenceid is an internal implementation detail not for general public use.<a name="line.1632"></a>
+<span class="sourceLineNo">1633</span>   * @param cell<a name="line.1633"></a>
+<span class="sourceLineNo">1634</span>   * @param seqId<a name="line.1634"></a>
+<span class="sourceLineNo">1635</span>   * @throws IOException when the passed cell is not of type {@link SettableSequenceId}<a name="line.1635"></a>
+<span class="sourceLineNo">1636</span>   */<a name="line.1636"></a>
+<span class="sourceLineNo">1637</span>  @InterfaceAudience.Private<a name="line.1637"></a>
+<span class="sourceLineNo">1638</span>  public static void setSequenceId(Cell cell, long seqId) throws IOException {<a name="line.1638"></a>
+<span class="sourceLineNo">1639</span>    if (cell instanceof SettableSequenceId) {<a name="line.1639"></a>
+<span class="sourceLineNo">1640</span>      ((SettableSequenceId) cell).setSequenceId(seqId);<a name="line.1640"></a>
+<span class="sourceLineNo">1641</span>    } else {<a name="line.1641"></a>
+<span class="sourceLineNo">1642</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1642"></a>
+<span class="sourceLineNo">1643</span>          + SettableSequenceId.class.getName()));<a name="line.1643"></a>
+<span class="sourceLineNo">1644</span>    }<a name="line.1644"></a>
+<span class="sourceLineNo">1645</span>  }<a name="line.1645"></a>
+<span class="sourceLineNo">1646</span><a name="line.1646"></a>
+<span class="sourceLineNo">1647</span>  /**<a name="line.1647"></a>
+<span class="sourceLineNo">1648</span>   * Sets the given timestamp to the cell.<a name="line.1648"></a>
+<span class="sourceLineNo">1649</span>   * @param cell<a name="line.1649"></a>
+<span class="sourceLineNo">1650</span>   * @param ts<a name="line.1650"></a>
+<span class="sourceLineNo">1651</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1651"></a>
+<span class="sourceLineNo">1652</span>   */<a name="line.1652"></a>
+<span class="sourceLineNo">1653</span>  public static void setTimestamp(Cell cell, long ts) throws IOException {<a name="line.1653"></a>
+<span class="sourceLineNo">1654</span>    if (cell instanceof SettableTimestamp) {<a name="line.1654"></a>
+<span class="sourceLineNo">1655</span>      ((SettableTimestamp) cell).setTimestamp(ts);<a name="line.1655"></a>
+<span class="sourceLineNo">1656</span>    } else {<a name="line.1656"></a>
+<span class="sourceLineNo">1657</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1657"></a>
+<span class="sourceLineNo">1658</span>          + SettableTimestamp.class.getName()));<a name="line.1658"></a>
+<span class="sourceLineNo">1659</span>    }<a name="line.1659"></a>
+<span class="sourceLineNo">1660</span>  }<a name="line.1660"></a>
+<span class="sourceLineNo">1661</span><a name="line.1661"></a>
+<span class="sourceLineNo">1662</span>  /**<a name="line.1662"></a>
+<span class="sourceLineNo">1663</span>   * Sets the given timestamp to the cell.<a name="line.1663"></a>
+<span class="sourceLineNo">1664</span>   * @param cell<a name="line.1664"></a>
+<span class="sourceLineNo">1665</span>   * @param ts buffer containing the timestamp value<a name="line.1665"></a>
+<span class="sourceLineNo">1666</span>   * @param tsOffset offset to the new timestamp<a name="line.1666"></a>
+<span class="sourceLineNo">1667</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1667"></a>
+<span class="sourceLineNo">1668</span>   */<a name="line.1668"></a>
+<span class="sourceLineNo">1669</span>  public static void setTimestamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1669"></a>
+<span class="sourceLineNo">1670</span>    if (cell instanceof SettableTimestamp) {<a name="line.1670"></a>
+<span class="sourceLineNo">1671</span>      ((SettableTimestamp) cell).setTimestamp(ts, tsOffset);<a name="line.1671"></a>
+<span class="sourceLineNo">1672</span>    } else {<a name="line.1672"></a>
+<span class="sourceLineNo">1673</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1673"></a>
+<span class="sourceLineNo">1674</span>          + SettableTimestamp.class.getName()));<a name="line.1674"></a>
+<span class="sourceLineNo">1675</span>    }<a name="line.1675"></a>
+<span class="sourceLineNo">1676</span>  }<a name="line.1676"></a>
+<span class="sourceLineNo">1677</span><a name="line.1677"></a>
+<span class="sourceLineNo">1678</span>  /**<a name="line.1678"></a>
+<span class="sourceLineNo">1679</span>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1679"></a>
+<span class="sourceLineNo">1680</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1680"></a>
+<span class="sourceLineNo">1681</span>   * @param cell<a name="line.1681"></a>
+<span class="sourceLineNo">1682</span>   * @param ts<a name="line.1682"></a>
+<span class="sourceLineNo">1683</span>   * @return True if cell timestamp is modified.<a name="line.1683"></a>
+<span class="sourceLineNo">1684</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1684"></a>
+<span class="sourceLineNo">1685</span>   */<a name="line.1685"></a>
+<span class="sourceLineNo">1686</span>  public static boolean updateLatestStamp(Cell cell, long ts) throws IOException {<a name="line.1686"></a>
+<span class="sourceLineNo">1687</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1687"></a>
+<span class="sourceLineNo">1688</span>      setTimestamp(cell, ts);<a name="line.1688"></a>
+<span class="sourceLineNo">1689</span>      return true;<a name="line.1689"></a>
+<span class="sourceLineNo">1690</span>    }<a name="line.1690"></a>
+<span class="sourceLineNo">1691</span>    return false;<a name="line.1691"></a>
+<span class="sourceLineNo">1692</span>  }<a name="line.1692"></a>
+<span class="sourceLineNo">1693</span><a name="line.1693"></a>
+<span class="sourceLineNo">1694</span>  /**<a name="line.1694"></a>
+<span class="sourceLineNo">1695</span>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1695"></a>
+<span class="sourceLineNo">1696</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1696"></a>
+<span class="sourceLineNo">1697</span>   * @param cell<a name="line.1697"></a>
+<span class="sourceLineNo">1698</span>   * @param ts buffer containing the timestamp value<a name="line.1698"></a>
+<span class="sourceLineNo">1699</span>   * @param tsOffset offset to the new timestamp<a name="line.1699"></a>
+<span class="sourceLineNo">1700</span>   * @return True if cell timestamp is modified.<a name="line.1700"></a>
+<span class="sourceLineNo">1701</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1701"></a>
+<span class="sourceLineNo">1702</span>   */<a name="line.1702"></a>
+<span class="sourceLineNo">1703</span>  public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1703"></a>
+<span class="sourceLineNo">1704</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1704"></a>
+<span class="sourceLineNo">1705</span>      setTimestamp(cell, ts, tsOffset);<a name="line.1705"></a>
+<span class="sourceLineNo">1706</span>      return true;<a name="line.1706"></a>
+<span class="sourceLineNo">1707</span>    }<a name="line.1707"></a>
+<span class="sourceLineNo">1708</span>    return false;<a name="line.1708"></a>
+<span class="sourceLineNo">1709</span>  }<a name="line.1709"></a>
+<span class="sourceLineNo">1710</span><a name="line.1710"></a>
+<span class="sourceLineNo">1711</span>  /**<a name="line.1711"></a>
+<span class="sourceLineNo">1712</span>   * Writes the Cell's key part as it would have serialized in a KeyValue. The format is &amp;lt;2 bytes<a name="line.1712"></a>
+<span class="sourceLineNo">1713</span>   * rk len&amp;gt;&amp;lt;rk&amp;gt;&amp;lt;1 byte cf len&amp;gt;&amp;lt;cf&amp;gt;&amp;lt;qualifier&amp;gt;&amp;lt;8 bytes<a name="line.1713"></a>
+<span class="sourceLineNo">1714</span>   * timestamp&amp;gt;&amp;lt;1 byte type&amp;gt;<a name="line.1714"></a>
+<span class="sourceLineNo">1715</span>   * @param cell<a name="line.1715"></a>
+<span class="sourceLineNo">1716</span>   * @param out<a name="line.1716"></a>
+<span class="sourceLineNo">1717</span>   * @throws IOException<a name="line.1717"></a>
+<span class="sourceLineNo">1718</span>   */<a name="line.1718"></a>
+<span class="sourceLineNo">1719</span>  public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException {<a name="line.1719"></a>
+<span class="sourceLineNo">1720</span>    short rowLen = cell.getRowLength();<a name="line.1720"></a>
+<span class="sourceLineNo">1721</span>    byte fLen = cell.getFamilyLength();<a name="line.1721"></a>
+<span class="sourceLineNo">1722</span>    int qLen = cell.getQualifierLength();<a name="line.1722"></a>
+<span class="sourceLineNo">1723</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1723"></a>
+<span class="sourceLineNo">1724</span>    // component of cell<a name="line.1724"></a>
+<span class="sourceLineNo">1725</span>    if (cell instanceof ByteBufferCell) {<a name="line.1725"></a>
+<span class="sourceLineNo">1726</span>      out.writeShort(rowLen);<a name="line.1726"></a>
+<span class="sourceLineNo">1727</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1727"></a>
+<span class="sourceLineNo">1728</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1728"></a>
+<span class="sourceLineNo">1729</span>      out.writeByte(fLen);<a name="line.1729"></a>
+<span class="sourceLineNo">1730</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1730"></a>
+<span class="sourceLineNo">1731</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1731"></a>
+<span class="sourceLineNo">1732</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1732"></a>
+<span class="sourceLineNo">1733</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1733"></a>
+<span class="sourceLineNo">1734</span>    } else {<a name="line.1734"></a>
+<span class="sourceLineNo">1735</span>      out.writeShort(rowLen);<a name="line.1735"></a>
+<span class="sourceLineNo">1736</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1736"></a>
+<span class="sourceLineNo">1737</span>      out.writeByte(fLen);<a name="line.1737"></a>
+<span class="sourceLineNo">1738</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1738"></a>
+<span class="sourceLineNo">1739</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1739"></a>
+<span class="sourceLineNo">1740</span>    }<a name="line.1740"></a>
+<span class="sourceLineNo">1741</span>    out.writeLong(cell.getTimestamp());<a name="line.1741"></a>
+<span class="sourceLineNo">1742</span>    out.writeByte(cell.getTypeByte());<a name="line.1742"></a>
+<span class="sourceLineNo">1743</span>  }<a name="line.1743"></a>
+<span class="sourceLineNo">1744</span><a name="line.1744"></a>
+<span class="sourceLineNo">1745</span>  public static int writeFlatKey(Cell cell, OutputStream out) throws IOException {<a name="line.1745"></a>
+<span class="sourceLineNo">1746</span>    short rowLen = cell.getRowLength();<a name="line.1746"></a>
+<span class="sourceLineNo">1747</span>    byte fLen = cell.getFamilyLength();<a name="line.1747"></a>
+<span class="sourceLineNo">1748</span>    int qLen = cell.getQualifierLength();<a name="line.1748"></a>
+<span class="sourceLineNo">1749</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1749"></a>
+<span class="sourceLineNo">1750</span>    // component of cell<a name="line.1750"></a>
+<span class="sourceLineNo">1751</span>    if (cell instanceof ByteBufferCell) {<a name="line.1751"></a>
+<span class="sourceLineNo">1752</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1752"></a>
+<span class="sourceLineNo">1753</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1753"></a>
+<span class="sourceLineNo">1754</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1754"></a>
+<span class="sourceLineNo">1755</span>      out.write(fLen);<a name="line.1755"></a>
+<span class="sourceLineNo">1756</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1756"></a>
+<span class="sourceLineNo">1757</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1757"></a>
+<span class="sourceLineNo">1758</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>    } else {<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1762"></a>
+<span class="sourceLineNo">1763</span>      out.write(fLen);<a name="line.1763"></a>
+<span class="sourceLineNo">1764</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>    }<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>    StreamUtils.writeLong(out, cell.getTimestamp());<a name="line.1767"></a>
+<span class="sourceLineNo">1768</span>    out.write(cell.getTypeByte());<a name="line.1768"></a>
+<span class="sourceLineNo">1769</span>    return Bytes.SIZEOF_SHORT + rowLen + Bytes.SIZEOF_BYTE + fLen + qLen + Bytes.SIZEOF_LONG<a name="line.1769"></a>
+<span class="sourceLineNo">1770</span>        + Bytes.SIZEOF_BYTE;<a name="line.1770"></a>
+<span class="sourceLineNo">1771</span>  }<a name="line.1771"></a>
+<span class="sourceLineNo">1772</span><a name="line.1772"></a>
+<span class="sourceLineNo">1773</span>  /**<a name="line.1773"></a>
+<span class="sourceLineNo">1774</span>   * Writes the row from the given cell to the output stream<a name="line.1774"></a>
+<span class="sourceLineNo">1775</span>   * @param out The outputstream to which the data has to be written<a name="line.1775"></a>
+<span class="sourceLineNo">1776</span>   * @param cell The cell whose contents has to be written<a name="line.1776"></a>
+<span class="sourceLineNo">1777</span>   * @param rlength the row length<a name="line.1777"></a>
+<span class="sourceLineNo">1778</span>   * @throws IOException<a name="line.1778"></a>
+<span class="sourceLineNo">1779</span>   */<a name="line.1779"></a>
+<span class="sourceLineNo">1780</span>  public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {<a name="line.1780"></a>
+<span class="sourceLineNo">1781</span>    if (cell instanceof ByteBufferCell) {<a name="line.1781"></a>
+<span class="sourceLineNo">1782</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1782"></a>
+<span class="sourceLineNo">1783</span>        ((ByteBufferCell) cell).getRowPosition(), rlength);<a name="line.1783"></a>
+<span class="sourceLineNo">1784</span>    } else {<a name="line.1784"></a>
+<span class="sourceLineNo">1785</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rlength);<a name="line.1785"></a>
+<span class="sourceLineNo">1786</span>    }<a name="line.1786"></a>
+<span class="sourceLineNo">1787</span>  }<a name="line.1787"></a>
+<span class="sourceLineNo">1788</span><a name="line.1788"></a>
+<span class="sourceLineNo">1789</span>  /**<a name="line.1789"></a>
+<span class="sourceLineNo">1790</span>   * Writes the row from the given cell to the output stream excluding the common prefix<a name="line.1790"></a>
+<span class="sourceLineNo">1791</span>   * @param out The dataoutputstream to which the data has to be written<a name="line.1791"></a>
+<span class="sourceLineNo">1792</span>   * @param cell The cell whose contents has to be written<a name="line.1792"></a>
+<span class="sourceLineNo">1793</span>   * @param rlength the row length<a name="line.1793"></a>
+<span class="sourceLineNo">1794</span>   * @throws IOException<a name="line.1794"></a>
+<span class="sourceLineNo">1795</span>   */<a name="line.1795"></a>
+<span class="sourceLineNo">1796</span>  public static void writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength,<a name="line.1796"></a>
+<span class="sourceLineNo">1797</span>      int commonPrefix) throws IOException {<a name="line.1797"></a>
+<span class="sourceLineNo">1798</span>    if (cell instanceof ByteBufferCell) {<a name="line.1798"></a>
+<span class="sourceLineNo">1799</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1799"></a>
+<span class="sourceLineNo">1800</span>        ((ByteBufferCell) cell).getRowPosition() + commonPrefix, rlength - commonPrefix);<a name="line.1800"></a>
+<span class="sourceLineNo">1801</span>    } else {<a name="line.1801"></a>
+<span class="sourceLineNo">1802</span>      out.write(cell.getRowArray(), cell.getRowOffset() + commonPrefix, rlength - commonPrefix);<a name="line.1802"></a>
+<span class="sourceLineNo">1803</span>    }<a name="line.1803"></a>
+<span class="sourceLineNo">1804</span>  }<a name="line.1804"></a>
+<span class="sourceLineNo">1805</span><a name="line.1805"></a>
+<span class="sourceLineNo">1806</span>  /**<a name="line.1806"></a>
+<span class="sourceLineNo">1807</span>   * Writes the family from the given cell to the output stream<a name="line.1807"></a>
+<span class="sourceLineNo">1808</span>   * @param out The outputstream to which the data has to be written<a name="line.1808"></a>
+<span class="sourceLineNo">1809</span>   * @param cell The cell whose contents has to be written<a name="line.1809"></a>
+<span class="sourceLineNo">1810</span>   * @param flength the family length<a name="line.1810"></a>
+<span class="sourceLineNo">1811</span>   * @throws IOException<a name="line.1811"></a>
+<span class="sourceLineNo">1812</span>   */<a name="line.1812"></a>
+<span class="sourceLineNo">1813</span>  public static void writeFamily(OutputStream out, Cell cell, byte flength) throws IOException {<a name="line.1813"></a>
+<span class="sourceLineNo">1814</span>    if (cell instanceof ByteBufferCell) {<a name="line.1814"></a>
+<span class="sourceLineNo">1815</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1815"></a>
+<span class="sourceLineNo">1816</span>        ((ByteBufferCell) cell).getFamilyPosition(), flength);<a name="line.1816"></a>
+<span class="sourceLineNo">1817</span>    } else {<a name="line.1817"></a>
+<span class="sourceLineNo">1818</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), flength);<a name="line.1818"></a>
+<span class="sourceLineNo">1819</span>    }<a name="line.1819"></a>
+<span class="sourceLineNo">1820</span>  }<a name="line.1820"></a>
+<span class="sourceLineNo">1821</span><a name="line.1821"></a>
+<span class="sourceLineNo">1822</span>  /**<a name="line.1822"></a>
+<span class="sourceLineNo">1823</span>   * Writes the qualifier from the given cell to the output stream<a name="line.1823"></a>
+<span class="sourceLineNo">1824</span>   * @param out The outputstream to which the data has to be written<a name="line.1824"></a>
+<span class="sourceLineNo">1825</span>   * @param cell The cell whose contents has to be written<a name="line.1825"></a>
+<span class="sourceLineNo">1826</span>   * @param qlength the qualifier length<a name="line.1826"></a>
+<span class="sourceLineNo">1827</span>   * @throws IOException<a name="line.1827"></a>
+<span class="sourceLineNo">1828</span>   */<a name="line.1828"></a>
+<span class="sourceLineNo">1829</span>  public static void writeQualifier(OutputStream out, Cell cell, int qlength)<a name="line.1829"></a>
+<span class="sourceLineNo">1830</span>      throws IOException {<a name="line.1830"></a>
+<span class="sourceLineNo">1831</span>    if (cell instanceof ByteBufferCell) {<a name="line.1831"></a>
+<span class="sourceLineNo">1832</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1832"></a>
+<span class="sourceLineNo">1833</span>        ((ByteBufferCell) cell).getQualifierPosition(), qlength);<a name="line.1833"></a>
+<span class="sourceLineNo">1834</span>    } else {<a name="line.1834"></a>
+<span class="sourceLineNo">1835</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qlength);<a name="line.1835"></a>
+<span class="sourceLineNo">1836</span>    }<a name="line.1836"></a>
+<span class="sourceLineNo">1837</span>  }<a name="line.1837"></a>
+<span class="sourceLineNo">1838</span><a name="line.1838"></a>
+<span class="sourceLineNo">1839</span>  /**<a name="line.1839"></a>
+<span class="sourceLineNo">1840</span>   * Writes the qualifier from the given cell to the output stream excluding the common prefix<a name="line.1840"></a>
+<span class="sourceLineNo">1841</span>   * @param out The dataoutputstream to which the data has to be written<a name="line.1841"></a>
+<span class="sourceLineNo">1842</span>   * @param cell The cell whose contents has to be written<a name="line.1842"></a>
+<span class="sourceLineNo">1843</span>   * @param qlength the qualifier length<a name="line.1843"></a>
+<span class="sourceLineNo">1844</span>   * @throws IOException<a name="line.1844"></a>
+<span class="sourceLineNo">1845</span>   */<a name="line.1845"></a>
+<span class="sourceLineNo">1846</span>  public static void writeQualifierSkippingBytes(DataOutputStream out, Cell cell,<a name="line.1846"></a>
+<span class="sourceLineNo">1847</span>      int qlength, int commonPrefix) throws IOException {<a name="line.1847"></a>
+<span class="sourceLineNo">1848</span>    if (cell instanceof ByteBufferCell) {<a name="line.1848"></a>
+<span class="sourceLineNo">1849</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1849"></a>
+<span class="sourceLineNo">1850</span>        ((ByteBufferCell) cell).getQualifierPosition() + commonPrefix, qlength - commonPrefix);<a name="line.1850"></a>
+<span class="sourceLineNo">1851</span>    } else {<a name="line.1851"></a>
+<span class="sourceLineNo">1852</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset() + commonPrefix,<a name="line.1852"></a>
+<span class="sourceLineNo">1853</span>        qlength - commonPrefix);<a name="line.1853"></a>
+<span class="sourceLineNo">1854</span>    }<a name="line.1854"></a>
+<span class="sourceLineNo">1855</span>  }<a name="line.1855"></a>
+<span class="sourceLineNo">1856</span><a name="line.1856"></a>
+<span class="sourceLineNo">1857</span>  /**<a name="line.1857"></a>
+<span class="sourceLineNo">1858</span>   * Writes the value from the given cell to the output stream<a name="line.1858"></a>
+<span class="sourceLineNo">1859</span>   * @param out The outputstream to which the data has to be written<a name="line.1859"></a>
+<span class="sourceLineNo">1860</span>   * @param cell The cell whose contents has to be written<a name="line.1860"></a>
+<span class="sourceLineNo">1861</span>   * @param vlength the value length<a name="line.1861"></a>
+<span class="sourceLineNo">1862</span>   * @throws IOException<a name="line.1862"></a>
+<span class="sourceLineNo">1863</span>   */<a name="line.1863"></a>
+<span class="sourceLineNo">1864</span>  public static void writeValue(OutputStream out, Cell cell, int vlength) throws IOException {<a name="line.1864"></a>
+<span class="sourceLineNo">1865</span>    if (cell instanceof ByteBufferCell) {<a name="line.1865"></a>
+<span class="sourceLineNo">1866</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getValueByteBuffer(),<a name="line.1866"></a>
+<span class="sourceLineNo">1867</span>        ((ByteBufferCell) cell).getValuePosition(), vlength);<a name="line.1867"></a>
+<span class="sourceLineNo">1868</span>    } else {<a name="line.1868"></a>
+<span class="sourceLineNo">1869</span>      out.write(cell.getValueArray(), cell.getValueOffset(), vlength);<a name="line.1869"></a>
+<span class="sourceLineNo">1870</span>    }<a name="line.1870"></a>
+<span class="sourceLineNo">1871</span>  }<a name="line.1871"></a>
+<span class="sourceLineNo">1872</span><a name="line.1872"></a>
+<span class="sourceLineNo">1873</span>  /**<a name="line.1873"></a>
+<span class="sourceLineNo">1874</span>   * Writes the tag from the given cell to the output stream<a name="line.1874"></a>
+<span class="sourceLineNo">1875</span>   * @param out The outputstream to which the data has to be written<a name="line.1875"></a>
+<span class="sourceLineNo">1876</span>   * @param cell The cell whose contents has to be written<a name="line.1876"></a>
+<span class="sourceLineNo">1877</span>   * @param tagsLength the tag length<a name="line.1877"></a>
+<span class="sourceLineNo">1878</span>   * @throws IOException<a name="line.1878"></a>
+<span class="sourceLineNo">1879</span>   */<a name="line.1879"></a>
+<span class="sourceLineNo">1880</span>  public static void writeTags(OutputStream out, Cell cell, int tagsLength) throws IOException {<a name="line.1880"></a>
+<span class="sourceLineNo">1881</span>    if (cell instanceof ByteBufferCell) {<a name="line.1881"></a>
+<span class="sourceLineNo">1882</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1882"></a>
+<span class="sourceLineNo">1883</span>        ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1883"></a>
+<span class="sourceLineNo">1884</span>    } else {<a name="line.1884"></a>
+<span class="sourceLineNo">1885</span>      out.write(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1885"></a>
+<span class="sourceLineNo">1886</span>    }<a name="line.1886"></a>
+<span class="sourceLineNo">1887</span>  }<a name="line.1887"></a>
+<span class="sourceLineNo">1888</span><a name="line.1888"></a>
+<span class="sourceLineNo">1889</span>  /**<a name="line.1889"></a>
+<span class="sourceLineNo">1890</span>   * @param cell<a name="line.1890"></a>
+<span class="sourceLineNo">1891</span>   * @return The Key portion of the passed &lt;code&gt;cell&lt;/code&gt; as a String.<a name="line.1891"></a>
+<span class="sourceLineNo">1892</span>   */<a name="line.1892"></a>
+<span class="sourceLineNo">1893</span>  public static String getCellKeyAsString(Cell cell) {<a name="line.1893"></a>
+<span class="sourceLineNo">1894</span>    StringBuilder sb = new StringBuilder(Bytes.toStringBinary(<a name="line.1894"></a>
+<span class="sourceLineNo">1895</span>      cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));<a name="line.1895"></a>
+<span class="sourceLineNo">1896</span>    sb.append('/');<a name="line.1896"></a>
+<span class="sourceLineNo">1897</span>    sb.append(cell.getFamilyLength() == 0? "":<a name="line.1897"></a>
+<span class="sourceLineNo">1898</span>      Bytes.toStringBinary(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()));<a name="line.1898"></a>
+<span class="sourceLineNo">1899</span>    // KeyValue only added ':' if fam

<TRUNCATED>

Mime
View raw message