Skip to content

Commit

Permalink
fix: rename response observer and callbacks (#1291)
Browse files Browse the repository at this point in the history
Rename HeaderTracer* to BigtableTracer*
  • Loading branch information
mutianf authored Jun 29, 2022
1 parent a4c6621 commit 2705a47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ public void call(
final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata();
// tracer should always be an instance of bigtable tracer
if (context.getTracer() instanceof BigtableTracer) {
HeaderTracerResponseObserver<ResponseT> innerObserver =
new HeaderTracerResponseObserver<>(
BigtableTracerResponseObserver<ResponseT> innerObserver =
new BigtableTracerResponseObserver<>(
responseObserver, (BigtableTracer) context.getTracer(), responseMetadata);
innerCallable.call(request, innerObserver, responseMetadata.addHandlers(context));
} else {
innerCallable.call(request, responseObserver, context);
}
}

private class HeaderTracerResponseObserver<ResponseT> implements ResponseObserver<ResponseT> {
private class BigtableTracerResponseObserver<ResponseT> implements ResponseObserver<ResponseT> {

private final BigtableTracer tracer;
private final ResponseObserver<ResponseT> outerObserver;
private final GrpcResponseMetadata responseMetadata;

HeaderTracerResponseObserver(
BigtableTracerResponseObserver(
ResponseObserver<ResponseT> observer,
BigtableTracer tracer,
GrpcResponseMetadata metadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) {
if (context.getTracer() instanceof BigtableTracer) {
final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata();
final ApiCallContext contextWithResponseMetadata = responseMetadata.addHandlers(context);
HeaderTracerUnaryCallback callback =
new HeaderTracerUnaryCallback((BigtableTracer) context.getTracer(), responseMetadata);
BigtableTracerUnaryCallback callback =
new BigtableTracerUnaryCallback((BigtableTracer) context.getTracer(), responseMetadata);
ApiFuture<ResponseT> future = innerCallable.futureCall(request, contextWithResponseMetadata);
ApiFutures.addCallback(future, callback, MoreExecutors.directExecutor());
return future;
Expand All @@ -63,12 +63,12 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) {
}
}

class HeaderTracerUnaryCallback<ResponseT> implements ApiFutureCallback<ResponseT> {
class BigtableTracerUnaryCallback<ResponseT> implements ApiFutureCallback<ResponseT> {

private final BigtableTracer tracer;
private final GrpcResponseMetadata responseMetadata;

HeaderTracerUnaryCallback(BigtableTracer tracer, GrpcResponseMetadata responseMetadata) {
BigtableTracerUnaryCallback(BigtableTracer tracer, GrpcResponseMetadata responseMetadata) {
this.tracer = tracer;
this.responseMetadata = responseMetadata;
}
Expand Down

0 comments on commit 2705a47

Please sign in to comment.