|
70 | 70 | import com.google.cloud.bigtable.data.v2.models.RowAdapter; |
71 | 71 | import com.google.cloud.bigtable.data.v2.models.RowMutation; |
72 | 72 | import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; |
| 73 | +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracerStreamingCallable; |
| 74 | +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracerUnaryCallable; |
73 | 75 | import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTracerFactory; |
74 | 76 | import com.google.cloud.bigtable.data.v2.stub.metrics.CompositeTracerFactory; |
75 | | -import com.google.cloud.bigtable.data.v2.stub.metrics.HeaderTracerStreamingCallable; |
76 | | -import com.google.cloud.bigtable.data.v2.stub.metrics.HeaderTracerUnaryCallable; |
77 | 77 | import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsTracerFactory; |
78 | 78 | import com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants; |
79 | 79 | import com.google.cloud.bigtable.data.v2.stub.metrics.StatsHeadersServerStreamingCallable; |
@@ -377,7 +377,7 @@ public <RowT> UnaryCallable<Query, RowT> createReadRowCallable(RowAdapter<RowT> |
377 | 377 | * <li>Upon receiving the response stream, it will merge the {@link |
378 | 378 | * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row |
379 | 379 | * implementation can be configured by the {@code rowAdapter} parameter. |
380 | | - * <li>Add header tracer for tracking GFE metrics. |
| 380 | + * <li>Add bigtable tracer for tracking bigtable specific metrics. |
381 | 381 | * <li>Retry/resume on failure. |
382 | 382 | * <li>Filter out marker rows. |
383 | 383 | * </ul> |
@@ -428,13 +428,13 @@ public Map<String, String> extract(ReadRowsRequest readRowsRequest) { |
428 | 428 | ServerStreamingCallable<ReadRowsRequest, RowT> watched = |
429 | 429 | Callables.watched(merging, innerSettings, clientContext); |
430 | 430 |
|
431 | | - ServerStreamingCallable<ReadRowsRequest, RowT> withHeaderTracer = |
432 | | - new HeaderTracerStreamingCallable<>(watched); |
| 431 | + ServerStreamingCallable<ReadRowsRequest, RowT> withBigtableTracer = |
| 432 | + new BigtableTracerStreamingCallable<>(watched); |
433 | 433 |
|
434 | 434 | // Retry logic is split into 2 parts to workaround a rare edge case described in |
435 | 435 | // ReadRowsRetryCompletedCallable |
436 | 436 | ServerStreamingCallable<ReadRowsRequest, RowT> retrying1 = |
437 | | - new ReadRowsRetryCompletedCallable<>(withHeaderTracer); |
| 437 | + new ReadRowsRetryCompletedCallable<>(withBigtableTracer); |
438 | 438 |
|
439 | 439 | ServerStreamingCallable<ReadRowsRequest, RowT> retrying2 = |
440 | 440 | Callables.retrying(retrying1, innerSettings, clientContext); |
@@ -473,11 +473,11 @@ private <RowT> UnaryCallable<Query, List<RowT>> createBulkReadRowsCallable( |
473 | 473 | UnaryCallable<Query, List<RowT>> tracedBatcher = |
474 | 474 | new TracedBatcherUnaryCallable<>(readRowsUserCallable.all()); |
475 | 475 |
|
476 | | - UnaryCallable<Query, List<RowT>> withHeaderTracer = |
477 | | - new HeaderTracerUnaryCallable<>(tracedBatcher); |
| 476 | + UnaryCallable<Query, List<RowT>> withBigtableTracer = |
| 477 | + new BigtableTracerUnaryCallable<>(tracedBatcher); |
478 | 478 |
|
479 | 479 | UnaryCallable<Query, List<RowT>> traced = |
480 | | - new TracedUnaryCallable<>(withHeaderTracer, clientContext.getTracerFactory(), span); |
| 480 | + new TracedUnaryCallable<>(withBigtableTracer, clientContext.getTracerFactory(), span); |
481 | 481 |
|
482 | 482 | return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); |
483 | 483 | } |
@@ -519,11 +519,11 @@ public Map<String, String> extract( |
519 | 519 | UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> withStatsHeaders = |
520 | 520 | new StatsHeadersUnaryCallable<>(spoolable); |
521 | 521 |
|
522 | | - UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> withHeaderTracer = |
523 | | - new HeaderTracerUnaryCallable<>(withStatsHeaders); |
| 522 | + UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> withBigtableTracer = |
| 523 | + new BigtableTracerUnaryCallable<>(withStatsHeaders); |
524 | 524 |
|
525 | 525 | UnaryCallable<SampleRowKeysRequest, List<SampleRowKeysResponse>> retryable = |
526 | | - Callables.retrying(withHeaderTracer, settings.sampleRowKeysSettings(), clientContext); |
| 526 | + Callables.retrying(withBigtableTracer, settings.sampleRowKeysSettings(), clientContext); |
527 | 527 |
|
528 | 528 | return createUserFacingUnaryCallable( |
529 | 529 | methodName, new SampleRowKeysCallable(retryable, requestContext)); |
@@ -558,11 +558,11 @@ public Map<String, String> extract(MutateRowRequest mutateRowRequest) { |
558 | 558 | UnaryCallable<MutateRowRequest, MutateRowResponse> withStatsHeaders = |
559 | 559 | new StatsHeadersUnaryCallable<>(base); |
560 | 560 |
|
561 | | - UnaryCallable<MutateRowRequest, MutateRowResponse> withHeaderTracer = |
562 | | - new HeaderTracerUnaryCallable<>(withStatsHeaders); |
| 561 | + UnaryCallable<MutateRowRequest, MutateRowResponse> withBigtableTracer = |
| 562 | + new BigtableTracerUnaryCallable<>(withStatsHeaders); |
563 | 563 |
|
564 | 564 | UnaryCallable<MutateRowRequest, MutateRowResponse> retrying = |
565 | | - Callables.retrying(withHeaderTracer, settings.mutateRowSettings(), clientContext); |
| 565 | + Callables.retrying(withBigtableTracer, settings.mutateRowSettings(), clientContext); |
566 | 566 |
|
567 | 567 | return createUserFacingUnaryCallable( |
568 | 568 | methodName, new MutateRowCallable(retrying, requestContext)); |
@@ -605,10 +605,10 @@ private UnaryCallable<BulkMutation, Void> createBulkMutateRowsCallable() { |
605 | 605 | UnaryCallable<BulkMutation, Void> tracedBatcherUnaryCallable = |
606 | 606 | new TracedBatcherUnaryCallable<>(userFacing); |
607 | 607 |
|
608 | | - UnaryCallable<BulkMutation, Void> withHeaderTracer = |
609 | | - new HeaderTracerUnaryCallable<>(tracedBatcherUnaryCallable); |
| 608 | + UnaryCallable<BulkMutation, Void> withBigtableTracer = |
| 609 | + new BigtableTracerUnaryCallable<>(tracedBatcherUnaryCallable); |
610 | 610 | UnaryCallable<BulkMutation, Void> traced = |
611 | | - new TracedUnaryCallable<>(withHeaderTracer, clientContext.getTracerFactory(), spanName); |
| 611 | + new TracedUnaryCallable<>(withBigtableTracer, clientContext.getTracerFactory(), spanName); |
612 | 612 |
|
613 | 613 | return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); |
614 | 614 | } |
@@ -746,11 +746,11 @@ public Map<String, String> extract( |
746 | 746 | UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> withStatsHeaders = |
747 | 747 | new StatsHeadersUnaryCallable<>(base); |
748 | 748 |
|
749 | | - UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> withHeaderTracer = |
750 | | - new HeaderTracerUnaryCallable<>(withStatsHeaders); |
| 749 | + UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> withBigtableTracer = |
| 750 | + new BigtableTracerUnaryCallable<>(withStatsHeaders); |
751 | 751 |
|
752 | 752 | UnaryCallable<CheckAndMutateRowRequest, CheckAndMutateRowResponse> retrying = |
753 | | - Callables.retrying(withHeaderTracer, settings.checkAndMutateRowSettings(), clientContext); |
| 753 | + Callables.retrying(withBigtableTracer, settings.checkAndMutateRowSettings(), clientContext); |
754 | 754 |
|
755 | 755 | return createUserFacingUnaryCallable( |
756 | 756 | methodName, new CheckAndMutateRowCallable(retrying, requestContext)); |
@@ -787,11 +787,12 @@ public Map<String, String> extract(ReadModifyWriteRowRequest request) { |
787 | 787 | new StatsHeadersUnaryCallable<>(base); |
788 | 788 |
|
789 | 789 | String methodName = "ReadModifyWriteRow"; |
790 | | - UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> withHeaderTracer = |
791 | | - new HeaderTracerUnaryCallable<>(withStatsHeaders); |
| 790 | + UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> withBigtableTracer = |
| 791 | + new BigtableTracerUnaryCallable<>(withStatsHeaders); |
792 | 792 |
|
793 | 793 | UnaryCallable<ReadModifyWriteRowRequest, ReadModifyWriteRowResponse> retrying = |
794 | | - Callables.retrying(withHeaderTracer, settings.readModifyWriteRowSettings(), clientContext); |
| 794 | + Callables.retrying( |
| 795 | + withBigtableTracer, settings.readModifyWriteRowSettings(), clientContext); |
795 | 796 |
|
796 | 797 | return createUserFacingUnaryCallable( |
797 | 798 | methodName, new ReadModifyWriteRowCallable(retrying, requestContext)); |
|
0 commit comments