Skip to content

Commit

Permalink
feat: enable last_scanned_row_responses feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
steveniemitz committed Jul 27, 2023
1 parent eabcf88 commit 13b6839
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Expand Up @@ -731,7 +731,8 @@ private Builder() {
.setTotalTimeout(PRIME_REQUEST_TIMEOUT)
.build());

featureFlags = FeatureFlags.newBuilder().setReverseScans(true);
featureFlags =
FeatureFlags.newBuilder().setReverseScans(true).setLastScannedRowResponses(true);
}

private Builder(EnhancedBigtableStubSettings settings) {
Expand Down
Expand Up @@ -243,6 +243,7 @@ public void testFeatureFlags() throws InterruptedException, IOException, Executi
FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedFeatureFlags));

assertThat(featureFlags.getReverseScans()).isTrue();
assertThat(featureFlags.getLastScannedRowResponses()).isTrue();
}

@Test
Expand Down
Expand Up @@ -42,9 +42,18 @@
public class RowMergingCallableTest {
@Test
public void scanMarker() {
ReadRowsResponse.Builder rrr = ReadRowsResponse.newBuilder();
rrr.addChunksBuilder()
.setRowKey(ByteString.copyFromUtf8("key0"))
.setFamilyName(StringValue.of("f1"))
.setQualifier(BytesValue.of(ByteString.copyFromUtf8("q1")))
.setCommitRow(true);

FakeStreamingApi.ServerStreamingStashCallable<ReadRowsRequest, ReadRowsResponse> inner =
new ServerStreamingStashCallable<>(
Lists.newArrayList(
// send a row
rrr.build(),
// send a scan marker
ReadRowsResponse.newBuilder()
.setLastScannedRowKey(ByteString.copyFromUtf8("key1"))
Expand All @@ -56,6 +65,15 @@ public void scanMarker() {

Truth.assertThat(results)
.containsExactly(
Row.create(
ByteString.copyFromUtf8("key0"),
Lists.newArrayList(
RowCell.create(
"f1",
ByteString.copyFromUtf8("q1"),
0,
Lists.newArrayList(),
ByteString.EMPTY))),
Row.create(ByteString.copyFromUtf8("key1"), Lists.<RowCell>newArrayList()));
}

Expand Down

0 comments on commit 13b6839

Please sign in to comment.