Skip to content

Unable to use Bigtable Query object as cache key  #5550

@rculbertson

Description

@rculbertson

Hello!

We'd like to cache Bigtable query results with the Caffeine library, using Query as the cache key. That's difficult to do right now because the Query object is modified when the request is executed. During the call to toProto, the table name and profile ID are set on the ReadRowsRequest builder. This means the Query object has a different hash code after the request executes. So a subsequent request with the exact same query parameters will be a cache miss.

One solution would be to make a copy of the Query object before executing the request, and use that as the cache key. But I don't think it's currently possible to copy a Query object. I've submitted PR #5551 which allows users to copy Query objects.

Metadata

Metadata

Labels

api: bigtableIssues related to the Bigtable API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions