Skip to content

Conversation

@kongweihan
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Rollback plan is reviewed and LGTMed
  • All new data plane features have a completed end to end testing plan

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@kongweihan kongweihan requested review from a team as code owners October 6, 2025 16:18
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable API. labels Oct 6, 2025
@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch 2 times, most recently from 2ca884e to b4006a2 Compare October 6, 2025 16:54
@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch from b4006a2 to e8a246f Compare October 7, 2025 03:03
@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch from e8a246f to ae0ed5a Compare October 8, 2025 14:27
@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch 7 times, most recently from 7d3fdd2 to 5f07efc Compare December 10, 2025 00:37
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Dec 10, 2025
// closing the batcher to trigger the third flush
batcher.close();

MetricData applicationLatency = getMetricData(metricReader, BATCH_WRITE_FLOW_CONTROL_TARGET_QPS_NAME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MetricData applicationLatency = getMetricData(metricReader, BATCH_WRITE_FLOW_CONTROL_TARGET_QPS_NAME);
MetricData targetQps = getMetricData(metricReader, BATCH_WRITE_FLOW_CONTROL_TARGET_QPS_NAME);

}
builder.addEntriesBuilder().setIndex(i);

com.google.protobuf.Duration duration = builder.getRateLimitInfoBuilder().getPeriodBuilder().setSeconds(10).build();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you import com.google.bigtable.v2.RateLimitInfo so we don't need to write the full path here?

@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch 2 times, most recently from 6169b3c to 8e84e9f Compare December 11, 2025 21:16
@kongweihan kongweihan force-pushed the csm-batch-write-flow-control branch from 8e84e9f to 7981240 Compare December 11, 2025 22:36
Copy link
Contributor

@mutianf mutianf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding the tests, left some more nits but otherwise looks good!

import io.opentelemetry.sdk.metrics.InstrumentSelector;
import io.opentelemetry.sdk.metrics.InstrumentType;
import io.opentelemetry.sdk.metrics.View;
import io.opentelemetry.sdk.metrics.*;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here also, no import *

*/
package com.google.cloud.bigtable.data.v2.stub;

import static com.google.cloud.bigtable.data.v2.stub.metrics.Util.extractStatus;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this import anymore? You can run mvn com.spotify.fmt:fmt-maven-plugin:format and that should clean up the unused imports.


/** Convert an exception into a value that can be used to create an OpenCensus tag value. */
static String extractStatus(@Nullable Throwable error) {
public static String extractStatus(@Nullable Throwable error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't need to be public now

.collect(Collectors.toList())
.get(0);
return hd.getSum() / hd.getCount();
case LONG_SUM:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this right? this is long_sum, how could the value be double?

batcher.add(
RowMutationEntry.create("batch-write-flow-control-success-12").setCell("f", "q", "v"));

// closing the batcher to trigger the third flush
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// closing the batcher to trigger the third flush
// closing the batcher to trigger the flush

batcher.add(
RowMutationEntry.create("batch-write-flow-control-success-08").setCell("f", "q", "v"));

// closing the batcher to trigger the third flush
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// closing the batcher to trigger the third flush
// closing the batcher to trigger the flush

batcher.add(
RowMutationEntry.create("batch-write-flow-control-success-18").setCell("f", "q", "v"));

// closing the batcher to trigger the third flush
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// closing the batcher to trigger the third flush
// closing the batcher to trigger the flush

batcher.add(
RowMutationEntry.create("batch-write-flow-control-success-05").setCell("f", "q", "v"));

// closing the batcher to trigger the third flush
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// closing the batcher to trigger the third flush
// closing the batcher to trigger the flush

RowMutationEntry.create("batch-write-flow-control-fail-unavailable")
.setCell("f", "q", "v"));

// closing the batcher to trigger the third flush
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// closing the batcher to trigger the third flush
// closing the batcher to trigger the flush


// Add RateLimitInfo for Batch Write Flow Control
if (receivedRowkey.equals("batch-write-flow-control-success-18")) {
com.google.protobuf.Duration duration =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can probably build the duration outside of the if statements to simplify the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants