-
Notifications
You must be signed in to change notification settings - Fork 2
Update upstream #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Update upstream #263
Conversation
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
Previously SnapshotBundle contained a fixed number of predefined entities. Now SnapshotBundle is dynamic and based on a snapshots::Schema::RepositoryDef. The actual schema is defined in db::blocks::make_blocks_repository_schema(). snapshots::Schema follows a "fluent config builder" pattern. Currently rec_split_index_defs_ values are trivial there, but in the future we will configure index builders there. snapshots::Schema::RepositoryDef is a part of datastore::Schema. It is configured by db::DataStore::make_schema. Currently datastore::Schema just wraps snapshots::Schema, but in the future it will also contain DHIIs. For the DAL client code a db::blocks::BundleDataRef wrapper is provided for convenient access into the block repository bundles (much like db::DataStoreRef provides a convenient access to the block repository). Related refactorings: * separate bundle and bundle paths. SnapshotBundlePaths is useful for file manipulation without opening snapshots. * always open SnapshotBundle on creation (RAII) * open repository by default. It is not opened only in case of CAPI where bundles are mmap-ed and provided externally. * move db/transactions subfolder into db/blocks. db/blocks now contains everything related to "block snapshots". db/state will contain "state snapshots" and DHII. * rename snapshot_repository variables to just repository
SnapshotPath is decoupled from SnapshotType and fixed file extensions. SnapshotPath has a tag string without trying to interpret it. SnapshotType is replaced with EntityName. EntityName constants match tags for simple conversions to/from SnapshotPath tag. Block snapshot file extensions are defined in blocks/schema_config, and propagated to datastore/snapshots via Schema::RepositoryDef. Related refactorings: * rename index_file() to related_path_ext(kIdxExtension) * dash in kIdxTxnHash2BlockName to eliminate tag underscore conversions * SnapshotRepository::is_stale_index_path reimplemented with a help of SnapshotBundleFactory::index_dependency_paths * use bundle factory in dev/snapshots.cpp create_index cmd
Schema is extended to support DHII entities. The repository schema is re-defined as set of entities. The block snapshot files are grouped under a special "default" entity for simplicity. Each entity can be configured with multiple related snapshot files. EntityName of each snapshot file must be unique within an entity. Each file can be configured with a custom tag and file extension. State snapshots repository schema is defined in db/state/schema_config.hpp Refactorings: * rename bundle factory to index builders factory. The old name made no sense, because bundles can now be created from schema objects directly. SnapshotBundleFactoryImpl is renamed to BlocksIndexBuildersFactory. * use schema (entity_name_by_path) to convert path to name and name to tag, because it is not trivial anymore. Tags are explicitly set on all snapshot files. * move schema factories to bundle implementation. schema definition must not be tied to implementation types (like rec split index). * repository.find_segment takes both segment and index names (it returns SegmentAndIndex and names differ now).
61d135e to
d931ba2
Compare
…piler compatibility
9578e53 to
bda0cb4
Compare
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.
No description provided.