Uh oh!
There was an error while loading. Please reload this page.
Bigtable: 05. Surface: Bulk Mutations - #2936
Conversation
| future, | ||
| new ApiFutureCallback<Void>() { | ||
| @Override | ||
| public void onFailure(Throwable throwable) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| // Resolve the request | ||
| innerResult.set(null); | ||
| // Now, close will promptly finish |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
igorbernstein2
commented
Feb 26, 2018
@garrettjonesgoogle, can you take a look when you have a moment? |
| * InstanceName instanceName = InstanceName.of("[PROJECT]", "[INSTANCE]"); | ||
| * try (BigtableClient bigtableClient = BigtableClient.create(instanceName)) { | ||
| * try (BulkMutations mutations = bigtableClient.newBulkMutations()) { | ||
| * for(String someValue in someCollection) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| /** Returns the object with the settings used for BulkMutations. */ | ||
| public BatchingCallSettings<RowMutation, Void> bulkMutationsSettings() { | ||
| // NOTE: the user facing BigtableDataClient only exposes this api as newBulkMutations, | ||
| // so the outer name should match that. While the stub sticks to rpc names. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| /** | ||
| * This is necessary workaround for {@link | ||
| * com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub#mutateRowsCallable()}. The settings | ||
| * are exposed to the user using {@link com.google.cloud.bigtable.data.v2.models.RowMutation} |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| * | ||
| * @see com.google.cloud.bigtable.data.v2.BigtableDataClient#newBulkMutations() for example usage. | ||
| */ | ||
| public final class BulkMutations implements AutoCloseable { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| * } catch (BulkMutationFailure failure) { | ||
| * // Handle error | ||
| * } | ||
| * // After `mutations` are closed, all mutations have been applied |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| lock.wait(waitMs); | ||
| } | ||
| if (numFailures > 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
igorbernstein2
commented
Feb 28, 2018
All feedback has been addressed. The only open question is if BulkMutations can be modeled in terms of callables. @garrettjonesgoogle, PTAL |
Exposes the MutateRows RPC as bulkMutations(). The actual BatchingCallable is wrapped by a BulkMutations wrapper to allow waiting for outstanding mutations and eventually for flushing the batch.
6773a12 to
2eabf60Compareigorbernstein2
commented
Mar 1, 2018
rebased (and squashed to simplify rebasing). Will address feedback next |
igorbernstein2
commented
Mar 1, 2018
Ok, all feedback has been addressed and the PR has been rebased. PTAL, if it looks good, please merge |
pongad
commented
Mar 1, 2018
LGTM. @garrettjonesgoogle can +2 |
igorbernstein2
commented
Mar 1, 2018
Thank you! |
…ng to v1.49.0 (#2936) Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com>
…storage-bom to v2.44.0 (#2936)
…ng to v1.49.0 (#2936) Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [6.61.0](https://togithub.com/googleapis/java-spanner/compare/v6.60.1...v6.61.0) (2024-03-04) ### Features * Support float32 type ([#2894](https://togithub.com/googleapis/java-spanner/issues/2894)) ([879470a](https://togithub.com/googleapis/java-spanner/commit/879470a77a09f1f604a4b9888cb214108cd49372)) ### Bug Fixes * Flaky test issue due to AbortedException. ([#2925](https://togithub.com/googleapis/java-spanner/issues/2925)) ([f9b8e03](https://togithub.com/googleapis/java-spanner/commit/f9b8e037cde42804311af40b67f3b45d634b6ff9)) ### Dependencies * Update dependency com.google.cloud:sdk-platform-java-config to v3.27.0 ([#2935](https://togithub.com/googleapis/java-spanner/issues/2935)) ([55442fc](https://togithub.com/googleapis/java-spanner/commit/55442fce7ea63988a5f439730c3745b32fd09aea)) * Update dependency org.json:json to v20240303 ([#2936](https://togithub.com/googleapis/java-spanner/issues/2936)) ([791aec9](https://togithub.com/googleapis/java-spanner/commit/791aec9a8538601bda786b158285618b573514a9)) ### Documentation * Samples and tests for backup Admin APIs and overall spanner Admin APIs. ([#2882](https://togithub.com/googleapis/java-spanner/issues/2882)) ([7c024f2](https://togithub.com/googleapis/java-spanner/commit/7c024f21625c97979d70391a82ca84730c37b709)) * Update all public documents to use auto-generated admin clients. ([#2928](https://togithub.com/googleapis/java-spanner/issues/2928)) ([faf5a09](https://togithub.com/googleapis/java-spanner/commit/faf5a09dc784386ad40c0fdb0f005d1bdaff9eed)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…bInfoFactory (#2936) When uploading a file from the files system, there are scenarios when a job would need to customize the actual BlobInfo used to upload to GCS. Add the new UploadBlobInfoFactory which allows a user to produce their own BlobInfo instance given the bucketName and fileName. When producing the BlobInfo the application can also customize other metadata fields. A few convenience adapter methods are available in UploadBlobInfoFactory to simplify common operations. Fixes#2638
Exposes the MutateRows RPC as bulkMutations(). The actual BatchingCallable is wrapped by a BulkMutations wrapper to allow waiting for outstanding mutations and eventually for flushing the batch.
Edit: This has been reviewed by @kevinsi4508 and ready for @garrettjonesgoogle
NOTE: this api assumes the current gax batching infrastructure. It will be extended once flushing is figured out