feat(storage): add Cassandra backend (per --backend help text)#53
Open
quinnypig wants to merge 1 commit into
Open
feat(storage): add Cassandra backend (per --backend help text)#53quinnypig wants to merge 1 commit into
quinnypig wants to merge 1 commit into
Conversation
Registers a Bootstrapper implementation under the name "cassandra", which is referenced in three places in the codebase: the --backend help text in crates/bin/src/cmd_init.rs:19, the backend-name example in crates/storage/src/server_components.rs:95, and the trait docstring in crates/storage/src/bootstrapper.rs:7. Every Bootstrapper method returns OpError::Internal with a message pointing the user back at --backend postgres. The implementation is behind a new "cassandra" cargo feature; not enabled by default. This closes the gap between the help text and the registered backend list. It does not implement Cassandra.
Collaborator
|
Hi Corey - Thanks for the catch. We'd actually prefer at this point to correct (remove) the code references to Apache Cassandra at this point, rather than provide a non-functional stub implementation. If you want to alter this PR to do that, that'd be great, or I'm happy to take care of it on this end. Thanks for pointing out the confusion. |
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.
What this is
A new
cassandrastorage backend, gated behind acassandracargo feature. Registers aBootstrappervia the sameinventoryplugin path the postgres backend uses. Every trait method returnsOpError::Internalpointing the caller at--backend postgres.It does not implement Cassandra. Nothing in this repository implements Cassandra. That is the entire point of the PR.
Why this exists
The codebase references Cassandra in three places:
crates/bin/src/cmd_init.rs:19— the--backendclap help:/// Storage backend (postgres, cassandra, etc.) (default: postgres)crates/storage/src/server_components.rs:95:/// Backend name (e.g., "postgres", "cassandra")crates/storage/src/bootstrapper.rs:7://! `CREATE DATABASE` is PostgreSQL DDL vs `CREATE KEYSPACE` for CassandraA user who reads the help text and runs
extenddb init --backend cassandraagainst a v0.1.0 binary sees:A fair description, but it contradicts the documentation the user was just reading. This PR replaces that error with a different error that at least acknowledges the documentation.
What's in the diff
crates/storage-cassandra/as a new workspace member.Bootstrappermethods. Each returnsOpError::Internalwith the method name and a sentence pointing back at--backend postgres. The 4 sync methods return placeholder strings like"<no cassandra keyspace>"and"cassandra://placeholder/please-implement".BackendRegistrationfor"cassandra"submitted viainventory::submit!, mirroring the postgres backend.cassandra = ["extenddb-storage-cassandra"]feature incrates/bin/Cargo.toml. Default features are unchanged.What's not in the diff
OperationsEngineRegistration,StorageConfigRegistration,SettingsStoreRegistration,DiagnosticsStoreRegistration,ServerComponentsRegistration). The implementation depth in this PR matches the depth of investment Cassandra has received elsewhere in this codebase to date.crates/bin/src/config.rs, which hard-references the postgres config type regardless of feature flags. Disentangling that is left to whoever actually implements Cassandra.Behavior change
Before:
After (built with
--features cassandra):Alternative
If the answer is "remove the Cassandra references from the codebase" rather than "add a backend stub," I can scope this to a one-line update to
crates/bin/src/cmd_init.rs:19plus the two analogous edits. Pick whichever is funnier.Trademark note
The README is careful to point out that ExtendDB is not Amazon DynamoDB and that DynamoDB is a trademark of Amazon.com, Inc. Cassandra is a trademark of the Apache Software Foundation. I have nothing else to add. I just wanted to be on the record about having noticed.