hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [11/17] hbase-site git commit: Published site at 1a701ce44484f45a8a07ea9826b84f0df6f1518e.
Date Fri, 07 Apr 2017 02:31:39 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/918b2059/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowCell.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowCell.html b/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowCell.html
index 10499b9..96b0c12 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowCell.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/CellUtil.FirstOnRowCell.html
@@ -1393,1783 +1393,1781 @@
 <span class="sourceLineNo">1385</span>   * @return Estimate of the &lt;code&gt;cell&lt;/code&gt; size in bytes.<a name="line.1385"></a>
 <span class="sourceLineNo">1386</span>   */<a name="line.1386"></a>
 <span class="sourceLineNo">1387</span>  public static int estimatedSerializedSizeOf(final Cell cell) {<a name="line.1387"></a>
-<span class="sourceLineNo">1388</span>    // If a KeyValue, we can give a good estimate of size.<a name="line.1388"></a>
-<span class="sourceLineNo">1389</span>    if (cell instanceof KeyValue) {<a name="line.1389"></a>
-<span class="sourceLineNo">1390</span>      return ((KeyValue)cell).getLength() + Bytes.SIZEOF_INT;<a name="line.1390"></a>
-<span class="sourceLineNo">1391</span>    }<a name="line.1391"></a>
-<span class="sourceLineNo">1392</span>    // TODO: Should we add to Cell a sizeOf?  Would it help? Does it make sense if Cell is<a name="line.1392"></a>
-<span class="sourceLineNo">1393</span>    // prefix encoded or compressed?<a name="line.1393"></a>
-<span class="sourceLineNo">1394</span>    return getSumOfCellElementLengths(cell) +<a name="line.1394"></a>
-<span class="sourceLineNo">1395</span>      // Use the KeyValue's infrastructure size presuming that another implementation would have<a name="line.1395"></a>
-<span class="sourceLineNo">1396</span>      // same basic cost.<a name="line.1396"></a>
-<span class="sourceLineNo">1397</span>      KeyValue.ROW_LENGTH_SIZE + KeyValue.FAMILY_LENGTH_SIZE +<a name="line.1397"></a>
-<span class="sourceLineNo">1398</span>      // Serialization is probably preceded by a length (it is in the KeyValueCodec at least).<a name="line.1398"></a>
-<span class="sourceLineNo">1399</span>      Bytes.SIZEOF_INT;<a name="line.1399"></a>
-<span class="sourceLineNo">1400</span>  }<a name="line.1400"></a>
-<span class="sourceLineNo">1401</span><a name="line.1401"></a>
-<span class="sourceLineNo">1402</span>  /**<a name="line.1402"></a>
-<span class="sourceLineNo">1403</span>   * @param cell<a name="line.1403"></a>
-<span class="sourceLineNo">1404</span>   * @return Sum of the lengths of all the elements in a Cell; does not count in any infrastructure<a name="line.1404"></a>
-<span class="sourceLineNo">1405</span>   */<a name="line.1405"></a>
-<span class="sourceLineNo">1406</span>  private static int getSumOfCellElementLengths(final Cell cell) {<a name="line.1406"></a>
-<span class="sourceLineNo">1407</span>    return getSumOfCellKeyElementLengths(cell) + cell.getValueLength() + cell.getTagsLength();<a name="line.1407"></a>
-<span class="sourceLineNo">1408</span>  }<a name="line.1408"></a>
-<span class="sourceLineNo">1409</span><a name="line.1409"></a>
-<span class="sourceLineNo">1410</span>  /**<a name="line.1410"></a>
-<span class="sourceLineNo">1411</span>   * @param cell<a name="line.1411"></a>
-<span class="sourceLineNo">1412</span>   * @return Sum of all elements that make up a key; does not include infrastructure, tags or<a name="line.1412"></a>
-<span class="sourceLineNo">1413</span>   * values.<a name="line.1413"></a>
-<span class="sourceLineNo">1414</span>   */<a name="line.1414"></a>
-<span class="sourceLineNo">1415</span>  private static int getSumOfCellKeyElementLengths(final Cell cell) {<a name="line.1415"></a>
-<span class="sourceLineNo">1416</span>    return cell.getRowLength() + cell.getFamilyLength() +<a name="line.1416"></a>
-<span class="sourceLineNo">1417</span>    cell.getQualifierLength() +<a name="line.1417"></a>
-<span class="sourceLineNo">1418</span>    KeyValue.TIMESTAMP_TYPE_SIZE;<a name="line.1418"></a>
-<span class="sourceLineNo">1419</span>  }<a name="line.1419"></a>
-<span class="sourceLineNo">1420</span><a name="line.1420"></a>
-<span class="sourceLineNo">1421</span>  /**<a name="line.1421"></a>
-<span class="sourceLineNo">1422</span>   * Calculates the serialized key size. We always serialize in the KeyValue's serialization<a name="line.1422"></a>
-<span class="sourceLineNo">1423</span>   * format.<a name="line.1423"></a>
-<span class="sourceLineNo">1424</span>   * @param cell the cell for which the key size has to be calculated.<a name="line.1424"></a>
-<span class="sourceLineNo">1425</span>   * @return the key size<a name="line.1425"></a>
-<span class="sourceLineNo">1426</span>   */<a name="line.1426"></a>
-<span class="sourceLineNo">1427</span>  public static int estimatedSerializedSizeOfKey(final Cell cell) {<a name="line.1427"></a>
-<span class="sourceLineNo">1428</span>    if (cell instanceof KeyValue) return ((KeyValue)cell).getKeyLength();<a name="line.1428"></a>
-<span class="sourceLineNo">1429</span>    return cell.getRowLength() + cell.getFamilyLength() +<a name="line.1429"></a>
-<span class="sourceLineNo">1430</span>        cell.getQualifierLength() +<a name="line.1430"></a>
-<span class="sourceLineNo">1431</span>        KeyValue.KEY_INFRASTRUCTURE_SIZE;<a name="line.1431"></a>
-<span class="sourceLineNo">1432</span>  }<a name="line.1432"></a>
-<span class="sourceLineNo">1433</span><a name="line.1433"></a>
-<span class="sourceLineNo">1434</span>  /**<a name="line.1434"></a>
-<span class="sourceLineNo">1435</span>   * This is an estimate of the heap space occupied by a cell. When the cell is of type<a name="line.1435"></a>
-<span class="sourceLineNo">1436</span>   * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a correct value. In other<a name="line.1436"></a>
-<span class="sourceLineNo">1437</span>   * cases we just consider the bytes occupied by the cell components ie. row, CF, qualifier,<a name="line.1437"></a>
-<span class="sourceLineNo">1438</span>   * timestamp, type, value and tags.<a name="line.1438"></a>
-<span class="sourceLineNo">1439</span>   * @param cell<a name="line.1439"></a>
-<span class="sourceLineNo">1440</span>   * @return estimate of the heap space<a name="line.1440"></a>
-<span class="sourceLineNo">1441</span>   */<a name="line.1441"></a>
-<span class="sourceLineNo">1442</span>  public static long estimatedHeapSizeOf(final Cell cell) {<a name="line.1442"></a>
-<span class="sourceLineNo">1443</span>    if (cell instanceof HeapSize) {<a name="line.1443"></a>
-<span class="sourceLineNo">1444</span>      return ((HeapSize) cell).heapSize();<a name="line.1444"></a>
-<span class="sourceLineNo">1445</span>    }<a name="line.1445"></a>
-<span class="sourceLineNo">1446</span>    // TODO: Add sizing of references that hold the row, family, etc., arrays.<a name="line.1446"></a>
-<span class="sourceLineNo">1447</span>    return estimatedSerializedSizeOf(cell);<a name="line.1447"></a>
-<span class="sourceLineNo">1448</span>  }<a name="line.1448"></a>
-<span class="sourceLineNo">1449</span><a name="line.1449"></a>
-<span class="sourceLineNo">1450</span>  /********************* tags *************************************/<a name="line.1450"></a>
-<span class="sourceLineNo">1451</span>  /**<a name="line.1451"></a>
-<span class="sourceLineNo">1452</span>   * Util method to iterate through the tags<a name="line.1452"></a>
-<span class="sourceLineNo">1453</span>   *<a name="line.1453"></a>
-<span class="sourceLineNo">1454</span>   * @param tags<a name="line.1454"></a>
-<span class="sourceLineNo">1455</span>   * @param offset<a name="line.1455"></a>
-<span class="sourceLineNo">1456</span>   * @param length<a name="line.1456"></a>
-<span class="sourceLineNo">1457</span>   * @return iterator for the tags<a name="line.1457"></a>
-<span class="sourceLineNo">1458</span>   * @deprecated As of 2.0.0 and will be removed in 3.0.0<a name="line.1458"></a>
-<span class="sourceLineNo">1459</span>   *             Instead use {@link #tagsIterator(Cell)}<a name="line.1459"></a>
-<span class="sourceLineNo">1460</span>   */<a name="line.1460"></a>
-<span class="sourceLineNo">1461</span>  @Deprecated<a name="line.1461"></a>
-<span class="sourceLineNo">1462</span>  public static Iterator&lt;Tag&gt; tagsIterator(final byte[] tags, final int offset, final int length) {<a name="line.1462"></a>
-<span class="sourceLineNo">1463</span>    return new Iterator&lt;Tag&gt;() {<a name="line.1463"></a>
-<span class="sourceLineNo">1464</span>      private int pos = offset;<a name="line.1464"></a>
-<span class="sourceLineNo">1465</span>      private int endOffset = offset + length - 1;<a name="line.1465"></a>
-<span class="sourceLineNo">1466</span><a name="line.1466"></a>
-<span class="sourceLineNo">1467</span>      @Override<a name="line.1467"></a>
-<span class="sourceLineNo">1468</span>      public boolean hasNext() {<a name="line.1468"></a>
-<span class="sourceLineNo">1469</span>        return this.pos &lt; endOffset;<a name="line.1469"></a>
-<span class="sourceLineNo">1470</span>      }<a name="line.1470"></a>
-<span class="sourceLineNo">1471</span><a name="line.1471"></a>
-<span class="sourceLineNo">1472</span>      @Override<a name="line.1472"></a>
-<span class="sourceLineNo">1473</span>      public Tag next() {<a name="line.1473"></a>
-<span class="sourceLineNo">1474</span>        if (hasNext()) {<a name="line.1474"></a>
-<span class="sourceLineNo">1475</span>          int curTagLen = Bytes.readAsInt(tags, this.pos, Tag.TAG_LENGTH_SIZE);<a name="line.1475"></a>
-<span class="sourceLineNo">1476</span>          Tag tag = new ArrayBackedTag(tags, pos, curTagLen + TAG_LENGTH_SIZE);<a name="line.1476"></a>
-<span class="sourceLineNo">1477</span>          this.pos += Bytes.SIZEOF_SHORT + curTagLen;<a name="line.1477"></a>
-<span class="sourceLineNo">1478</span>          return tag;<a name="line.1478"></a>
-<span class="sourceLineNo">1479</span>        }<a name="line.1479"></a>
-<span class="sourceLineNo">1480</span>        return null;<a name="line.1480"></a>
-<span class="sourceLineNo">1481</span>      }<a name="line.1481"></a>
-<span class="sourceLineNo">1482</span><a name="line.1482"></a>
-<span class="sourceLineNo">1483</span>      @Override<a name="line.1483"></a>
-<span class="sourceLineNo">1484</span>      public void remove() {<a name="line.1484"></a>
-<span class="sourceLineNo">1485</span>        throw new UnsupportedOperationException();<a name="line.1485"></a>
-<span class="sourceLineNo">1486</span>      }<a name="line.1486"></a>
-<span class="sourceLineNo">1487</span>    };<a name="line.1487"></a>
-<span class="sourceLineNo">1488</span>  }<a name="line.1488"></a>
-<span class="sourceLineNo">1489</span><a name="line.1489"></a>
-<span class="sourceLineNo">1490</span>  private static Iterator&lt;Tag&gt; tagsIterator(final ByteBuffer tags, final int offset,<a name="line.1490"></a>
-<span class="sourceLineNo">1491</span>      final int length) {<a name="line.1491"></a>
-<span class="sourceLineNo">1492</span>    return new Iterator&lt;Tag&gt;() {<a name="line.1492"></a>
-<span class="sourceLineNo">1493</span>      private int pos = offset;<a name="line.1493"></a>
-<span class="sourceLineNo">1494</span>      private int endOffset = offset + length - 1;<a name="line.1494"></a>
-<span class="sourceLineNo">1495</span><a name="line.1495"></a>
-<span class="sourceLineNo">1496</span>      @Override<a name="line.1496"></a>
-<span class="sourceLineNo">1497</span>      public boolean hasNext() {<a name="line.1497"></a>
-<span class="sourceLineNo">1498</span>        return this.pos &lt; endOffset;<a name="line.1498"></a>
-<span class="sourceLineNo">1499</span>      }<a name="line.1499"></a>
-<span class="sourceLineNo">1500</span><a name="line.1500"></a>
-<span class="sourceLineNo">1501</span>      @Override<a name="line.1501"></a>
-<span class="sourceLineNo">1502</span>      public Tag next() {<a name="line.1502"></a>
-<span class="sourceLineNo">1503</span>        if (hasNext()) {<a name="line.1503"></a>
-<span class="sourceLineNo">1504</span>          int curTagLen = ByteBufferUtils.readAsInt(tags, this.pos, Tag.TAG_LENGTH_SIZE);<a name="line.1504"></a>
-<span class="sourceLineNo">1505</span>          Tag tag = new ByteBufferTag(tags, pos, curTagLen + Tag.TAG_LENGTH_SIZE);<a name="line.1505"></a>
-<span class="sourceLineNo">1506</span>          this.pos += Bytes.SIZEOF_SHORT + curTagLen;<a name="line.1506"></a>
-<span class="sourceLineNo">1507</span>          return tag;<a name="line.1507"></a>
-<span class="sourceLineNo">1508</span>        }<a name="line.1508"></a>
-<span class="sourceLineNo">1509</span>        return null;<a name="line.1509"></a>
-<span class="sourceLineNo">1510</span>      }<a name="line.1510"></a>
-<span class="sourceLineNo">1511</span><a name="line.1511"></a>
-<span class="sourceLineNo">1512</span>      @Override<a name="line.1512"></a>
-<span class="sourceLineNo">1513</span>      public void remove() {<a name="line.1513"></a>
-<span class="sourceLineNo">1514</span>        throw new UnsupportedOperationException();<a name="line.1514"></a>
-<span class="sourceLineNo">1515</span>      }<a name="line.1515"></a>
-<span class="sourceLineNo">1516</span>    };<a name="line.1516"></a>
-<span class="sourceLineNo">1517</span>  }<a name="line.1517"></a>
-<span class="sourceLineNo">1518</span><a name="line.1518"></a>
-<span class="sourceLineNo">1519</span>  private static final Iterator&lt;Tag&gt; EMPTY_TAGS_ITR = new Iterator&lt;Tag&gt;() {<a name="line.1519"></a>
-<span class="sourceLineNo">1520</span>    @Override<a name="line.1520"></a>
-<span class="sourceLineNo">1521</span>    public boolean hasNext() {<a name="line.1521"></a>
-<span class="sourceLineNo">1522</span>      return false;<a name="line.1522"></a>
-<span class="sourceLineNo">1523</span>    }<a name="line.1523"></a>
-<span class="sourceLineNo">1524</span><a name="line.1524"></a>
-<span class="sourceLineNo">1525</span>    @Override<a name="line.1525"></a>
-<span class="sourceLineNo">1526</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IT_NO_SUCH_ELEMENT",<a name="line.1526"></a>
-<span class="sourceLineNo">1527</span>      justification="Intentional")<a name="line.1527"></a>
-<span class="sourceLineNo">1528</span>    public Tag next() {<a name="line.1528"></a>
-<span class="sourceLineNo">1529</span>      return null;<a name="line.1529"></a>
-<span class="sourceLineNo">1530</span>    }<a name="line.1530"></a>
-<span class="sourceLineNo">1531</span><a name="line.1531"></a>
-<span class="sourceLineNo">1532</span>    @Override<a name="line.1532"></a>
-<span class="sourceLineNo">1533</span>    public void remove() {<a name="line.1533"></a>
-<span class="sourceLineNo">1534</span>      throw new UnsupportedOperationException();<a name="line.1534"></a>
-<span class="sourceLineNo">1535</span>    }<a name="line.1535"></a>
-<span class="sourceLineNo">1536</span>  };<a name="line.1536"></a>
-<span class="sourceLineNo">1537</span><a name="line.1537"></a>
-<span class="sourceLineNo">1538</span>  /**<a name="line.1538"></a>
-<span class="sourceLineNo">1539</span>   * Util method to iterate through the tags in the given cell.<a name="line.1539"></a>
-<span class="sourceLineNo">1540</span>   *<a name="line.1540"></a>
-<span class="sourceLineNo">1541</span>   * @param cell The Cell over which tags iterator is needed.<a name="line.1541"></a>
-<span class="sourceLineNo">1542</span>   * @return iterator for the tags<a name="line.1542"></a>
-<span class="sourceLineNo">1543</span>   */<a name="line.1543"></a>
-<span class="sourceLineNo">1544</span>  public static Iterator&lt;Tag&gt; tagsIterator(final Cell cell) {<a name="line.1544"></a>
-<span class="sourceLineNo">1545</span>    final int tagsLength = cell.getTagsLength();<a name="line.1545"></a>
-<span class="sourceLineNo">1546</span>    // Save an object allocation where we can<a name="line.1546"></a>
-<span class="sourceLineNo">1547</span>    if (tagsLength == 0) {<a name="line.1547"></a>
-<span class="sourceLineNo">1548</span>      return TagUtil.EMPTY_TAGS_ITR;<a name="line.1548"></a>
-<span class="sourceLineNo">1549</span>    }<a name="line.1549"></a>
-<span class="sourceLineNo">1550</span>    if (cell instanceof ByteBufferCell) {<a name="line.1550"></a>
-<span class="sourceLineNo">1551</span>      return tagsIterator(((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1551"></a>
-<span class="sourceLineNo">1552</span>          ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1552"></a>
-<span class="sourceLineNo">1553</span>    }<a name="line.1553"></a>
-<span class="sourceLineNo">1554</span>    return tagsIterator(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1554"></a>
-<span class="sourceLineNo">1555</span>  }<a name="line.1555"></a>
-<span class="sourceLineNo">1556</span><a name="line.1556"></a>
-<span class="sourceLineNo">1557</span>  /**<a name="line.1557"></a>
-<span class="sourceLineNo">1558</span>   * @param cell The Cell<a name="line.1558"></a>
-<span class="sourceLineNo">1559</span>   * @return Tags in the given Cell as a List<a name="line.1559"></a>
-<span class="sourceLineNo">1560</span>   */<a name="line.1560"></a>
-<span class="sourceLineNo">1561</span>  public static List&lt;Tag&gt; getTags(Cell cell) {<a name="line.1561"></a>
-<span class="sourceLineNo">1562</span>    List&lt;Tag&gt; tags = new ArrayList&lt;&gt;();<a name="line.1562"></a>
-<span class="sourceLineNo">1563</span>    Iterator&lt;Tag&gt; tagsItr = tagsIterator(cell);<a name="line.1563"></a>
-<span class="sourceLineNo">1564</span>    while (tagsItr.hasNext()) {<a name="line.1564"></a>
-<span class="sourceLineNo">1565</span>      tags.add(tagsItr.next());<a name="line.1565"></a>
-<span class="sourceLineNo">1566</span>    }<a name="line.1566"></a>
-<span class="sourceLineNo">1567</span>    return tags;<a name="line.1567"></a>
-<span class="sourceLineNo">1568</span>  }<a name="line.1568"></a>
-<span class="sourceLineNo">1569</span><a name="line.1569"></a>
-<span class="sourceLineNo">1570</span>  /**<a name="line.1570"></a>
-<span class="sourceLineNo">1571</span>   * Retrieve Cell's first tag, matching the passed in type<a name="line.1571"></a>
-<span class="sourceLineNo">1572</span>   *<a name="line.1572"></a>
-<span class="sourceLineNo">1573</span>   * @param cell The Cell<a name="line.1573"></a>
-<span class="sourceLineNo">1574</span>   * @param type Type of the Tag to retrieve<a name="line.1574"></a>
-<span class="sourceLineNo">1575</span>   * @return null if there is no tag of the passed in tag type<a name="line.1575"></a>
-<span class="sourceLineNo">1576</span>   */<a name="line.1576"></a>
-<span class="sourceLineNo">1577</span>  public static Tag getTag(Cell cell, byte type){<a name="line.1577"></a>
-<span class="sourceLineNo">1578</span>    boolean bufferBacked = cell instanceof ByteBufferCell;<a name="line.1578"></a>
-<span class="sourceLineNo">1579</span>    int length = cell.getTagsLength();<a name="line.1579"></a>
-<span class="sourceLineNo">1580</span>    int offset = bufferBacked? ((ByteBufferCell)cell).getTagsPosition():cell.getTagsOffset();<a name="line.1580"></a>
-<span class="sourceLineNo">1581</span>    int pos = offset;<a name="line.1581"></a>
-<span class="sourceLineNo">1582</span>    while (pos &lt; offset + length) {<a name="line.1582"></a>
-<span class="sourceLineNo">1583</span>      int tagLen;<a name="line.1583"></a>
-<span class="sourceLineNo">1584</span>      if (bufferBacked) {<a name="line.1584"></a>
-<span class="sourceLineNo">1585</span>        ByteBuffer tagsBuffer = ((ByteBufferCell)cell).getTagsByteBuffer();<a name="line.1585"></a>
-<span class="sourceLineNo">1586</span>        tagLen = ByteBufferUtils.readAsInt(tagsBuffer, pos, TAG_LENGTH_SIZE);<a name="line.1586"></a>
-<span class="sourceLineNo">1587</span>        if (ByteBufferUtils.toByte(tagsBuffer, pos + TAG_LENGTH_SIZE) == type) {<a name="line.1587"></a>
-<span class="sourceLineNo">1588</span>          return new ByteBufferTag(tagsBuffer, pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1588"></a>
-<span class="sourceLineNo">1589</span>        }<a name="line.1589"></a>
-<span class="sourceLineNo">1590</span>      } else {<a name="line.1590"></a>
-<span class="sourceLineNo">1591</span>        tagLen = Bytes.readAsInt(cell.getTagsArray(), pos, TAG_LENGTH_SIZE);<a name="line.1591"></a>
-<span class="sourceLineNo">1592</span>        if (cell.getTagsArray()[pos + TAG_LENGTH_SIZE] == type) {<a name="line.1592"></a>
-<span class="sourceLineNo">1593</span>          return new ArrayBackedTag(cell.getTagsArray(), pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1593"></a>
-<span class="sourceLineNo">1594</span>        }<a name="line.1594"></a>
-<span class="sourceLineNo">1595</span>      }<a name="line.1595"></a>
-<span class="sourceLineNo">1596</span>      pos += TAG_LENGTH_SIZE + tagLen;<a name="line.1596"></a>
-<span class="sourceLineNo">1597</span>    }<a name="line.1597"></a>
-<span class="sourceLineNo">1598</span>    return null;<a name="line.1598"></a>
-<span class="sourceLineNo">1599</span>  }<a name="line.1599"></a>
-<span class="sourceLineNo">1600</span><a name="line.1600"></a>
-<span class="sourceLineNo">1601</span>  /**<a name="line.1601"></a>
-<span class="sourceLineNo">1602</span>   * Returns true if the first range start1...end1 overlaps with the second range<a name="line.1602"></a>
-<span class="sourceLineNo">1603</span>   * start2...end2, assuming the byte arrays represent row keys<a name="line.1603"></a>
-<span class="sourceLineNo">1604</span>   */<a name="line.1604"></a>
-<span class="sourceLineNo">1605</span>  public static boolean overlappingKeys(final byte[] start1, final byte[] end1,<a name="line.1605"></a>
-<span class="sourceLineNo">1606</span>      final byte[] start2, final byte[] end2) {<a name="line.1606"></a>
-<span class="sourceLineNo">1607</span>    return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1,<a name="line.1607"></a>
-<span class="sourceLineNo">1608</span>        end2) &lt; 0)<a name="line.1608"></a>
-<span class="sourceLineNo">1609</span>        &amp;&amp; (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2,<a name="line.1609"></a>
-<span class="sourceLineNo">1610</span>            end1) &lt; 0);<a name="line.1610"></a>
-<span class="sourceLineNo">1611</span>  }<a name="line.1611"></a>
-<span class="sourceLineNo">1612</span><a name="line.1612"></a>
-<span class="sourceLineNo">1613</span>  /**<a name="line.1613"></a>
-<span class="sourceLineNo">1614</span>   * Sets the given seqId to the cell.<a name="line.1614"></a>
-<span class="sourceLineNo">1615</span>   * Marked as audience Private as of 1.2.0.<a name="line.1615"></a>
-<span class="sourceLineNo">1616</span>   * Setting a Cell sequenceid is an internal implementation detail not for general public use.<a name="line.1616"></a>
-<span class="sourceLineNo">1617</span>   * @param cell<a name="line.1617"></a>
-<span class="sourceLineNo">1618</span>   * @param seqId<a name="line.1618"></a>
-<span class="sourceLineNo">1619</span>   * @throws IOException when the passed cell is not of type {@link SettableSequenceId}<a name="line.1619"></a>
-<span class="sourceLineNo">1620</span>   */<a name="line.1620"></a>
-<span class="sourceLineNo">1621</span>  @InterfaceAudience.Private<a name="line.1621"></a>
-<span class="sourceLineNo">1622</span>  public static void setSequenceId(Cell cell, long seqId) throws IOException {<a name="line.1622"></a>
-<span class="sourceLineNo">1623</span>    if (cell instanceof SettableSequenceId) {<a name="line.1623"></a>
-<span class="sourceLineNo">1624</span>      ((SettableSequenceId) cell).setSequenceId(seqId);<a name="line.1624"></a>
-<span class="sourceLineNo">1625</span>    } else {<a name="line.1625"></a>
-<span class="sourceLineNo">1626</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1626"></a>
-<span class="sourceLineNo">1627</span>          + SettableSequenceId.class.getName()));<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><a name="line.1630"></a>
-<span class="sourceLineNo">1631</span>  /**<a name="line.1631"></a>
-<span class="sourceLineNo">1632</span>   * Sets the given timestamp to the cell.<a name="line.1632"></a>
-<span class="sourceLineNo">1633</span>   * @param cell<a name="line.1633"></a>
-<span class="sourceLineNo">1634</span>   * @param ts<a name="line.1634"></a>
-<span class="sourceLineNo">1635</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1635"></a>
-<span class="sourceLineNo">1636</span>   */<a name="line.1636"></a>
-<span class="sourceLineNo">1637</span>  public static void setTimestamp(Cell cell, long ts) throws IOException {<a name="line.1637"></a>
-<span class="sourceLineNo">1638</span>    if (cell instanceof SettableTimestamp) {<a name="line.1638"></a>
-<span class="sourceLineNo">1639</span>      ((SettableTimestamp) cell).setTimestamp(ts);<a name="line.1639"></a>
-<span class="sourceLineNo">1640</span>    } else {<a name="line.1640"></a>
-<span class="sourceLineNo">1641</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1641"></a>
-<span class="sourceLineNo">1642</span>          + SettableTimestamp.class.getName()));<a name="line.1642"></a>
-<span class="sourceLineNo">1643</span>    }<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>   * Sets the given timestamp to the cell.<a name="line.1647"></a>
-<span class="sourceLineNo">1648</span>   * @param cell<a name="line.1648"></a>
-<span class="sourceLineNo">1649</span>   * @param ts buffer containing the timestamp value<a name="line.1649"></a>
-<span class="sourceLineNo">1650</span>   * @param tsOffset offset to the new timestamp<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, byte[] ts, int tsOffset) 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, tsOffset);<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 iff current timestamp is<a name="line.1663"></a>
-<span class="sourceLineNo">1664</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1664"></a>
-<span class="sourceLineNo">1665</span>   * @param cell<a name="line.1665"></a>
-<span class="sourceLineNo">1666</span>   * @param ts<a name="line.1666"></a>
-<span class="sourceLineNo">1667</span>   * @return True if cell timestamp is modified.<a name="line.1667"></a>
-<span class="sourceLineNo">1668</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1668"></a>
-<span class="sourceLineNo">1669</span>   */<a name="line.1669"></a>
-<span class="sourceLineNo">1670</span>  public static boolean updateLatestStamp(Cell cell, long ts) throws IOException {<a name="line.1670"></a>
-<span class="sourceLineNo">1671</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1671"></a>
-<span class="sourceLineNo">1672</span>      setTimestamp(cell, ts);<a name="line.1672"></a>
-<span class="sourceLineNo">1673</span>      return true;<a name="line.1673"></a>
-<span class="sourceLineNo">1674</span>    }<a name="line.1674"></a>
-<span class="sourceLineNo">1675</span>    return false;<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 buffer containing the timestamp value<a name="line.1682"></a>
-<span class="sourceLineNo">1683</span>   * @param tsOffset offset to the new timestamp<a name="line.1683"></a>
-<span class="sourceLineNo">1684</span>   * @return True if cell timestamp is modified.<a name="line.1684"></a>
-<span class="sourceLineNo">1685</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1685"></a>
-<span class="sourceLineNo">1686</span>   */<a name="line.1686"></a>
-<span class="sourceLineNo">1687</span>  public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1687"></a>
-<span class="sourceLineNo">1688</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1688"></a>
-<span class="sourceLineNo">1689</span>      setTimestamp(cell, ts, tsOffset);<a name="line.1689"></a>
-<span class="sourceLineNo">1690</span>      return true;<a name="line.1690"></a>
-<span class="sourceLineNo">1691</span>    }<a name="line.1691"></a>
-<span class="sourceLineNo">1692</span>    return false;<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>  /**<a name="line.1695"></a>
-<span class="sourceLineNo">1696</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.1696"></a>
-<span class="sourceLineNo">1697</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.1697"></a>
-<span class="sourceLineNo">1698</span>   * timestamp&amp;gt;&amp;lt;1 byte type&amp;gt;<a name="line.1698"></a>
-<span class="sourceLineNo">1699</span>   * @param cell<a name="line.1699"></a>
-<span class="sourceLineNo">1700</span>   * @param out<a name="line.1700"></a>
-<span class="sourceLineNo">1701</span>   * @throws IOException<a name="line.1701"></a>
-<span class="sourceLineNo">1702</span>   */<a name="line.1702"></a>
-<span class="sourceLineNo">1703</span>  public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException {<a name="line.1703"></a>
-<span class="sourceLineNo">1704</span>    short rowLen = cell.getRowLength();<a name="line.1704"></a>
-<span class="sourceLineNo">1705</span>    byte fLen = cell.getFamilyLength();<a name="line.1705"></a>
-<span class="sourceLineNo">1706</span>    int qLen = cell.getQualifierLength();<a name="line.1706"></a>
-<span class="sourceLineNo">1707</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1707"></a>
-<span class="sourceLineNo">1708</span>    // component of cell<a name="line.1708"></a>
-<span class="sourceLineNo">1709</span>    if (cell instanceof ByteBufferCell) {<a name="line.1709"></a>
-<span class="sourceLineNo">1710</span>      out.writeShort(rowLen);<a name="line.1710"></a>
-<span class="sourceLineNo">1711</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1711"></a>
-<span class="sourceLineNo">1712</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1712"></a>
-<span class="sourceLineNo">1713</span>      out.writeByte(fLen);<a name="line.1713"></a>
-<span class="sourceLineNo">1714</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1714"></a>
-<span class="sourceLineNo">1715</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1715"></a>
-<span class="sourceLineNo">1716</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1716"></a>
-<span class="sourceLineNo">1717</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1717"></a>
-<span class="sourceLineNo">1718</span>    } else {<a name="line.1718"></a>
-<span class="sourceLineNo">1719</span>      out.writeShort(rowLen);<a name="line.1719"></a>
-<span class="sourceLineNo">1720</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1720"></a>
-<span class="sourceLineNo">1721</span>      out.writeByte(fLen);<a name="line.1721"></a>
-<span class="sourceLineNo">1722</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1722"></a>
-<span class="sourceLineNo">1723</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1723"></a>
-<span class="sourceLineNo">1724</span>    }<a name="line.1724"></a>
-<span class="sourceLineNo">1725</span>    out.writeLong(cell.getTimestamp());<a name="line.1725"></a>
-<span class="sourceLineNo">1726</span>    out.writeByte(cell.getTypeByte());<a name="line.1726"></a>
-<span class="sourceLineNo">1727</span>  }<a name="line.1727"></a>
-<span class="sourceLineNo">1728</span><a name="line.1728"></a>
-<span class="sourceLineNo">1729</span>  public static int writeFlatKey(Cell cell, OutputStream out) throws IOException {<a name="line.1729"></a>
-<span class="sourceLineNo">1730</span>    short rowLen = cell.getRowLength();<a name="line.1730"></a>
-<span class="sourceLineNo">1731</span>    byte fLen = cell.getFamilyLength();<a name="line.1731"></a>
-<span class="sourceLineNo">1732</span>    int qLen = cell.getQualifierLength();<a name="line.1732"></a>
-<span class="sourceLineNo">1733</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1733"></a>
-<span class="sourceLineNo">1734</span>    // component of cell<a name="line.1734"></a>
-<span class="sourceLineNo">1735</span>    if (cell instanceof ByteBufferCell) {<a name="line.1735"></a>
-<span class="sourceLineNo">1736</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1736"></a>
-<span class="sourceLineNo">1737</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1737"></a>
-<span class="sourceLineNo">1738</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1738"></a>
-<span class="sourceLineNo">1739</span>      out.write(fLen);<a name="line.1739"></a>
-<span class="sourceLineNo">1740</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1740"></a>
-<span class="sourceLineNo">1741</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1741"></a>
-<span class="sourceLineNo">1742</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1742"></a>
-<span class="sourceLineNo">1743</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1743"></a>
-<span class="sourceLineNo">1744</span>    } else {<a name="line.1744"></a>
-<span class="sourceLineNo">1745</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1745"></a>
-<span class="sourceLineNo">1746</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1746"></a>
-<span class="sourceLineNo">1747</span>      out.write(fLen);<a name="line.1747"></a>
-<span class="sourceLineNo">1748</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1748"></a>
-<span class="sourceLineNo">1749</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1749"></a>
-<span class="sourceLineNo">1750</span>    }<a name="line.1750"></a>
-<span class="sourceLineNo">1751</span>    StreamUtils.writeLong(out, cell.getTimestamp());<a name="line.1751"></a>
-<span class="sourceLineNo">1752</span>    out.write(cell.getTypeByte());<a name="line.1752"></a>
-<span class="sourceLineNo">1753</span>    return Bytes.SIZEOF_SHORT + rowLen + Bytes.SIZEOF_BYTE + fLen + qLen + Bytes.SIZEOF_LONG<a name="line.1753"></a>
-<span class="sourceLineNo">1754</span>        + Bytes.SIZEOF_BYTE;<a name="line.1754"></a>
-<span class="sourceLineNo">1755</span>  }<a name="line.1755"></a>
-<span class="sourceLineNo">1756</span><a name="line.1756"></a>
-<span class="sourceLineNo">1757</span>  /**<a name="line.1757"></a>
-<span class="sourceLineNo">1758</span>   * Writes the row from the given cell to the output stream<a name="line.1758"></a>
-<span class="sourceLineNo">1759</span>   * @param out The outputstream to which the data has to be written<a name="line.1759"></a>
-<span class="sourceLineNo">1760</span>   * @param cell The cell whose contents has to be written<a name="line.1760"></a>
-<span class="sourceLineNo">1761</span>   * @param rlength the row length<a name="line.1761"></a>
-<span class="sourceLineNo">1762</span>   * @throws IOException<a name="line.1762"></a>
-<span class="sourceLineNo">1763</span>   */<a name="line.1763"></a>
-<span class="sourceLineNo">1764</span>  public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {<a name="line.1764"></a>
-<span class="sourceLineNo">1765</span>    if (cell instanceof ByteBufferCell) {<a name="line.1765"></a>
-<span class="sourceLineNo">1766</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1766"></a>
-<span class="sourceLineNo">1767</span>        ((ByteBufferCell) cell).getRowPosition(), rlength);<a name="line.1767"></a>
-<span class="sourceLineNo">1768</span>    } else {<a name="line.1768"></a>
-<span class="sourceLineNo">1769</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rlength);<a name="line.1769"></a>
-<span class="sourceLineNo">1770</span>    }<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 excluding the common prefix<a name="line.1774"></a>
-<span class="sourceLineNo">1775</span>   * @param out The dataoutputstream 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 writeRowSkippingBytes(DataOutputStream out, Cell cell, short rlength,<a name="line.1780"></a>
-<span class="sourceLineNo">1781</span>      int commonPrefix) throws IOException {<a name="line.1781"></a>
-<span class="sourceLineNo">1782</span>    if (cell instanceof ByteBufferCell) {<a name="line.1782"></a>
-<span class="sourceLineNo">1783</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1783"></a>
-<span class="sourceLineNo">1784</span>        ((ByteBufferCell) cell).getRowPosition() + commonPrefix, rlength - commonPrefix);<a name="line.1784"></a>
-<span class="sourceLineNo">1785</span>    } else {<a name="line.1785"></a>
-<span class="sourceLineNo">1786</span>      out.write(cell.getRowArray(), cell.getRowOffset() + commonPrefix, rlength - commonPrefix);<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>  /**<a name="line.1790"></a>
-<span class="sourceLineNo">1791</span>   * Writes the family from the given cell to the output stream<a name="line.1791"></a>
-<span class="sourceLineNo">1792</span>   * @param out The outputstream to which the data has to be written<a name="line.1792"></a>
-<span class="sourceLineNo">1793</span>   * @param cell The cell whose contents has to be written<a name="line.1793"></a>
-<span class="sourceLineNo">1794</span>   * @param flength the family length<a name="line.1794"></a>
-<span class="sourceLineNo">1795</span>   * @throws IOException<a name="line.1795"></a>
-<span class="sourceLineNo">1796</span>   */<a name="line.1796"></a>
-<span class="sourceLineNo">1797</span>  public static void writeFamily(OutputStream out, Cell cell, byte flength) 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).getFamilyByteBuffer(),<a name="line.1799"></a>
-<span class="sourceLineNo">1800</span>        ((ByteBufferCell) cell).getFamilyPosition(), flength);<a name="line.1800"></a>
-<span class="sourceLineNo">1801</span>    } else {<a name="line.1801"></a>
-<span class="sourceLineNo">1802</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), flength);<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 qualifier 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 qlength the qualifier 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 writeQualifier(OutputStream out, Cell cell, int qlength)<a name="line.1813"></a>
-<span class="sourceLineNo">1814</span>      throws IOException {<a name="line.1814"></a>
-<span class="sourceLineNo">1815</span>    if (cell instanceof ByteBufferCell) {<a name="line.1815"></a>
-<span class="sourceLineNo">1816</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1816"></a>
-<span class="sourceLineNo">1817</span>        ((ByteBufferCell) cell).getQualifierPosition(), qlength);<a name="line.1817"></a>
-<span class="sourceLineNo">1818</span>    } else {<a name="line.1818"></a>
-<span class="sourceLineNo">1819</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qlength);<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>  /**<a name="line.1823"></a>
-<span class="sourceLineNo">1824</span>   * Writes the qualifier from the given cell to the output stream excluding the common prefix<a name="line.1824"></a>
-<span class="sourceLineNo">1825</span>   * @param out The dataoutputstream to which the data has to be written<a name="line.1825"></a>
-<span class="sourceLineNo">1826</span>   * @param cell The cell whose contents has to be written<a name="line.1826"></a>
-<span class="sourceLineNo">1827</span>   * @param qlength the qualifier length<a name="line.1827"></a>
-<span class="sourceLineNo">1828</span>   * @throws IOException<a name="line.1828"></a>
-<span class="sourceLineNo">1829</span>   */<a name="line.1829"></a>
-<span class="sourceLineNo">1830</span>  public static void writeQualifierSkippingBytes(DataOutputStream out, Cell cell,<a name="line.1830"></a>
-<span class="sourceLineNo">1831</span>      int qlength, int commonPrefix) throws IOException {<a name="line.1831"></a>
-<span class="sourceLineNo">1832</span>    if (cell instanceof ByteBufferCell) {<a name="line.1832"></a>
-<span class="sourceLineNo">1833</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1833"></a>
-<span class="sourceLineNo">1834</span>        ((ByteBufferCell) cell).getQualifierPosition() + commonPrefix, qlength - commonPrefix);<a name="line.1834"></a>
-<span class="sourceLineNo">1835</span>    } else {<a name="line.1835"></a>
-<span class="sourceLineNo">1836</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset() + commonPrefix,<a name="line.1836"></a>
-<span class="sourceLineNo">1837</span>        qlength - commonPrefix);<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 value 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 vlength the value 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 writeValue(OutputStream out, Cell cell, int vlength) throws IOException {<a name="line.1848"></a>
-<span class="sourceLineNo">1849</span>    if (cell instanceof ByteBufferCell) {<a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getValueByteBuffer(),<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>        ((ByteBufferCell) cell).getValuePosition(), vlength);<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span>    } else {<a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>      out.write(cell.getValueArray(), cell.getValueOffset(), vlength);<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 tag 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 tagsLength the tag 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 writeTags(OutputStream out, Cell cell, int tagsLength) 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).getTagsByteBuffer(),<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>        ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span>    } else {<a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>      out.write(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<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>   * @param cell<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span>   * @return The Key portion of the passed &lt;code&gt;cell&lt;/code&gt; as a String.<a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>   */<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>  public static String getCellKeyAsString(Cell cell) {<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>    StringBuilder sb = new StringBuilder(Bytes.toStringBinary(<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>      cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>    sb.append('/');<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>    sb.append(cell.getFamilyLength() == 0? "":<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>      Bytes.toStringBinary(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength()));<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>    // KeyValue only added ':' if family is non-null.  Do same.<a name="line.1883"></a>
-<span class="sourceLineNo">1884</span>    if (cell.getFamilyLength() &gt; 0) sb.append(':');<a name="line.1884"></a>
-<span class="sourceLineNo">1885</span>    sb.append(cell.getQualifierLength() == 0? "":<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span>      Bytes.toStringBinary(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.1886"></a>
-<span class="sourceLineNo">1887</span>        cell.getQualifierLength()));<a name="line.1887"></a>
+<span class="sourceLineNo">1388</span>    if (cell instanceof ExtendedCell) {<a name="line.1388"></a>
+<span class="sourceLineNo">1389</span>      return ((ExtendedCell) cell).getSerializedSize(true) + Bytes.SIZEOF_INT;<a name="line.1389"></a>
+<span class="sourceLineNo">1390</span>    }<a name="line.1390"></a>
+<span class="sourceLineNo">1391</span><a name="line.1391"></a>
+<span class="sourceLineNo">1392</span>    return getSumOfCellElementLengths(cell) +<a name="line.1392"></a>
+<span class="sourceLineNo">1393</span>      // Use the KeyValue's infrastructure size presuming that another implementation would have<a name="line.1393"></a>
+<span class="sourceLineNo">1394</span>      // same basic cost.<a name="line.1394"></a>
+<span class="sourceLineNo">1395</span>      KeyValue.ROW_LENGTH_SIZE + KeyValue.FAMILY_LENGTH_SIZE +<a name="line.1395"></a>
+<span class="sourceLineNo">1396</span>      // Serialization is probably preceded by a length (it is in the KeyValueCodec at least).<a name="line.1396"></a>
+<span class="sourceLineNo">1397</span>      Bytes.SIZEOF_INT;<a name="line.1397"></a>
+<span class="sourceLineNo">1398</span>  }<a name="line.1398"></a>
+<span class="sourceLineNo">1399</span><a name="line.1399"></a>
+<span class="sourceLineNo">1400</span>  /**<a name="line.1400"></a>
+<span class="sourceLineNo">1401</span>   * @param cell<a name="line.1401"></a>
+<span class="sourceLineNo">1402</span>   * @return Sum of the lengths of all the elements in a Cell; does not count in any infrastructure<a name="line.1402"></a>
+<span class="sourceLineNo">1403</span>   */<a name="line.1403"></a>
+<span class="sourceLineNo">1404</span>  private static int getSumOfCellElementLengths(final Cell cell) {<a name="line.1404"></a>
+<span class="sourceLineNo">1405</span>    return getSumOfCellKeyElementLengths(cell) + cell.getValueLength() + cell.getTagsLength();<a name="line.1405"></a>
+<span class="sourceLineNo">1406</span>  }<a name="line.1406"></a>
+<span class="sourceLineNo">1407</span><a name="line.1407"></a>
+<span class="sourceLineNo">1408</span>  /**<a name="line.1408"></a>
+<span class="sourceLineNo">1409</span>   * @param cell<a name="line.1409"></a>
+<span class="sourceLineNo">1410</span>   * @return Sum of all elements that make up a key; does not include infrastructure, tags or<a name="line.1410"></a>
+<span class="sourceLineNo">1411</span>   * values.<a name="line.1411"></a>
+<span class="sourceLineNo">1412</span>   */<a name="line.1412"></a>
+<span class="sourceLineNo">1413</span>  private static int getSumOfCellKeyElementLengths(final Cell cell) {<a name="line.1413"></a>
+<span class="sourceLineNo">1414</span>    return cell.getRowLength() + cell.getFamilyLength() +<a name="line.1414"></a>
+<span class="sourceLineNo">1415</span>    cell.getQualifierLength() +<a name="line.1415"></a>
+<span class="sourceLineNo">1416</span>    KeyValue.TIMESTAMP_TYPE_SIZE;<a name="line.1416"></a>
+<span class="sourceLineNo">1417</span>  }<a name="line.1417"></a>
+<span class="sourceLineNo">1418</span><a name="line.1418"></a>
+<span class="sourceLineNo">1419</span>  /**<a name="line.1419"></a>
+<span class="sourceLineNo">1420</span>   * Calculates the serialized key size. We always serialize in the KeyValue's serialization<a name="line.1420"></a>
+<span class="sourceLineNo">1421</span>   * format.<a name="line.1421"></a>
+<span class="sourceLineNo">1422</span>   * @param cell the cell for which the key size has to be calculated.<a name="line.1422"></a>
+<span class="sourceLineNo">1423</span>   * @return the key size<a name="line.1423"></a>
+<span class="sourceLineNo">1424</span>   */<a name="line.1424"></a>
+<span class="sourceLineNo">1425</span>  public static int estimatedSerializedSizeOfKey(final Cell cell) {<a name="line.1425"></a>
+<span class="sourceLineNo">1426</span>    if (cell instanceof KeyValue) return ((KeyValue)cell).getKeyLength();<a name="line.1426"></a>
+<span class="sourceLineNo">1427</span>    return cell.getRowLength() + cell.getFamilyLength() +<a name="line.1427"></a>
+<span class="sourceLineNo">1428</span>        cell.getQualifierLength() +<a name="line.1428"></a>
+<span class="sourceLineNo">1429</span>        KeyValue.KEY_INFRASTRUCTURE_SIZE;<a name="line.1429"></a>
+<span class="sourceLineNo">1430</span>  }<a name="line.1430"></a>
+<span class="sourceLineNo">1431</span><a name="line.1431"></a>
+<span class="sourceLineNo">1432</span>  /**<a name="line.1432"></a>
+<span class="sourceLineNo">1433</span>   * This is an estimate of the heap space occupied by a cell. When the cell is of type<a name="line.1433"></a>
+<span class="sourceLineNo">1434</span>   * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a correct value. In other<a name="line.1434"></a>
+<span class="sourceLineNo">1435</span>   * cases we just consider the bytes occupied by the cell components ie. row, CF, qualifier,<a name="line.1435"></a>
+<span class="sourceLineNo">1436</span>   * timestamp, type, value and tags.<a name="line.1436"></a>
+<span class="sourceLineNo">1437</span>   * @param cell<a name="line.1437"></a>
+<span class="sourceLineNo">1438</span>   * @return estimate of the heap space<a name="line.1438"></a>
+<span class="sourceLineNo">1439</span>   */<a name="line.1439"></a>
+<span class="sourceLineNo">1440</span>  public static long estimatedHeapSizeOf(final Cell cell) {<a name="line.1440"></a>
+<span class="sourceLineNo">1441</span>    if (cell instanceof HeapSize) {<a name="line.1441"></a>
+<span class="sourceLineNo">1442</span>      return ((HeapSize) cell).heapSize();<a name="line.1442"></a>
+<span class="sourceLineNo">1443</span>    }<a name="line.1443"></a>
+<span class="sourceLineNo">1444</span>    // TODO: Add sizing of references that hold the row, family, etc., arrays.<a name="line.1444"></a>
+<span class="sourceLineNo">1445</span>    return estimatedSerializedSizeOf(cell);<a name="line.1445"></a>
+<span class="sourceLineNo">1446</span>  }<a name="line.1446"></a>
+<span class="sourceLineNo">1447</span><a name="line.1447"></a>
+<span class="sourceLineNo">1448</span>  /********************* tags *************************************/<a name="line.1448"></a>
+<span class="sourceLineNo">1449</span>  /**<a name="line.1449"></a>
+<span class="sourceLineNo">1450</span>   * Util method to iterate through the tags<a name="line.1450"></a>
+<span class="sourceLineNo">1451</span>   *<a name="line.1451"></a>
+<span class="sourceLineNo">1452</span>   * @param tags<a name="line.1452"></a>
+<span class="sourceLineNo">1453</span>   * @param offset<a name="line.1453"></a>
+<span class="sourceLineNo">1454</span>   * @param length<a name="line.1454"></a>
+<span class="sourceLineNo">1455</span>   * @return iterator for the tags<a name="line.1455"></a>
+<span class="sourceLineNo">1456</span>   * @deprecated As of 2.0.0 and will be removed in 3.0.0<a name="line.1456"></a>
+<span class="sourceLineNo">1457</span>   *             Instead use {@link #tagsIterator(Cell)}<a name="line.1457"></a>
+<span class="sourceLineNo">1458</span>   */<a name="line.1458"></a>
+<span class="sourceLineNo">1459</span>  @Deprecated<a name="line.1459"></a>
+<span class="sourceLineNo">1460</span>  public static Iterator&lt;Tag&gt; tagsIterator(final byte[] tags, final int offset, final int length) {<a name="line.1460"></a>
+<span class="sourceLineNo">1461</span>    return new Iterator&lt;Tag&gt;() {<a name="line.1461"></a>
+<span class="sourceLineNo">1462</span>      private int pos = offset;<a name="line.1462"></a>
+<span class="sourceLineNo">1463</span>      private int endOffset = offset + length - 1;<a name="line.1463"></a>
+<span class="sourceLineNo">1464</span><a name="line.1464"></a>
+<span class="sourceLineNo">1465</span>      @Override<a name="line.1465"></a>
+<span class="sourceLineNo">1466</span>      public boolean hasNext() {<a name="line.1466"></a>
+<span class="sourceLineNo">1467</span>        return this.pos &lt; endOffset;<a name="line.1467"></a>
+<span class="sourceLineNo">1468</span>      }<a name="line.1468"></a>
+<span class="sourceLineNo">1469</span><a name="line.1469"></a>
+<span class="sourceLineNo">1470</span>      @Override<a name="line.1470"></a>
+<span class="sourceLineNo">1471</span>      public Tag next() {<a name="line.1471"></a>
+<span class="sourceLineNo">1472</span>        if (hasNext()) {<a name="line.1472"></a>
+<span class="sourceLineNo">1473</span>          int curTagLen = Bytes.readAsInt(tags, this.pos, Tag.TAG_LENGTH_SIZE);<a name="line.1473"></a>
+<span class="sourceLineNo">1474</span>          Tag tag = new ArrayBackedTag(tags, pos, curTagLen + TAG_LENGTH_SIZE);<a name="line.1474"></a>
+<span class="sourceLineNo">1475</span>          this.pos += Bytes.SIZEOF_SHORT + curTagLen;<a name="line.1475"></a>
+<span class="sourceLineNo">1476</span>          return tag;<a name="line.1476"></a>
+<span class="sourceLineNo">1477</span>        }<a name="line.1477"></a>
+<span class="sourceLineNo">1478</span>        return null;<a name="line.1478"></a>
+<span class="sourceLineNo">1479</span>      }<a name="line.1479"></a>
+<span class="sourceLineNo">1480</span><a name="line.1480"></a>
+<span class="sourceLineNo">1481</span>      @Override<a name="line.1481"></a>
+<span class="sourceLineNo">1482</span>      public void remove() {<a name="line.1482"></a>
+<span class="sourceLineNo">1483</span>        throw new UnsupportedOperationException();<a name="line.1483"></a>
+<span class="sourceLineNo">1484</span>      }<a name="line.1484"></a>
+<span class="sourceLineNo">1485</span>    };<a name="line.1485"></a>
+<span class="sourceLineNo">1486</span>  }<a name="line.1486"></a>
+<span class="sourceLineNo">1487</span><a name="line.1487"></a>
+<span class="sourceLineNo">1488</span>  private static Iterator&lt;Tag&gt; tagsIterator(final ByteBuffer tags, final int offset,<a name="line.1488"></a>
+<span class="sourceLineNo">1489</span>      final int length) {<a name="line.1489"></a>
+<span class="sourceLineNo">1490</span>    return new Iterator&lt;Tag&gt;() {<a name="line.1490"></a>
+<span class="sourceLineNo">1491</span>      private int pos = offset;<a name="line.1491"></a>
+<span class="sourceLineNo">1492</span>      private int endOffset = offset + length - 1;<a name="line.1492"></a>
+<span class="sourceLineNo">1493</span><a name="line.1493"></a>
+<span class="sourceLineNo">1494</span>      @Override<a name="line.1494"></a>
+<span class="sourceLineNo">1495</span>      public boolean hasNext() {<a name="line.1495"></a>
+<span class="sourceLineNo">1496</span>        return this.pos &lt; endOffset;<a name="line.1496"></a>
+<span class="sourceLineNo">1497</span>      }<a name="line.1497"></a>
+<span class="sourceLineNo">1498</span><a name="line.1498"></a>
+<span class="sourceLineNo">1499</span>      @Override<a name="line.1499"></a>
+<span class="sourceLineNo">1500</span>      public Tag next() {<a name="line.1500"></a>
+<span class="sourceLineNo">1501</span>        if (hasNext()) {<a name="line.1501"></a>
+<span class="sourceLineNo">1502</span>          int curTagLen = ByteBufferUtils.readAsInt(tags, this.pos, Tag.TAG_LENGTH_SIZE);<a name="line.1502"></a>
+<span class="sourceLineNo">1503</span>          Tag tag = new ByteBufferTag(tags, pos, curTagLen + Tag.TAG_LENGTH_SIZE);<a name="line.1503"></a>
+<span class="sourceLineNo">1504</span>          this.pos += Bytes.SIZEOF_SHORT + curTagLen;<a name="line.1504"></a>
+<span class="sourceLineNo">1505</span>          return tag;<a name="line.1505"></a>
+<span class="sourceLineNo">1506</span>        }<a name="line.1506"></a>
+<span class="sourceLineNo">1507</span>        return null;<a name="line.1507"></a>
+<span class="sourceLineNo">1508</span>      }<a name="line.1508"></a>
+<span class="sourceLineNo">1509</span><a name="line.1509"></a>
+<span class="sourceLineNo">1510</span>      @Override<a name="line.1510"></a>
+<span class="sourceLineNo">1511</span>      public void remove() {<a name="line.1511"></a>
+<span class="sourceLineNo">1512</span>        throw new UnsupportedOperationException();<a name="line.1512"></a>
+<span class="sourceLineNo">1513</span>      }<a name="line.1513"></a>
+<span class="sourceLineNo">1514</span>    };<a name="line.1514"></a>
+<span class="sourceLineNo">1515</span>  }<a name="line.1515"></a>
+<span class="sourceLineNo">1516</span><a name="line.1516"></a>
+<span class="sourceLineNo">1517</span>  private static final Iterator&lt;Tag&gt; EMPTY_TAGS_ITR = new Iterator&lt;Tag&gt;() {<a name="line.1517"></a>
+<span class="sourceLineNo">1518</span>    @Override<a name="line.1518"></a>
+<span class="sourceLineNo">1519</span>    public boolean hasNext() {<a name="line.1519"></a>
+<span class="sourceLineNo">1520</span>      return false;<a name="line.1520"></a>
+<span class="sourceLineNo">1521</span>    }<a name="line.1521"></a>
+<span class="sourceLineNo">1522</span><a name="line.1522"></a>
+<span class="sourceLineNo">1523</span>    @Override<a name="line.1523"></a>
+<span class="sourceLineNo">1524</span>    @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IT_NO_SUCH_ELEMENT",<a name="line.1524"></a>
+<span class="sourceLineNo">1525</span>      justification="Intentional")<a name="line.1525"></a>
+<span class="sourceLineNo">1526</span>    public Tag next() {<a name="line.1526"></a>
+<span class="sourceLineNo">1527</span>      return null;<a name="line.1527"></a>
+<span class="sourceLineNo">1528</span>    }<a name="line.1528"></a>
+<span class="sourceLineNo">1529</span><a name="line.1529"></a>
+<span class="sourceLineNo">1530</span>    @Override<a name="line.1530"></a>
+<span class="sourceLineNo">1531</span>    public void remove() {<a name="line.1531"></a>
+<span class="sourceLineNo">1532</span>      throw new UnsupportedOperationException();<a name="line.1532"></a>
+<span class="sourceLineNo">1533</span>    }<a name="line.1533"></a>
+<span class="sourceLineNo">1534</span>  };<a name="line.1534"></a>
+<span class="sourceLineNo">1535</span><a name="line.1535"></a>
+<span class="sourceLineNo">1536</span>  /**<a name="line.1536"></a>
+<span class="sourceLineNo">1537</span>   * Util method to iterate through the tags in the given cell.<a name="line.1537"></a>
+<span class="sourceLineNo">1538</span>   *<a name="line.1538"></a>
+<span class="sourceLineNo">1539</span>   * @param cell The Cell over which tags iterator is needed.<a name="line.1539"></a>
+<span class="sourceLineNo">1540</span>   * @return iterator for the tags<a name="line.1540"></a>
+<span class="sourceLineNo">1541</span>   */<a name="line.1541"></a>
+<span class="sourceLineNo">1542</span>  public static Iterator&lt;Tag&gt; tagsIterator(final Cell cell) {<a name="line.1542"></a>
+<span class="sourceLineNo">1543</span>    final int tagsLength = cell.getTagsLength();<a name="line.1543"></a>
+<span class="sourceLineNo">1544</span>    // Save an object allocation where we can<a name="line.1544"></a>
+<span class="sourceLineNo">1545</span>    if (tagsLength == 0) {<a name="line.1545"></a>
+<span class="sourceLineNo">1546</span>      return TagUtil.EMPTY_TAGS_ITR;<a name="line.1546"></a>
+<span class="sourceLineNo">1547</span>    }<a name="line.1547"></a>
+<span class="sourceLineNo">1548</span>    if (cell instanceof ByteBufferCell) {<a name="line.1548"></a>
+<span class="sourceLineNo">1549</span>      return tagsIterator(((ByteBufferCell) cell).getTagsByteBuffer(),<a name="line.1549"></a>
+<span class="sourceLineNo">1550</span>          ((ByteBufferCell) cell).getTagsPosition(), tagsLength);<a name="line.1550"></a>
+<span class="sourceLineNo">1551</span>    }<a name="line.1551"></a>
+<span class="sourceLineNo">1552</span>    return tagsIterator(cell.getTagsArray(), cell.getTagsOffset(), tagsLength);<a name="line.1552"></a>
+<span class="sourceLineNo">1553</span>  }<a name="line.1553"></a>
+<span class="sourceLineNo">1554</span><a name="line.1554"></a>
+<span class="sourceLineNo">1555</span>  /**<a name="line.1555"></a>
+<span class="sourceLineNo">1556</span>   * @param cell The Cell<a name="line.1556"></a>
+<span class="sourceLineNo">1557</span>   * @return Tags in the given Cell as a List<a name="line.1557"></a>
+<span class="sourceLineNo">1558</span>   */<a name="line.1558"></a>
+<span class="sourceLineNo">1559</span>  public static List&lt;Tag&gt; getTags(Cell cell) {<a name="line.1559"></a>
+<span class="sourceLineNo">1560</span>    List&lt;Tag&gt; tags = new ArrayList&lt;&gt;();<a name="line.1560"></a>
+<span class="sourceLineNo">1561</span>    Iterator&lt;Tag&gt; tagsItr = tagsIterator(cell);<a name="line.1561"></a>
+<span class="sourceLineNo">1562</span>    while (tagsItr.hasNext()) {<a name="line.1562"></a>
+<span class="sourceLineNo">1563</span>      tags.add(tagsItr.next());<a name="line.1563"></a>
+<span class="sourceLineNo">1564</span>    }<a name="line.1564"></a>
+<span class="sourceLineNo">1565</span>    return tags;<a name="line.1565"></a>
+<span class="sourceLineNo">1566</span>  }<a name="line.1566"></a>
+<span class="sourceLineNo">1567</span><a name="line.1567"></a>
+<span class="sourceLineNo">1568</span>  /**<a name="line.1568"></a>
+<span class="sourceLineNo">1569</span>   * Retrieve Cell's first tag, matching the passed in type<a name="line.1569"></a>
+<span class="sourceLineNo">1570</span>   *<a name="line.1570"></a>
+<span class="sourceLineNo">1571</span>   * @param cell The Cell<a name="line.1571"></a>
+<span class="sourceLineNo">1572</span>   * @param type Type of the Tag to retrieve<a name="line.1572"></a>
+<span class="sourceLineNo">1573</span>   * @return null if there is no tag of the passed in tag type<a name="line.1573"></a>
+<span class="sourceLineNo">1574</span>   */<a name="line.1574"></a>
+<span class="sourceLineNo">1575</span>  public static Tag getTag(Cell cell, byte type){<a name="line.1575"></a>
+<span class="sourceLineNo">1576</span>    boolean bufferBacked = cell instanceof ByteBufferCell;<a name="line.1576"></a>
+<span class="sourceLineNo">1577</span>    int length = cell.getTagsLength();<a name="line.1577"></a>
+<span class="sourceLineNo">1578</span>    int offset = bufferBacked? ((ByteBufferCell)cell).getTagsPosition():cell.getTagsOffset();<a name="line.1578"></a>
+<span class="sourceLineNo">1579</span>    int pos = offset;<a name="line.1579"></a>
+<span class="sourceLineNo">1580</span>    while (pos &lt; offset + length) {<a name="line.1580"></a>
+<span class="sourceLineNo">1581</span>      int tagLen;<a name="line.1581"></a>
+<span class="sourceLineNo">1582</span>      if (bufferBacked) {<a name="line.1582"></a>
+<span class="sourceLineNo">1583</span>        ByteBuffer tagsBuffer = ((ByteBufferCell)cell).getTagsByteBuffer();<a name="line.1583"></a>
+<span class="sourceLineNo">1584</span>        tagLen = ByteBufferUtils.readAsInt(tagsBuffer, pos, TAG_LENGTH_SIZE);<a name="line.1584"></a>
+<span class="sourceLineNo">1585</span>        if (ByteBufferUtils.toByte(tagsBuffer, pos + TAG_LENGTH_SIZE) == type) {<a name="line.1585"></a>
+<span class="sourceLineNo">1586</span>          return new ByteBufferTag(tagsBuffer, pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1586"></a>
+<span class="sourceLineNo">1587</span>        }<a name="line.1587"></a>
+<span class="sourceLineNo">1588</span>      } else {<a name="line.1588"></a>
+<span class="sourceLineNo">1589</span>        tagLen = Bytes.readAsInt(cell.getTagsArray(), pos, TAG_LENGTH_SIZE);<a name="line.1589"></a>
+<span class="sourceLineNo">1590</span>        if (cell.getTagsArray()[pos + TAG_LENGTH_SIZE] == type) {<a name="line.1590"></a>
+<span class="sourceLineNo">1591</span>          return new ArrayBackedTag(cell.getTagsArray(), pos, tagLen + TAG_LENGTH_SIZE);<a name="line.1591"></a>
+<span class="sourceLineNo">1592</span>        }<a name="line.1592"></a>
+<span class="sourceLineNo">1593</span>      }<a name="line.1593"></a>
+<span class="sourceLineNo">1594</span>      pos += TAG_LENGTH_SIZE + tagLen;<a name="line.1594"></a>
+<span class="sourceLineNo">1595</span>    }<a name="line.1595"></a>
+<span class="sourceLineNo">1596</span>    return null;<a name="line.1596"></a>
+<span class="sourceLineNo">1597</span>  }<a name="line.1597"></a>
+<span class="sourceLineNo">1598</span><a name="line.1598"></a>
+<span class="sourceLineNo">1599</span>  /**<a name="line.1599"></a>
+<span class="sourceLineNo">1600</span>   * Returns true if the first range start1...end1 overlaps with the second range<a name="line.1600"></a>
+<span class="sourceLineNo">1601</span>   * start2...end2, assuming the byte arrays represent row keys<a name="line.1601"></a>
+<span class="sourceLineNo">1602</span>   */<a name="line.1602"></a>
+<span class="sourceLineNo">1603</span>  public static boolean overlappingKeys(final byte[] start1, final byte[] end1,<a name="line.1603"></a>
+<span class="sourceLineNo">1604</span>      final byte[] start2, final byte[] end2) {<a name="line.1604"></a>
+<span class="sourceLineNo">1605</span>    return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1,<a name="line.1605"></a>
+<span class="sourceLineNo">1606</span>        end2) &lt; 0)<a name="line.1606"></a>
+<span class="sourceLineNo">1607</span>        &amp;&amp; (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2,<a name="line.1607"></a>
+<span class="sourceLineNo">1608</span>            end1) &lt; 0);<a name="line.1608"></a>
+<span class="sourceLineNo">1609</span>  }<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>   * Sets the given seqId to the cell.<a name="line.1612"></a>
+<span class="sourceLineNo">1613</span>   * Marked as audience Private as of 1.2.0.<a name="line.1613"></a>
+<span class="sourceLineNo">1614</span>   * Setting a Cell sequenceid is an internal implementation detail not for general public use.<a name="line.1614"></a>
+<span class="sourceLineNo">1615</span>   * @param cell<a name="line.1615"></a>
+<span class="sourceLineNo">1616</span>   * @param seqId<a name="line.1616"></a>
+<span class="sourceLineNo">1617</span>   * @throws IOException when the passed cell is not of type {@link SettableSequenceId}<a name="line.1617"></a>
+<span class="sourceLineNo">1618</span>   */<a name="line.1618"></a>
+<span class="sourceLineNo">1619</span>  @InterfaceAudience.Private<a name="line.1619"></a>
+<span class="sourceLineNo">1620</span>  public static void setSequenceId(Cell cell, long seqId) throws IOException {<a name="line.1620"></a>
+<span class="sourceLineNo">1621</span>    if (cell instanceof SettableSequenceId) {<a name="line.1621"></a>
+<span class="sourceLineNo">1622</span>      ((SettableSequenceId) cell).setSequenceId(seqId);<a name="line.1622"></a>
+<span class="sourceLineNo">1623</span>    } else {<a name="line.1623"></a>
+<span class="sourceLineNo">1624</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1624"></a>
+<span class="sourceLineNo">1625</span>          + SettableSequenceId.class.getName()));<a name="line.1625"></a>
+<span class="sourceLineNo">1626</span>    }<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 timestamp to the cell.<a name="line.1630"></a>
+<span class="sourceLineNo">1631</span>   * @param cell<a name="line.1631"></a>
+<span class="sourceLineNo">1632</span>   * @param ts<a name="line.1632"></a>
+<span class="sourceLineNo">1633</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1633"></a>
+<span class="sourceLineNo">1634</span>   */<a name="line.1634"></a>
+<span class="sourceLineNo">1635</span>  public static void setTimestamp(Cell cell, long ts) throws IOException {<a name="line.1635"></a>
+<span class="sourceLineNo">1636</span>    if (cell instanceof SettableTimestamp) {<a name="line.1636"></a>
+<span class="sourceLineNo">1637</span>      ((SettableTimestamp) cell).setTimestamp(ts);<a name="line.1637"></a>
+<span class="sourceLineNo">1638</span>    } else {<a name="line.1638"></a>
+<span class="sourceLineNo">1639</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1639"></a>
+<span class="sourceLineNo">1640</span>          + SettableTimestamp.class.getName()));<a name="line.1640"></a>
+<span class="sourceLineNo">1641</span>    }<a name="line.1641"></a>
+<span class="sourceLineNo">1642</span>  }<a name="line.1642"></a>
+<span class="sourceLineNo">1643</span><a name="line.1643"></a>
+<span class="sourceLineNo">1644</span>  /**<a name="line.1644"></a>
+<span class="sourceLineNo">1645</span>   * Sets the given timestamp to the cell.<a name="line.1645"></a>
+<span class="sourceLineNo">1646</span>   * @param cell<a name="line.1646"></a>
+<span class="sourceLineNo">1647</span>   * @param ts buffer containing the timestamp value<a name="line.1647"></a>
+<span class="sourceLineNo">1648</span>   * @param tsOffset offset to the new timestamp<a name="line.1648"></a>
+<span class="sourceLineNo">1649</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1649"></a>
+<span class="sourceLineNo">1650</span>   */<a name="line.1650"></a>
+<span class="sourceLineNo">1651</span>  public static void setTimestamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1651"></a>
+<span class="sourceLineNo">1652</span>    if (cell instanceof SettableTimestamp) {<a name="line.1652"></a>
+<span class="sourceLineNo">1653</span>      ((SettableTimestamp) cell).setTimestamp(ts, tsOffset);<a name="line.1653"></a>
+<span class="sourceLineNo">1654</span>    } else {<a name="line.1654"></a>
+<span class="sourceLineNo">1655</span>      throw new IOException(new UnsupportedOperationException("Cell is not of type "<a name="line.1655"></a>
+<span class="sourceLineNo">1656</span>          + SettableTimestamp.class.getName()));<a name="line.1656"></a>
+<span class="sourceLineNo">1657</span>    }<a name="line.1657"></a>
+<span class="sourceLineNo">1658</span>  }<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>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1661"></a>
+<span class="sourceLineNo">1662</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1662"></a>
+<span class="sourceLineNo">1663</span>   * @param cell<a name="line.1663"></a>
+<span class="sourceLineNo">1664</span>   * @param ts<a name="line.1664"></a>
+<span class="sourceLineNo">1665</span>   * @return True if cell timestamp is modified.<a name="line.1665"></a>
+<span class="sourceLineNo">1666</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1666"></a>
+<span class="sourceLineNo">1667</span>   */<a name="line.1667"></a>
+<span class="sourceLineNo">1668</span>  public static boolean updateLatestStamp(Cell cell, long ts) throws IOException {<a name="line.1668"></a>
+<span class="sourceLineNo">1669</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1669"></a>
+<span class="sourceLineNo">1670</span>      setTimestamp(cell, ts);<a name="line.1670"></a>
+<span class="sourceLineNo">1671</span>      return true;<a name="line.1671"></a>
+<span class="sourceLineNo">1672</span>    }<a name="line.1672"></a>
+<span class="sourceLineNo">1673</span>    return false;<a name="line.1673"></a>
+<span class="sourceLineNo">1674</span>  }<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>   * Sets the given timestamp to the cell iff current timestamp is<a name="line.1677"></a>
+<span class="sourceLineNo">1678</span>   * {@link HConstants#LATEST_TIMESTAMP}.<a name="line.1678"></a>
+<span class="sourceLineNo">1679</span>   * @param cell<a name="line.1679"></a>
+<span class="sourceLineNo">1680</span>   * @param ts buffer containing the timestamp value<a name="line.1680"></a>
+<span class="sourceLineNo">1681</span>   * @param tsOffset offset to the new timestamp<a name="line.1681"></a>
+<span class="sourceLineNo">1682</span>   * @return True if cell timestamp is modified.<a name="line.1682"></a>
+<span class="sourceLineNo">1683</span>   * @throws IOException when the passed cell is not of type {@link SettableTimestamp}<a name="line.1683"></a>
+<span class="sourceLineNo">1684</span>   */<a name="line.1684"></a>
+<span class="sourceLineNo">1685</span>  public static boolean updateLatestStamp(Cell cell, byte[] ts, int tsOffset) throws IOException {<a name="line.1685"></a>
+<span class="sourceLineNo">1686</span>    if (cell.getTimestamp() == HConstants.LATEST_TIMESTAMP) {<a name="line.1686"></a>
+<span class="sourceLineNo">1687</span>      setTimestamp(cell, ts, tsOffset);<a name="line.1687"></a>
+<span class="sourceLineNo">1688</span>      return true;<a name="line.1688"></a>
+<span class="sourceLineNo">1689</span>    }<a name="line.1689"></a>
+<span class="sourceLineNo">1690</span>    return false;<a name="line.1690"></a>
+<span class="sourceLineNo">1691</span>  }<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>   * Writes the Cell's key part as it would have serialized in a KeyValue. The format is &amp;lt;2 bytes<a name="line.1694"></a>
+<span class="sourceLineNo">1695</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.1695"></a>
+<span class="sourceLineNo">1696</span>   * timestamp&amp;gt;&amp;lt;1 byte type&amp;gt;<a name="line.1696"></a>
+<span class="sourceLineNo">1697</span>   * @param cell<a name="line.1697"></a>
+<span class="sourceLineNo">1698</span>   * @param out<a name="line.1698"></a>
+<span class="sourceLineNo">1699</span>   * @throws IOException<a name="line.1699"></a>
+<span class="sourceLineNo">1700</span>   */<a name="line.1700"></a>
+<span class="sourceLineNo">1701</span>  public static void writeFlatKey(Cell cell, DataOutputStream out) throws IOException {<a name="line.1701"></a>
+<span class="sourceLineNo">1702</span>    short rowLen = cell.getRowLength();<a name="line.1702"></a>
+<span class="sourceLineNo">1703</span>    byte fLen = cell.getFamilyLength();<a name="line.1703"></a>
+<span class="sourceLineNo">1704</span>    int qLen = cell.getQualifierLength();<a name="line.1704"></a>
+<span class="sourceLineNo">1705</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1705"></a>
+<span class="sourceLineNo">1706</span>    // component of cell<a name="line.1706"></a>
+<span class="sourceLineNo">1707</span>    if (cell instanceof ByteBufferCell) {<a name="line.1707"></a>
+<span class="sourceLineNo">1708</span>      out.writeShort(rowLen);<a name="line.1708"></a>
+<span class="sourceLineNo">1709</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1709"></a>
+<span class="sourceLineNo">1710</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1710"></a>
+<span class="sourceLineNo">1711</span>      out.writeByte(fLen);<a name="line.1711"></a>
+<span class="sourceLineNo">1712</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1712"></a>
+<span class="sourceLineNo">1713</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1713"></a>
+<span class="sourceLineNo">1714</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1714"></a>
+<span class="sourceLineNo">1715</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1715"></a>
+<span class="sourceLineNo">1716</span>    } else {<a name="line.1716"></a>
+<span class="sourceLineNo">1717</span>      out.writeShort(rowLen);<a name="line.1717"></a>
+<span class="sourceLineNo">1718</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1718"></a>
+<span class="sourceLineNo">1719</span>      out.writeByte(fLen);<a name="line.1719"></a>
+<span class="sourceLineNo">1720</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1720"></a>
+<span class="sourceLineNo">1721</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1721"></a>
+<span class="sourceLineNo">1722</span>    }<a name="line.1722"></a>
+<span class="sourceLineNo">1723</span>    out.writeLong(cell.getTimestamp());<a name="line.1723"></a>
+<span class="sourceLineNo">1724</span>    out.writeByte(cell.getTypeByte());<a name="line.1724"></a>
+<span class="sourceLineNo">1725</span>  }<a name="line.1725"></a>
+<span class="sourceLineNo">1726</span><a name="line.1726"></a>
+<span class="sourceLineNo">1727</span>  public static int writeFlatKey(Cell cell, OutputStream out) throws IOException {<a name="line.1727"></a>
+<span class="sourceLineNo">1728</span>    short rowLen = cell.getRowLength();<a name="line.1728"></a>
+<span class="sourceLineNo">1729</span>    byte fLen = cell.getFamilyLength();<a name="line.1729"></a>
+<span class="sourceLineNo">1730</span>    int qLen = cell.getQualifierLength();<a name="line.1730"></a>
+<span class="sourceLineNo">1731</span>    // Using just one if/else loop instead of every time checking before writing every<a name="line.1731"></a>
+<span class="sourceLineNo">1732</span>    // component of cell<a name="line.1732"></a>
+<span class="sourceLineNo">1733</span>    if (cell instanceof ByteBufferCell) {<a name="line.1733"></a>
+<span class="sourceLineNo">1734</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1734"></a>
+<span class="sourceLineNo">1735</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1735"></a>
+<span class="sourceLineNo">1736</span>        ((ByteBufferCell) cell).getRowPosition(), rowLen);<a name="line.1736"></a>
+<span class="sourceLineNo">1737</span>      out.write(fLen);<a name="line.1737"></a>
+<span class="sourceLineNo">1738</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getFamilyByteBuffer(),<a name="line.1738"></a>
+<span class="sourceLineNo">1739</span>        ((ByteBufferCell) cell).getFamilyPosition(), fLen);<a name="line.1739"></a>
+<span class="sourceLineNo">1740</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getQualifierByteBuffer(),<a name="line.1740"></a>
+<span class="sourceLineNo">1741</span>        ((ByteBufferCell) cell).getQualifierPosition(), qLen);<a name="line.1741"></a>
+<span class="sourceLineNo">1742</span>    } else {<a name="line.1742"></a>
+<span class="sourceLineNo">1743</span>      StreamUtils.writeShort(out, rowLen);<a name="line.1743"></a>
+<span class="sourceLineNo">1744</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rowLen);<a name="line.1744"></a>
+<span class="sourceLineNo">1745</span>      out.write(fLen);<a name="line.1745"></a>
+<span class="sourceLineNo">1746</span>      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), fLen);<a name="line.1746"></a>
+<span class="sourceLineNo">1747</span>      out.write(cell.getQualifierArray(), cell.getQualifierOffset(), qLen);<a name="line.1747"></a>
+<span class="sourceLineNo">1748</span>    }<a name="line.1748"></a>
+<span class="sourceLineNo">1749</span>    StreamUtils.writeLong(out, cell.getTimestamp());<a name="line.1749"></a>
+<span class="sourceLineNo">1750</span>    out.write(cell.getTypeByte());<a name="line.1750"></a>
+<span class="sourceLineNo">1751</span>    return Bytes.SIZEOF_SHORT + rowLen + Bytes.SIZEOF_BYTE + fLen + qLen + Bytes.SIZEOF_LONG<a name="line.1751"></a>
+<span class="sourceLineNo">1752</span>        + Bytes.SIZEOF_BYTE;<a name="line.1752"></a>
+<span class="sourceLineNo">1753</span>  }<a name="line.1753"></a>
+<span class="sourceLineNo">1754</span><a name="line.1754"></a>
+<span class="sourceLineNo">1755</span>  /**<a name="line.1755"></a>
+<span class="sourceLineNo">1756</span>   * Writes the row from the given cell to the output stream<a name="line.1756"></a>
+<span class="sourceLineNo">1757</span>   * @param out The outputstream to which the data has to be written<a name="line.1757"></a>
+<span class="sourceLineNo">1758</span>   * @param cell The cell whose contents has to be written<a name="line.1758"></a>
+<span class="sourceLineNo">1759</span>   * @param rlength the row length<a name="line.1759"></a>
+<span class="sourceLineNo">1760</span>   * @throws IOException<a name="line.1760"></a>
+<span class="sourceLineNo">1761</span>   */<a name="line.1761"></a>
+<span class="sourceLineNo">1762</span>  public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {<a name="line.1762"></a>
+<span class="sourceLineNo">1763</span>    if (cell instanceof ByteBufferCell) {<a name="line.1763"></a>
+<span class="sourceLineNo">1764</span>      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferCell) cell).getRowByteBuffer(),<a name="line.1764"></a>
+<span class="sourceLineNo">1765</span>        ((ByteBufferCell) cell).getRowPosition(), rlength);<a name="line.1765"></a>
+<span class="sourceLineNo">1766</span>    } else {<a name="line.1766"></a>
+<span class="sourceLineNo">1767</span>      out.write(cell.getRowArray(), cell.getRowOffset(), rlength);<a name="line.1767"></a>
+<span class="sourceLi

<TRUNCATED>

Mime
View raw message