@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
/** * * * <pre> * A Row containing the new contents of all cells modified by the request. * </pre> * * <code>.google.bigtable.v2.Row row = 1;</code> */ public Builder mergeRow(com.google.bigtable.v2.Row value) { if (rowBuilder_ == null) { if (row_ != null) { row_ = com.google.bigtable.v2.Row.newBuilder(row_).mergeFrom(value).buildPartial(); } else { row_ = value; } onChanged(); } else { rowBuilder_.mergeFrom(value); } return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * * * <pre> * A Row containing the new contents of all cells modified by the request. * </pre> * * <code>.google.bigtable.v2.Row row = 1;</code> */ public Builder mergeRow(com.google.bigtable.v2.Row value) { if (rowBuilder_ == null) { if (row_ != null) { row_ = com.google.bigtable.v2.Row.newBuilder(row_).mergeFrom(value).buildPartial(); } else { row_ = value; } onChanged(); } else { rowBuilder_.mergeFrom(value); } return this; } /**
/** * <pre> * A Row containing the new contents of all cells modified by the request. * </pre> * * <code>.google.bigtable.v2.Row row = 1;</code> */ public Builder mergeRow(com.google.bigtable.v2.Row value) { if (rowBuilder_ == null) { if (row_ != null) { row_ = com.google.bigtable.v2.Row.newBuilder(row_).mergeFrom(value).buildPartial(); } else { row_ = value; } onChanged(); } else { rowBuilder_.mergeFrom(value); } return this; } /**
/** * This test ensures that protobuf creation and interactions with {@link BigtableDataClient} work * as expected. * * @throws IOException * @throws InterruptedException */ @Test public void testRead() throws IOException { ByteKey start = ByteKey.copyFrom("a".getBytes(StandardCharsets.UTF_8)); ByteKey end = ByteKey.copyFrom("b".getBytes(StandardCharsets.UTF_8)); when(mockBigtableSource.getRanges()).thenReturn(Arrays.asList(ByteKeyRange.of(start, end))); when(mockBigtableSource.getTableId()).thenReturn(StaticValueProvider.of("table_name")); @SuppressWarnings("unchecked") ResultScanner<Row> mockResultScanner = Mockito.mock(ResultScanner.class); Row expectedRow = Row.newBuilder().setKey(ByteString.copyFromUtf8("a")).build(); when(mockResultScanner.next()).thenReturn(expectedRow).thenReturn(null); when(mockBigtableDataClient.readRows(any(ReadRowsRequest.class))).thenReturn(mockResultScanner); BigtableService.Reader underTest = new BigtableServiceImpl.BigtableReaderImpl(mockSession, mockBigtableSource); underTest.start(); Assert.assertEquals(expectedRow, underTest.getCurrentRow()); Assert.assertFalse(underTest.advance()); underTest.close(); verify(mockResultScanner, times(1)).close(); }
/** Helper function that builds a {@link Row} in a test table that could be returned by read. */ private static Row makeRow(ByteString key, ByteString value) { // Build the currentRow and return true. Column.Builder newColumn = TEST_COLUMN.toBuilder().addCells(Cell.newBuilder().setValue(value)); return Row.newBuilder() .setKey(key) .addFamilies(TEST_FAMILY.toBuilder().addColumns(newColumn)) .build(); }
return null; Row.Builder rowBuilder = Row.newBuilder().setKey(row.getRowKey()); String prevFamily = null; Family.Builder familyBuilder = null;