GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [Storage] Bucket lock samples and bug fixes. by frankyn · Pull Request #3709 · googleapis/google-cloud-java Conversation
|
| for (Blob blob : bucket.list(BlobListOption.fields(Storage.BlobField.EVENT_BASED_HOLD, | ||
| Storage.BlobField.TEMPORARY_HOLD)).iterateAll()) { | ||
| if(blob.getEventBasedHold() == true || blob.getTemporaryHold() == true) { | ||
| BlobInfo.Builder blobBuilder = BlobInfo.newBuilder(bucket.getName(), blob.getName()); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| System.out.println("Last Metadata Update: " + new Date(blob.getUpdateTime())); | ||
| System.out.println( | ||
| "temporaryHold: " | ||
| + (blob.getTemporaryHold() != null && blob.getTemporaryHold() |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (blob.getMetadata() != null) { | ||
| System.out.println("User metadata:"); | ||
| for (Map.Entry<String, String> userMetadata : blob.getMetadata().entrySet()) { | ||
| System.out.println(userMetadata.getKey() + " " + userMetadata.getValue()); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Bucket bucket = storage.get(bucketName, BucketGetOption.fields(BucketField.RETENTION_POLICY)); | ||
| if (bucket.retentionPolicyIsLocked() != null && bucket.retentionPolicyIsLocked()) { | ||
| System.out.println("Unable to remove retention period as retention policy is locked."); | ||
| return bucket; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return bucket; | ||
| } | ||
|
|
||
| Bucket updated_bucket = bucket.toBuilder().setRetentionPeriod(null).build().update(); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Bucket bucket = storage.get(bucketName, BucketGetOption.fields(BucketField.RETENTION_POLICY)); | ||
|
|
||
| System.out.println("Retention Policy for " + bucketName); | ||
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Bucket bucket = | ||
| storage.get(bucketName, Storage.BucketGetOption.fields(BucketField.METAGENERATION)); | ||
| Bucket updated_bucket = |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Bucket bucket = | ||
| storage.get(bucketName, BucketGetOption.fields(BucketField.DEFAULT_EVENT_BASED_HOLD)); | ||
|
|
||
| if (bucket.getDefaultEventBasedHold() == true) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Comments addressed. @kurtisvg PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merging for now and following up in a separate PR to resolve devex issues. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* [Storage] Replay GCS Bucket Lock (#3645) * Add support for defaultEventBasedHold * Add support for Blob eventBasedHold * Add support for blob temporary holds * Remove Beta launch annotations for CMEK * Add support for lockRetentionPolicy and RetentionPolicy * Update FakeStorageRPC * codacy-bot review fix (final only) * Update getRetentionPolicyIsLocked() -> retentionPolicyIsLocked() and misc. * Address comments * Address comments * Address comments. * Small nits * Fix additional comments * [Storage] Bucket lock samples and bug fixes. (#3709) * Fix issue in tests, write bucket lock samples, and resolve issue in client library * Update documentation around Boolean returns to clarify different return caes. * Fix broken unit test * Address feedback * Fix typo in comments
A follow up of #3706: - Change the group id to `com.google.cloud` as it is a customer-facing library. - Add clirr and enforcer check in CI.
* feat: grpc metrics * test * grpc metrics env check * skip test and clirr * add grpc metrics in allowed metrics * test: logs * chore: generate libraries at Wed Apr 2 17:15:18 UTC 2025 * chore: generate libraries at Wed Apr 2 17:18:00 UTC 2025 * remove logs * review * clirr * review comments * enable grpc metrics only env is set to false --------- Co-authored-by: cloud-java-bot <[email protected]>
* [Storage] Replay GCS Bucket Lock (#3645) * Add support for defaultEventBasedHold * Add support for Blob eventBasedHold * Add support for blob temporary holds * Remove Beta launch annotations for CMEK * Add support for lockRetentionPolicy and RetentionPolicy * Update FakeStorageRPC * codacy-bot review fix (final only) * Update getRetentionPolicyIsLocked() -> retentionPolicyIsLocked() and misc. * Address comments * Address comments * Address comments. * Small nits * Fix additional comments * [Storage] Bucket lock samples and bug fixes. (#3709) * Fix issue in tests, write bucket lock samples, and resolve issue in client library * Update documentation around Boolean returns to clarify different return caes. * Fix broken unit test * Address feedback * Fix typo in comments
* [Storage] Replay GCS Bucket Lock (#3645) * Add support for defaultEventBasedHold * Add support for Blob eventBasedHold * Add support for blob temporary holds * Remove Beta launch annotations for CMEK * Add support for lockRetentionPolicy and RetentionPolicy * Update FakeStorageRPC * codacy-bot review fix (final only) * Update getRetentionPolicyIsLocked() -> retentionPolicyIsLocked() and misc. * Address comments * Address comments * Address comments. * Small nits * Fix additional comments * [Storage] Bucket lock samples and bug fixes. (#3709) * Fix issue in tests, write bucket lock samples, and resolve issue in client library * Update documentation around Boolean returns to clarify different return caes. * Fix broken unit test * Address feedback * Fix typo in comments
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.