Search in sources :

Example 1 with TracedServerStreamingCallable

use of com.google.api.gax.tracing.TracedServerStreamingCallable in project java-bigtable by googleapis.

the class EnhancedBigtableStub method createReadRowsCallable.

/**
 * Creates a callable chain to handle streaming ReadRows RPCs. The chain will:
 *
 * <ul>
 *   <li>Convert a {@link Query} into a {@link com.google.bigtable.v2.ReadRowsRequest} and
 *       dispatch the RPC.
 *   <li>Upon receiving the response stream, it will merge the {@link
 *       com.google.bigtable.v2.ReadRowsResponse.CellChunk}s in logical rows. The actual row
 *       implementation can be configured in by the {@code rowAdapter} parameter.
 *   <li>Retry/resume on failure.
 *   <li>Filter out marker rows.
 *   <li>Add tracing & metrics.
 * </ul>
 */
public <RowT> ServerStreamingCallable<Query, RowT> createReadRowsCallable(RowAdapter<RowT> rowAdapter) {
    ServerStreamingCallable<ReadRowsRequest, RowT> readRowsCallable = createReadRowsBaseCallable(settings.readRowsSettings(), rowAdapter);
    ServerStreamingCallable<Query, RowT> readRowsUserCallable = new ReadRowsUserCallable<>(readRowsCallable, requestContext);
    SpanName span = getSpanName("ReadRows");
    ServerStreamingCallable<Query, RowT> traced = new TracedServerStreamingCallable<>(readRowsUserCallable, clientContext.getTracerFactory(), span);
    return traced.withDefaultCallContext(clientContext.getDefaultCallContext());
}
Also used : ReadRowsUserCallable(com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsUserCallable) SpanName(com.google.api.gax.tracing.SpanName) TracedServerStreamingCallable(com.google.api.gax.tracing.TracedServerStreamingCallable) Query(com.google.cloud.bigtable.data.v2.models.Query) ReadRowsRequest(com.google.bigtable.v2.ReadRowsRequest)

Aggregations

SpanName (com.google.api.gax.tracing.SpanName)1 TracedServerStreamingCallable (com.google.api.gax.tracing.TracedServerStreamingCallable)1 ReadRowsRequest (com.google.bigtable.v2.ReadRowsRequest)1 Query (com.google.cloud.bigtable.data.v2.models.Query)1 ReadRowsUserCallable (com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsUserCallable)1