use of com.google.bigtable.v1.RowFilter in project beam by apache.
the class BigtableIOTest method testReadingDisplayData.
@Test
public void testReadingDisplayData() {
RowFilter rowFilter = RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8("foo.*")).build();
ByteKeyRange keyRange = ByteKeyRange.ALL_KEYS.withEndKey(ByteKey.of(0xab, 0xcd));
BigtableIO.Read read = BigtableIO.read().withBigtableOptions(BIGTABLE_OPTIONS).withTableId("fooTable").withRowFilter(rowFilter).withKeyRange(keyRange);
DisplayData displayData = DisplayData.from(read);
assertThat(displayData, hasDisplayItem(allOf(hasKey("tableId"), hasLabel("Table ID"), hasValue("fooTable"))));
assertThat(displayData, hasDisplayItem("rowFilter", rowFilter.toString()));
assertThat(displayData, hasDisplayItem("keyRange", keyRange.toString()));
// BigtableIO adds user-agent to options; assert only on key and not value.
assertThat(displayData, hasDisplayItem("bigtableOptions"));
}
Aggregations