GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs(storage): add Rapid Cache samples by sahusneha2004 · Pull Request #14886 · googleapis/google-cloud-java

Conversation

@sahusneha2004

@sahusneha2004 sahusneha2004 commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Adds Storage Control Rapid Cache samples for Java, plus an integration test and README entries.

Samples

All samples are in java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/ and use StorageControlClient with the global project _.

Sample Region tag What it does
RapidCacheCreate storage_control_create_rapid_cache Creates a cache with name projects/_/buckets/{bucket}/rapidCaches/{cacheId}, zone = cacheId and cache_type = "rapid-cache-ultra". The cache ID must be the zone, and the zone must be in the bucket's region. Waits for the LRO and prints the name, cache type and state.
RapidCacheGet storage_control_get_rapid_cache Gets the cache and prints the name, zone, cache type and state.
RapidCacheList storage_control_list_rapid_caches Lists all caches in the bucket (iterateAll() handles paging) and prints each name.
RapidCacheUpdate storage_control_update_rapid_cache Sets the TTL (passed in seconds; 1 hour to 7 days) with update mask ["ttl"]. Waits for the LRO and prints the name and new TTL.
RapidCacheDisable storage_control_disable_rapid_cache Starts the disable LRO and waits for it with operation.get(), then prints the name and state.

Disable and LRO wait

The cache moves to the disabled state within seconds, but the disable LRO only finishes once the cache is fully removed, which can take over an hour. That is longer than the client's default LRO polling timeout (5 minutes). When that happens, get() throws a CancellationException even though the cache is already disabled. A comment in the sample explains this and points to RapidCacheGet to check the state.

