Search in sources :

Example 16 with RowCell

use of com.google.cloud.bigtable.hbase.adapters.read.RowCell in project java-bigtable-hbase by googleapis.

the class TestRowResultAdapter method testReset.

@Test
public void testReset() {
    RowAdapter.RowBuilder<Result> rowBuilder = underTest.createRowBuilder();
    rowBuilder.startRow(ROW_KEY);
    rowBuilder.startCell(COL_FAMILY, QUAL_ONE, 10000L, Collections.<String>emptyList(), VALUE.size());
    rowBuilder.cellValue(VALUE);
    rowBuilder.finishCell();
    rowBuilder.reset();
    ByteString anotherKey = ByteString.copyFromUtf8("another-rowKey");
    rowBuilder.startRow(anotherKey);
    rowBuilder.startCell(COL_FAMILY, QUAL_TWO, 40000L, LABELS, VALUE.size());
    rowBuilder.cellValue(VALUE);
    rowBuilder.finishCell();
    Result actual = rowBuilder.finishRow();
    assertResult(Result.create(ImmutableList.<Cell>of(new RowCell(anotherKey.toByteArray(), COL_FAMILY.getBytes(), QUAL_TWO.toByteArray(), 40L, VALUE.toByteArray()))), actual);
}
Also used : RowAdapter(com.google.cloud.bigtable.data.v2.models.RowAdapter) ByteString(com.google.protobuf.ByteString) RowCell(com.google.cloud.bigtable.hbase.adapters.read.RowCell) RowCell(com.google.cloud.bigtable.hbase.adapters.read.RowCell) Cell(org.apache.hadoop.hbase.Cell) Result(org.apache.hadoop.hbase.client.Result) Test(org.junit.Test)

Aggregations

RowCell (com.google.cloud.bigtable.hbase.adapters.read.RowCell)16 Result (org.apache.hadoop.hbase.client.Result)15 Test (org.junit.Test)15 ByteString (com.google.protobuf.ByteString)9 Get (org.apache.hadoop.hbase.client.Get)5 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)5 RowAdapter (com.google.cloud.bigtable.data.v2.models.RowAdapter)4 Cell (org.apache.hadoop.hbase.Cell)3 QualifierFilter (org.apache.hadoop.hbase.filter.QualifierFilter)3 Filters (com.google.cloud.bigtable.data.v2.models.Filters)2 Query (com.google.cloud.bigtable.data.v2.models.Query)2 Scan (org.apache.hadoop.hbase.client.Scan)2 BinaryComparator (org.apache.hadoop.hbase.filter.BinaryComparator)2 WhileMatchFilter (org.apache.hadoop.hbase.filter.WhileMatchFilter)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 ApiFuture (com.google.api.core.ApiFuture)1 ImmutableList (com.google.common.collect.ImmutableList)1 ArrayList (java.util.ArrayList)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 RetriesExhaustedWithDetailsException (org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException)1