@Override
  public void adapt(Increment operation, ReadModifyWriteRow readModifyWriteRow) {
    if (!operation.getTimeRange().isAllTime()) {
      throw new UnsupportedOperationException(
          "Setting the time range in an Increment is not implemented");
    }

    for (Map.Entry<byte[], NavigableMap<byte[], Long>> familyEntry :
        operation.getFamilyMapOfLongs().entrySet()) {
      String familyName = Bytes.toString(familyEntry.getKey());
      // Bigtable applies all increments present in a single RPC. HBase applies only the last
      // mutation present, if any. We remove all but the last mutation for each qualifier here:
      List<Cell> mutationCells =
          CellDeduplicationHelper.deduplicateFamily(operation, familyEntry.getKey());

      for (Cell cell : mutationCells) {
        readModifyWriteRow.increment(
            familyName,
            ByteString.copyFrom(
                cell.getQualifierArray(),
                cell.getQualifierOffset(),
                cell.getQualifierLength()),
            Bytes.toLong(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())
        );
      }
    }
  }
@ Override public void adapt ( Increment operation , ReadModifyWriteRow readModifyWriteRow ) { if ( ! operation . getTimeRange ( ) . isAllTime ( ) ) { throw new UnsupportedOperationException ( "Setting the time range in an Increment is not implemented" ) ; } for ( Map . Entry < byte [ ] , NavigableMap < byte [ ] , Long > > familyEntry : operation . getFamilyMapOfLongs ( ) . entrySet ( ) ) { String familyName = Bytes . toString ( familyEntry . getKey ( ) ) ; List < Cell > mutationCells = CellDeduplicationHelper . deduplicateFamily ( operation , familyEntry . getKey ( ) ) ; for ( Cell cell : mutationCells ) { readModifyWriteRow . increment ( familyName , ByteString . copyFrom ( cell . getQualifierArray ( ) , cell . getQualifierOffset ( ) , cell . getQualifierLength ( ) ) , Bytes . toLong ( cell . getValueArray ( ) , cell . getValueOffset ( ) , cell . getValueLength ( ) ) ) ; } } }
{@inheritDoc}