Add StorageBackend abstraction with memory implementation#191
Merged
Conversation
Introduce StorageBackend interface and supporting types as the foundation for a pluggable storage layer, with an in-memory implementation for testing. New types: - StorageBackend: Interface for storage backend implementations - StorageBucket: Interface for key-value operations (get, put, delete, scan, etc.) - StorageBuckets: Data class holding edge and lock buckets - DatastoreUri: Utility for parsing datastore:// URIs with input validation - MemoryStorageBucket: In-memory StorageBucket backed by ByteArrayStore - MemoryStorageBackend: In-memory StorageBackend with isolated stores per namespace Tests: - DatastoreUriTest: URI parsing and validation - StorageBucketCompatibilityTest: Abstract test suite for StorageBucket contracts - MemoryStorageBucketCompatibilityTest: Memory implementation passes all contracts - MemoryStorageBackendTest: Backend-level isolation and lifecycle tests Part of #173 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 9, 2026
…eTables - StorageBucket → StorageTable (matches table semantics: scan, get, put) - StorageBuckets removed (edge/lock distinction is legacy, unused) - StorageBackend.getBucket() → StorageBackend.open() → Mono<StorageTable> - MemoryStorageBucket → MemoryStorageTable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
open() implies close() semantics. getStorageTable() is more explicit about what it does. URI overload becomes a default method. Removed deprecated getTable() methods from interface. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removes uppercase letters and hyphens from allowed characters in datastore URI namespace and table names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bjectSource - Rename package v2.engine.storage → engine.storage for new files - Convert DatastoreUriTest to @ObjectSource (valid/invalid URI cases) - Convert MemoryStorageBackendTest to @ObjectSource (getStorageTable cases) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ndTest - Simplify null checks in MemoryStorageBackendTest using `assertNotNull` for clarity. - Minor method renaming in StorageTableCompatibilityTest for consistency.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
StorageBackendinterface andStorageTableas the foundation for a pluggable storage layerStorageBackend.getStorageTable(namespace, name)→Mono<StorageTable>(URI overload is a default method)DatastoreUriparsesdatastore://URIs —SAFE_NAME_PATTERNallows only lowercase, digits, underscoreMemoryStorageBackendandMemoryStorageTablefor in-memory testingStorageTableCompatibilityTestabstract test suite to verify anyStorageTableimplementation meets the contractPart 1 of 3 for #173. Prerequisite for HBase backend + factory (Part 2) and consumer migration (Part 3 = PR #175).
New Files
Source
StorageBackend.ktgetStorageTable()→Mono<StorageTable>, URI overload as default methodStorageTable.ktDatastoreUri.ktdatastore://URIs with strict validation (^[a-z0-9_]+$)MemoryStorageTable.ktStorageTablebacked byByteArrayStoreMemoryStorageBackend.ktStorageBackendwith isolated stores per namespaceTests
DatastoreUriTest.ktStorageTableCompatibilityTest.ktMemoryStorageTableCompatibilityTest.ktMemoryStorageBackendTest.ktTest plan
./gradlew buildpasses (all existing + new tests)DatastoreUrivalidation covers injection risks🤖 Generated with Claude Code