@Test public void testBasicRowKeyAppend() { byte[] rowKey = dataHelper.randomData("rk1-"); Append append = new Append(rowKey); ReadModifyWriteRow readModifyWriteRow = ReadModifyWriteRow.create(TABLE_ID, ByteString.copyFrom(rowKey)); appendAdapter.adapt(append, readModifyWriteRow); ReadModifyWriteRowRequest request = readModifyWriteRow.toProto(requestContext); ByteString adaptedRowKey = request.getRowKey(); Assert.assertArrayEquals(rowKey, adaptedRowKey.toByteArray()); }
@Override public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { readModifyWriteRow.append( familyName, ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()), ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } }
AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRow> { @Override public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { readModifyWriteRow.append( familyName, ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()), ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } } }
AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRow> { @Override public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { readModifyWriteRow.append( familyName, ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()), ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } }  }
AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRow> { @Override public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { readModifyWriteRow.append( familyName, ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()), ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } }  @Override void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow); }
AppendAdapter implements OperationAdapter<Append, ReadModifyWriteRow> { @Override public void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow) { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { readModifyWriteRow.append( familyName, ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength()), ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } }  @Override void adapt(Append operation, ReadModifyWriteRow readModifyWriteRow);  }