Test (ITRapidCacheTest)

  • Setup: creates a regional bucket with hierarchical namespace and uniform bucket-level access in the zone's region, then waits 20s for bucket metadata to propagate. The zone defaults to us-central1-a and can be set with RAPID_CACHE_ZONE. The cache ID is the zone.
  • One test runs create → get → list → update → disable and checks the output:
    • create: exact cache name and cache type
    • get: name, zone, cache type and State: running
    • list: the cache name is listed
    • update: TTL: 172800 seconds
    • disable: Disabled Rapid Cache: <name> if the LRO finishes. If the client stops polling (CancellationException), the test runs get and checks State: disabled instead of failing.
  • Teardown: if the cache may still be active (for example, the test failed before disable), it starts a disable without waiting and ignores errors. It then tries to delete the bucket for up to 2 minutes, retrying on 409 (the bucket can't be deleted while the cache is being removed). If that fails, it logs the bucket name and leaves it for the stale-bucket cleanup.
  • Like ITAnywhereCacheTest, the test is skipped in CI (when JOB_TYPE is set) because the operations take a long time.

Other changes

  • java-storage/README.md: adds the five samples to the samples table (regenerated with librarian generate).
  • No dependency changes.

Validation

  • Formatting, lint, unit and sample CI checks pass.
  • The integration test passed in a live run against an allowlisted project.

b/482946642

[Generated-by: AI]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@sahusneha2004
feat(storage): add Rapid Cache samples
d4d9a38
Adds create, get, list, update and disable Rapid Cache samples for Storage Control, with an integration test. Bumps libraries-bom to 26.90.0 (storage-control 2.75.0 with RapidCache). b/482946642

[Generated-by: AI]
@sahusneha2004 sahusneha2004 added ai-generated Pull Request generated by AI storage-sample-architect Generated by storage-sample-architect skill labels Nov 2, 2026
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Nov 2, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces code snippets and integration tests for managing Rapid Cache in Google Cloud Storage Control v2, including creation, retrieval, listing, updating, and disabling operations, alongside updating the necessary Maven dependencies. The review feedback focuses on improving the robustness and readability of the integration tests by moving the Rapid Cache disabling logic into the tearDown method, declaring cacheId as an instance field, and simplifying the test flow by removing the complex manual try-catch-finally block.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-storage/samples/snippets/src/test/java/com/example/storage/control/v2/ITRapidCacheTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/test/java/com/example/storage/control/v2/ITRapidCacheTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/test/java/com/example/storage/control/v2/ITRapidCacheTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
docs(storage): align rapid cache samples with reference integration test
2555240
Set the explicit cache name (ID = zone), cache_type rapid-cache-ultra and ttl 24h on create; wait for the disable LRO; tests assert running state, cache type, list membership and the updated ttl, and bound the disable wait. Aligns with #14529. b/482946642

[Generated-by: AI]
@sahusneha2004 sahusneha2004 changed the title feat(storage): add Rapid Cache samples docs(storage): add Rapid Cache samples Nov 2, 2026
@sahusneha2004
sahusneha2004 requested a review from nidhiii-27 November 3, 2026 06:28
nidhiii-27
nidhiii-27 requested changes Nov 3, 2026
View reviewed changes

@nidhiii-27 nidhiii-27 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please regenerate java-storage/README.md via librarian generate — this is critical so merging the PR does not break the post-submit Librarian - Generate libraries check on main.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-storage/samples/install-without-bom/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-storage/samples/snippets/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheCreate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheCreate.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/test/java/com/example/storage/control/v2/ITRapidCacheTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-storage/samples/snippets/src/test/java/com/example/storage/control/v2/ITRapidCacheTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
docs(storage): address review comments on rapid cache samples
1d4a403
Revert the samples pom.xml changes (managed automatically), rename the
create sample's zoneName parameter to cacheId, call the disable sample
directly in the test and handle the polling timeout
(CancellationException), use a positive cacheActive flag, and regenerate
java-storage/README.md with librarian. b/482946642

[Generated-by: AI]
@sahusneha2004

sahusneha2004 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Nidhi! I regenerated java-storage/README.md with librarian generate (librarian v0.50.0, the version pinned in librarian.yaml), so it now lists the new Rapid Cache samples.

Co-authored by AI Agent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
Merge branch 'main' into storage-control-rapid-cache-samples-java
19895d3
@sahusneha2004
sahusneha2004 marked this pull request as ready for review November 6, 2026 10:14
@sahusneha2004
sahusneha2004 requested review from a team as code owners November 6, 2026 10:14
@snippet-bot

snippet-bot Bot commented Nov 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 5 region tags.
  • java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheCreate.java:19, tag storage_control_create_rapid_cache
  • java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheDisable.java:19, tag storage_control_disable_rapid_cache
  • java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheGet.java:19, tag storage_control_get_rapid_cache
  • java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheList.java:19, tag storage_control_list_rapid_caches
  • java-storage/samples/snippets/src/main/java/com/example/storage/control/v2/RapidCacheUpdate.java:19, tag storage_control_update_rapid_cache

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
docs(storage): remove TTL from rapid cache create sample
6d7b4d4
Match AnywhereCacheCreate by setting only the required fields (name, zone, cache type) on create. RapidCacheUpdate shows how to configure the TTL. Clarify that the disable sample's get() throws CancellationException on client polling timeout. b/482946642

[Generated-by: AI]
nidhiii-27
nidhiii-27 approved these changes Nov 9, 2026
View reviewed changes

@nidhiii-27 nidhiii-27 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please update the PR description based on the recent changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sahusneha2004

sahusneha2004 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@nidhiii-27 Thanks for the review! I've updated the PR description to match the current code: the samples and what each does, the disable LRO wait behavior, the test and cleanup flow, and validation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
sahusneha2004 merged commit e714f62 into main Nov 10, 2026
204 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
sahusneha2004 deleted the storage-control-rapid-cache-samples-java branch November 10, 2026 14:12
@release-please release-please Bot mentioned this pull request Nov 12, 2026
chore(main): release 1.97.0 #14996
Merged
whowes pushed a commit that referenced this pull request Nov 13, 2026
@release-please
chore(main): release 1.97.0 (#14996)
fd32569
🤖 I have created a release *beep* *boop*
---


<details><summary>1.97.0</summary>

##
[1.97.0](v1.96.0...v1.97.0)
(2026-11-12)


### ⚠ BREAKING CHANGES

* **shopping-merchant:** remove discontinued Merchant API v1beta
([#14942](#14942))

### Features

* **bigquery-jdbc:** adds BigQuery graph integration to DatabaseMetadata
methods
([#14930](#14930))
([950b81b](950b81b))
* **gax:** implement resumable upload session resumption
([#14677](#14677))
([24728d6](24728d6))
* **grpc-gcp:** add built-in channel_count metric for client library
pools
([#14947](#14947))
([712f043](712f043))
* **grpc-gcp:** add built-in channel_load metric for client library
pools
([#14985](#14985))
([9f87888](9f87888))
* **shopping-merchant:** remove discontinued Merchant API v1beta
([#14942](#14942))
([2947dfd](2947dfd))
* **storage:** add StorageErrorTypeMapper for standard metrics
([#14694](#14694))
([a9ac393](a9ac393))
* **storage:** add StorageMetricsContext for operation metrics state
([#14728](#14728))
([edea395](edea395))
* **storage:** wire logical operation metrics in Retrying and
StorageOptions
([#14695](#14695))
([589c66c](589c66c))
* update API sources and regenerate
([#14958](#14958))
([75944f3](75944f3))


### Bug Fixes

* **auth:** verify public/private key match with retries in mTLS
keystore loading
([#14829](#14829))
([096dbd6](096dbd6))
* **bigquery:** set QueryResultsFormat.ARROW in QueryArrow sample
([#14960](#14960))
([c98e7c3](c98e7c3))
* **bigtable:** avoid triggering per-RPC credential session fallback on
default call context
([#14961](#14961))
([eb06d2c](eb06d2c))
* **bigtable:** copy Metadata per GetClientConfiguration call
([#14950](#14950))
([278fe2f](278fe2f))
* **bigtable:** disable SwitchingChannelPool when
ChannelPoolConfiguration is empty
([#14911](#14911))
([fa24702](fa24702))
* **bigtable:** handle empty SessionPoolConfiguration in SessionPoolImpl
and PoolSizer
([#14912](#14912))
([cc7b235](cc7b235))
* **bigtable:** replace SessionPoolImpl Watchdog with per-session
closeTimeout
([#14977](#14977))
([a15acfb](a15acfb))
* **spanner-jdbc:** report database default isolation level
([#14929](#14929))
([7e7595a](7e7595a))
* **spanner:** fix PG SHOW isolation level statements
([#14904](#14904))
([bc917ed](bc917ed))


### Dependencies

* bump grpc to 1.85.1, opentelemetry to 1.67.0, and guava to 33.7.2-jre
([#14957](#14957))
([1a27a00](1a27a00))
* bump guava to 33.7.1-jre and jspecify to 1.0.1
([#14937](#14937))
([1441527](1441527))


### Documentation

* **spanner:** update CHANGELOG.md for java spanner releases
([#14935](#14935))
([956681e](956681e))
* **storage:** add Rapid Cache samples
([#14886](#14886))
([e714f62](e714f62))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nidhiii-27 nidhiii-27 nidhiii-27 approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ai-generated Pull Request generated by AI storage-sample-architect Generated by storage-sample-architect skill

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sahusneha2004 @nidhiii-27
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.