Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.bigtable.data.v2.models.BulkMutation;
import com.google.cloud.bigtable.data.v2.models.BulkMutationBatcher;
import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation;
import com.google.cloud.bigtable.data.v2.models.Filters.Filter;
import com.google.cloud.bigtable.data.v2.models.KeyOffset;
Expand Down Expand Up @@ -868,16 +867,10 @@ public UnaryCallable<RowMutation, Void> mutateRowCallable() {
return stub.mutateRowCallable();
}

/** @deprecated Please use {@link #newBulkMutationBatcher(String)} API. */
@Deprecated
public BulkMutationBatcher newBulkMutationBatcher() {
return new BulkMutationBatcher(stub.bulkMutateRowsBatchingCallable());
}

/**
* Convenience method to mutate multiple rows in a batch. Each individual row is mutated
* atomically as in MutateRow, but the entire batch is not executed atomically. Unlike {@link
* #newBulkMutationBatcher()}, this method expects the mutations to be pre-batched.
* atomically as in MutateRow, but the entire batch is not executed atomically. This method
* expects the mutations to be pre-batched.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -933,8 +926,8 @@ public Batcher<RowMutationEntry, Void> newBulkMutationBatcher(@Nonnull String ta

/**
* Convenience method to mutate multiple rows in a batch. Each individual row is mutated
* atomically as in MutateRow, but the entire batch is not executed atomically. Unlike {@link
* #newBulkMutationBatcher()}, this method expects the mutations to be pre-batched.
* atomically as in MutateRow, but the entire batch is not executed atomically. This method
* expects the mutations to be pre-batched.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -968,8 +961,8 @@ public ApiFuture<Void> bulkMutateRowsAsync(BulkMutation mutation) {

/**
* Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow,
* but the entire batch is not executed atomically. Unlike {@link #newBulkMutationBatcher()}, this
* method expects the mutations to be pre-batched.
* but the entire batch is not executed atomically. This method expects the mutations to be
* pre-batched.
*
* <p>Sample code:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder input) {
}

/**
* Enables Opencensus metric aggregations.
* Enables OpenCensus metric aggregations.
*
* <p>This will register Bigtable client relevant {@link io.opencensus.stats.View}s. When coupled
* with an exporter, it allows users to monitor client behavior.
Expand Down Expand Up @@ -159,7 +159,7 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder input) {
* BigtableDataSettings.enableOpenCensusStats();
* }</pre>
*/
@BetaApi("Opencensus stats integration is currently unstable and may change in the future")
@BetaApi("OpenCensus stats integration is currently unstable and may change in the future")
public static void enableOpenCensusStats() {
com.google.cloud.bigtable.data.v2.stub.metrics.RpcViews.registerBigtableClientViews();
// TODO(igorbernstein): Enable grpc views once we upgrade to grpc-java 1.24.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
* Represents a list of mutations for multiple rows. Each mutation contains multiple changes that
* will be atomically applied to each row. However, ordering between rows is not guaranteed.
*
* <p>This class is meant for manual batching, while {@link BulkMutationBatcher} is meant for
* automatic batching with flow control.
* <p>This class is meant for manual batching.
*/
public final class BulkMutation implements Serializable, Cloneable {
private static final long serialVersionUID = 3522061250439399088L;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
import com.google.api.gax.retrying.RetryAlgorithm;
import com.google.api.gax.retrying.RetryingExecutorWithContext;
import com.google.api.gax.retrying.ScheduledRetryingExecutor;
import com.google.api.gax.rpc.BatchingCallSettings;
import com.google.api.gax.rpc.Callables;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ServerStreamingCallSettings;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.api.gax.tracing.SpanName;
import com.google.api.gax.tracing.TracedBatchingCallable;
import com.google.api.gax.tracing.TracedServerStreamingCallable;
import com.google.api.gax.tracing.TracedUnaryCallable;
import com.google.bigtable.v2.MutateRowsRequest;
Expand All @@ -48,14 +46,11 @@
import com.google.cloud.bigtable.data.v2.models.RowMutation;
import com.google.cloud.bigtable.data.v2.models.RowMutationEntry;
import com.google.cloud.bigtable.data.v2.stub.metrics.MeasuredMutateRowsCallable;
import com.google.cloud.bigtable.data.v2.stub.metrics.MeasuredMutateRowsCallableV2;
import com.google.cloud.bigtable.data.v2.stub.metrics.MeasuredReadRowsCallable;
import com.google.cloud.bigtable.data.v2.stub.metrics.MeasuredUnaryCallable;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.BulkMutateRowsUserFacingCallable;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptorV2;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsRetryingCallable;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsUserFacingCallable;
import com.google.cloud.bigtable.data.v2.stub.readrows.FilterMarkerRowsCallable;
import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsResumptionStrategy;
import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsRetryCompletedCallable;
Expand Down Expand Up @@ -103,7 +98,6 @@ public class EnhancedBigtableStub implements AutoCloseable {
private final UnaryCallable<String, List<KeyOffset>> sampleRowKeysCallable;
private final UnaryCallable<RowMutation, Void> mutateRowCallable;
private final UnaryCallable<BulkMutation, Void> bulkMutateRowsCallable;
private final UnaryCallable<RowMutation, Void> bulkMutateRowsBatchingCallable;
private final UnaryCallable<ConditionalRowMutation, Boolean> checkAndMutateRowCallable;
private final UnaryCallable<ReadModifyWriteRow, Row> readModifyWriteRowCallable;

Expand Down Expand Up @@ -196,7 +190,6 @@ public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings)
sampleRowKeysCallable = createSampleRowKeysCallable();
mutateRowCallable = createMutateRowCallable();
bulkMutateRowsCallable = createBulkMutateRowsCallable();
bulkMutateRowsBatchingCallable = createBulkMutateRowsBatchingCallable();
checkAndMutateRowCallable = createCheckAndMutateRowCallable();
readModifyWriteRowCallable = createReadModifyWriteRowCallable();
}
Expand Down Expand Up @@ -376,49 +369,14 @@ private UnaryCallable<BulkMutation, Void> createBulkMutateRowsCallable() {
SpanName.of(TRACING_OUTER_CLIENT_NAME, "MutateRows"));

UnaryCallable<BulkMutation, Void> measured =
new MeasuredMutateRowsCallableV2(
traced,
TRACING_OUTER_CLIENT_NAME + ".MutateRows",
tagger,
statsRecorder,
clientContext.getClock());

return measured.withDefaultCallContext(clientContext.getDefaultCallContext());
}

