Skip to content

Commit

Permalink
fix: add feature flag for improved mutate rows throttling (#1912)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 565090488

Source-Link: https://togithub.com/googleapis/googleapis/commit/e8a136feaca2547dd5566ef79841d28f76a80eb5

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/9a8dcca0fb2117628a1a6a6c3625a6aa32fc2f75
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWE4ZGNjYTBmYjIxMTc2MjhhMWE2YTZjMzYyNWE2YWEzMmZjMmY3NSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 13, 2023
1 parent 4ea16f2 commit c5c3211
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
*
*
* <pre>
* Feature flags supported by a client.
* Feature flags supported or enabled by a client.
* This is intended to be sent as part of request metadata to assure the server
* that certain behaviors are safe to enable. This proto is meant to be
* serialized and websafe-base64 encoded under the `bigtable-features` metadata
* key. The value will remain constant for the lifetime of a client and due to
* HTTP2's HPACK compression, the request overhead will be tiny.
* This is an internal implementation detail and should not be used by endusers
* This is an internal implementation detail and should not be used by end users
* directly.
* </pre>
*
Expand Down Expand Up @@ -93,7 +93,8 @@ public boolean getReverseScans() {
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse.
* requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
* this disables partial retries.
* </pre>
*
* <code>bool mutate_rows_rate_limit = 3;</code>
Expand All @@ -105,14 +106,34 @@ public boolean getMutateRowsRateLimit() {
return mutateRowsRateLimit_;
}

public static final int MUTATE_ROWS_RATE_LIMIT2_FIELD_NUMBER = 5;
private boolean mutateRowsRateLimit2_ = false;
/**
*
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse. With partial retries
* enabled.
* </pre>
*
* <code>bool mutate_rows_rate_limit2 = 5;</code>
*
* @return The mutateRowsRateLimit2.
*/
@java.lang.Override
public boolean getMutateRowsRateLimit2() {
return mutateRowsRateLimit2_;
}

public static final int LAST_SCANNED_ROW_RESPONSES_FIELD_NUMBER = 4;
private boolean lastScannedRowResponses_ = false;
/**
*
*
* <pre>
* Notify the server that the client supports the last_scanned_row field
* in ReadRowsResponse for long-running sparse scans.
* in ReadRowsResponse for long-running scans.
* </pre>
*
* <code>bool last_scanned_row_responses = 4;</code>
Expand Down Expand Up @@ -147,6 +168,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (lastScannedRowResponses_ != false) {
output.writeBool(4, lastScannedRowResponses_);
}
if (mutateRowsRateLimit2_ != false) {
output.writeBool(5, mutateRowsRateLimit2_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -165,6 +189,9 @@ public int getSerializedSize() {
if (lastScannedRowResponses_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, lastScannedRowResponses_);
}
if (mutateRowsRateLimit2_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, mutateRowsRateLimit2_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -182,6 +209,7 @@ public boolean equals(final java.lang.Object obj) {

if (getReverseScans() != other.getReverseScans()) return false;
if (getMutateRowsRateLimit() != other.getMutateRowsRateLimit()) return false;
if (getMutateRowsRateLimit2() != other.getMutateRowsRateLimit2()) return false;
if (getLastScannedRowResponses() != other.getLastScannedRowResponses()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
Expand All @@ -198,6 +226,8 @@ public int hashCode() {
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReverseScans());
hash = (37 * hash) + MUTATE_ROWS_RATE_LIMIT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMutateRowsRateLimit());
hash = (37 * hash) + MUTATE_ROWS_RATE_LIMIT2_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getMutateRowsRateLimit2());
hash = (37 * hash) + LAST_SCANNED_ROW_RESPONSES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLastScannedRowResponses());
hash = (29 * hash) + getUnknownFields().hashCode();
Expand Down Expand Up @@ -303,13 +333,13 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Feature flags supported by a client.
* Feature flags supported or enabled by a client.
* This is intended to be sent as part of request metadata to assure the server
* that certain behaviors are safe to enable. This proto is meant to be
* serialized and websafe-base64 encoded under the `bigtable-features` metadata
* key. The value will remain constant for the lifetime of a client and due to
* HTTP2's HPACK compression, the request overhead will be tiny.
* This is an internal implementation detail and should not be used by endusers
* This is an internal implementation detail and should not be used by end users
* directly.
* </pre>
*
Expand Down Expand Up @@ -347,6 +377,7 @@ public Builder clear() {
bitField0_ = 0;
reverseScans_ = false;
mutateRowsRateLimit_ = false;
mutateRowsRateLimit2_ = false;
lastScannedRowResponses_ = false;
return this;
}
Expand Down Expand Up @@ -390,6 +421,9 @@ private void buildPartial0(com.google.bigtable.v2.FeatureFlags result) {
result.mutateRowsRateLimit_ = mutateRowsRateLimit_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.mutateRowsRateLimit2_ = mutateRowsRateLimit2_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.lastScannedRowResponses_ = lastScannedRowResponses_;
}
}
Expand Down Expand Up @@ -445,6 +479,9 @@ public Builder mergeFrom(com.google.bigtable.v2.FeatureFlags other) {
if (other.getMutateRowsRateLimit() != false) {
setMutateRowsRateLimit(other.getMutateRowsRateLimit());
}
if (other.getMutateRowsRateLimit2() != false) {
setMutateRowsRateLimit2(other.getMutateRowsRateLimit2());
}
if (other.getLastScannedRowResponses() != false) {
setLastScannedRowResponses(other.getLastScannedRowResponses());
}
Expand Down Expand Up @@ -489,9 +526,15 @@ public Builder mergeFrom(
case 32:
{
lastScannedRowResponses_ = input.readBool();
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
break;
} // case 32
case 40:
{
mutateRowsRateLimit2_ = input.readBool();
bitField0_ |= 0x00000004;
break;
} // case 40
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -573,7 +616,8 @@ public Builder clearReverseScans() {
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse.
* requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
* this disables partial retries.
* </pre>
*
* <code>bool mutate_rows_rate_limit = 3;</code>
Expand All @@ -589,7 +633,8 @@ public boolean getMutateRowsRateLimit() {
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse.
* requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
* this disables partial retries.
* </pre>
*
* <code>bool mutate_rows_rate_limit = 3;</code>
Expand All @@ -609,7 +654,8 @@ public Builder setMutateRowsRateLimit(boolean value) {
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse.
* requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
* this disables partial retries.
* </pre>
*
* <code>bool mutate_rows_rate_limit = 3;</code>
Expand All @@ -623,13 +669,72 @@ public Builder clearMutateRowsRateLimit() {
return this;
}

private boolean mutateRowsRateLimit2_;
/**
*
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse. With partial retries
* enabled.
* </pre>
*
* <code>bool mutate_rows_rate_limit2 = 5;</code>
*
* @return The mutateRowsRateLimit2.
*/
@java.lang.Override
public boolean getMutateRowsRateLimit2() {
return mutateRowsRateLimit2_;
}
/**
*
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse. With partial retries
* enabled.
* </pre>
*
* <code>bool mutate_rows_rate_limit2 = 5;</code>
*
* @param value The mutateRowsRateLimit2 to set.
* @return This builder for chaining.
*/
public Builder setMutateRowsRateLimit2(boolean value) {

mutateRowsRateLimit2_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse. With partial retries
* enabled.
* </pre>
*
* <code>bool mutate_rows_rate_limit2 = 5;</code>
*
* @return This builder for chaining.
*/
public Builder clearMutateRowsRateLimit2() {
bitField0_ = (bitField0_ & ~0x00000004);
mutateRowsRateLimit2_ = false;
onChanged();
return this;
}

private boolean lastScannedRowResponses_;
/**
*
*
* <pre>
* Notify the server that the client supports the last_scanned_row field
* in ReadRowsResponse for long-running sparse scans.
* in ReadRowsResponse for long-running scans.
* </pre>
*
* <code>bool last_scanned_row_responses = 4;</code>
Expand All @@ -645,7 +750,7 @@ public boolean getLastScannedRowResponses() {
*
* <pre>
* Notify the server that the client supports the last_scanned_row field
* in ReadRowsResponse for long-running sparse scans.
* in ReadRowsResponse for long-running scans.
* </pre>
*
* <code>bool last_scanned_row_responses = 4;</code>
Expand All @@ -656,7 +761,7 @@ public boolean getLastScannedRowResponses() {
public Builder setLastScannedRowResponses(boolean value) {

lastScannedRowResponses_ = value;
bitField0_ |= 0x00000004;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
Expand All @@ -665,15 +770,15 @@ public Builder setLastScannedRowResponses(boolean value) {
*
* <pre>
* Notify the server that the client supports the last_scanned_row field
* in ReadRowsResponse for long-running sparse scans.
* in ReadRowsResponse for long-running scans.
* </pre>
*
* <code>bool last_scanned_row_responses = 4;</code>
*
* @return This builder for chaining.
*/
public Builder clearLastScannedRowResponses() {
bitField0_ = (bitField0_ & ~0x00000004);
bitField0_ = (bitField0_ & ~0x00000008);
lastScannedRowResponses_ = false;
onChanged();
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public interface FeatureFlagsOrBuilder
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse.
* requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons,
* this disables partial retries.
* </pre>
*
* <code>bool mutate_rows_rate_limit = 3;</code>
Expand All @@ -51,12 +52,27 @@ public interface FeatureFlagsOrBuilder
*/
boolean getMutateRowsRateLimit();

/**
*
*
* <pre>
* Notify the server that the client enables batch write flow control by
* requesting RateLimitInfo from MutateRowsResponse. With partial retries
* enabled.
* </pre>
*
* <code>bool mutate_rows_rate_limit2 = 5;</code>
*
* @return The mutateRowsRateLimit2.
*/
boolean getMutateRowsRateLimit2();

/**
*
*
* <pre>
* Notify the server that the client supports the last_scanned_row field
* in ReadRowsResponse for long-running sparse scans.
* in ReadRowsResponse for long-running scans.
* </pre>
*
* <code>bool last_scanned_row_responses = 4;</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
static {
java.lang.String[] descriptorData = {
"\n&google/bigtable/v2/feature_flags.proto"
+ "\022\022google.bigtable.v2\"i\n\014FeatureFlags\022\025\n\r"
+ "reverse_scans\030\001 \001(\010\022\036\n\026mutate_rows_rate_"
+ "limit\030\003 \001(\010\022\"\n\032last_scanned_row_response"
+ "s\030\004 \001(\010B\275\001\n\026com.google.bigtable.v2B\021Feat"
+ "ureFlagsProtoP\001Z:google.golang.org/genpr"
+ "oto/googleapis/bigtable/v2;bigtable\252\002\030Go"
+ "ogle.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\Bi"
+ "gtable\\V2\352\002\033Google::Cloud::Bigtable::V2b"
+ "\006proto3"
+ "\022\022google.bigtable.v2\"\212\001\n\014FeatureFlags\022\025\n"
+ "\rreverse_scans\030\001 \001(\010\022\036\n\026mutate_rows_rate"
+ "_limit\030\003 \001(\010\022\037\n\027mutate_rows_rate_limit2\030"
+ "\005 \001(\010\022\"\n\032last_scanned_row_responses\030\004 \001("
+ "\010B\275\001\n\026com.google.bigtable.v2B\021FeatureFla"
+ "gsProtoP\001Z:google.golang.org/genproto/go"
+ "ogleapis/bigtable/v2;bigtable\252\002\030Google.C"
+ "loud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable"
+ "\\V2\352\002\033Google::Cloud::Bigtable::V2b\006proto"
+ "3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand All @@ -60,7 +61,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_bigtable_v2_FeatureFlags_descriptor,
new java.lang.String[] {
"ReverseScans", "MutateRowsRateLimit", "LastScannedRowResponses",
"ReverseScans",
"MutateRowsRateLimit",
"MutateRowsRateLimit2",
"LastScannedRowResponses",
});
}

Expand Down
Loading

0 comments on commit c5c3211

Please sign in to comment.