/** @deprecated Please use {@link #newMutateRowsBatcher(String)} */
@Deprecated
private UnaryCallable<RowMutation, Void> createBulkMutateRowsBatchingCallable() {
UnaryCallable<MutateRowsRequest, Void> baseCallable = createMutateRowsBaseCallable();

BatchingCallSettings.Builder<MutateRowsRequest, Void> batchingCallSettings =
BatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor())
.setBatchingSettings(settings.bulkMutateRowsSettings().getBatchingSettings());

// This is a special case, the tracing starts after the batching, so we can't use
// createUserFacingUnaryCallable
TracedBatchingCallable<MutateRowsRequest, Void> traced =
new TracedBatchingCallable<>(
baseCallable,
clientContext.getTracerFactory(),
SpanName.of(TRACING_OUTER_CLIENT_NAME, "BulkMutateRows"),
batchingCallSettings.getBatchingDescriptor());

UnaryCallable<MutateRowsRequest, Void> measured =
new MeasuredMutateRowsCallable(
traced,
TRACING_OUTER_CLIENT_NAME + ".MutateRows",
tagger,
statsRecorder,
clientContext.getClock());

UnaryCallable<MutateRowsRequest, Void> batching =
Callables.batching(measured, batchingCallSettings.build(), clientContext);

MutateRowsUserFacingCallable userFacing =
new MutateRowsUserFacingCallable(batching, requestContext);

return userFacing.withDefaultCallContext(clientContext.getDefaultCallContext());
return measured.withDefaultCallContext(clientContext.getDefaultCallContext());
}

/**
Expand All @@ -427,8 +385,8 @@ private UnaryCallable<RowMutation, Void> createBulkMutateRowsBatchingCallable()
* control.
*
* <ul>
* <li>Uses {@link MutateRowsBatchingDescriptorV2} to spool the {@link RowMutationEntry}
* mutations and send them out as {@link BulkMutation}.
* <li>Uses {@link MutateRowsBatchingDescriptor} to spool the {@link RowMutationEntry} mutations
* and send them out as {@link BulkMutation}.
* <li>Uses {@link #bulkMutateRowsCallable()} to perform RPC.
* <li>Batching thresholds can be configured from {@link
* EnhancedBigtableStubSettings#bulkMutateRowsSettings()}.
Expand All @@ -438,7 +396,7 @@ private UnaryCallable<RowMutation, Void> createBulkMutateRowsBatchingCallable()
* are no more entries or there are no more retry attempts left.
* <li>Wrap batch failures in a {@link
* com.google.cloud.bigtable.data.v2.models.MutateRowsException}.
* <li>Split the responses using {@link MutateRowsBatchingDescriptorV2}.
* <li>Split the responses using {@link MutateRowsBatchingDescriptor}.
* </ul>
*/
public Batcher<RowMutationEntry, Void> newMutateRowsBatcher(@Nonnull String tableId) {
Expand Down Expand Up @@ -557,12 +515,6 @@ public UnaryCallable<BulkMutation, Void> bulkMutateRowsCallable() {
return bulkMutateRowsCallable;
}

/** @deprecated Please use {@link #newMutateRowsBatcher(String)} API. */
@Deprecated
public UnaryCallable<RowMutation, Void> bulkMutateRowsBatchingCallable() {
return bulkMutateRowsBatchingCallable;
}

/**
* Returns the callable chain created in {@link #createCheckAndMutateRowCallable()} during stub
* construction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow;
import com.google.cloud.bigtable.data.v2.models.Row;
import com.google.cloud.bigtable.data.v2.models.RowMutation;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptorV2;
import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -453,7 +453,7 @@ private Builder() {
copyRetrySettings(baseDefaults.mutateRowSettings(), mutateRowSettings);

bulkMutateRowsSettings =
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptorV2())
BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor())
.setRetryableCodes(IDEMPOTENT_RETRY_CODES)
.setRetrySettings(MUTATE_ROWS_RETRY_SETTINGS)
.setBatchingSettings(
Expand Down
Loading