Skip to content
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

MODE-2160 Added support for an index provider that stores indexes on the local file system #1215

Merged
merged 5 commits into from Aug 22, 2014

Conversation

rhauch
Copy link
Contributor

@rhauch rhauch commented Aug 21, 2014

This PR adds support for a new index provider that stores indexes on the local file system using MapDB. This was the first concrete implementation of an index provider, and this helped identify problems in the index provider SPI added in earlier 4.0 alpha releases.

A number of tests were added to show that this new provider does appear to work pretty well, that the query engine is able to use the index providers to plan queries and annotate the query plan with information about applicable indexes, and the engine can then pick and use the best index (if there is one). Additional testing will be completed in other PRs.

The RepositoryConfiguration and JcrRepository classes were modified to support specifying and using indexes within the repository JSON configurations; index support had already been added to the Wildfly subsystem. Additionally, this PR exposes the IndexManager public API for registering new/updated index definitions and for unregistering (removing) index definitions.

…re only a few very limited test cases, but they do pass and show that the provider is able to be included in the query plan, properly selected for use, and properly used during query execution.
if (index.getWorkspaceName() != null) {
str.append(", workspace=").append(index.getWorkspaceName());
}
// if (index.getWorkspaceName() != null) {
Copy link
Member

Choose a reason for hiding this comment

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

should this be commented out ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this was intentional. I commented this out so that the printed plan is more readable. I don't think the workspace name of the index adds much to the plan, but I wasn't sure so I didn't delete the code.

@hchiorean
Copy link
Member

@rhauch: this looks good to me, although there is stuff which is unclear to me (functional wise). For example FunKeySerializer (interesting choice of name btw...)

@hchiorean
Copy link
Member

Another question: do we have any WF kit tests which use the new indexing configuration ? For example the current test config XML files have the indexing part disabled.

@rhauch
Copy link
Contributor Author

rhauch commented Aug 22, 2014

LOL. The FunKeySerializer stores MapDB Fun.TupleX instances (where X is 1,2,3, or 4) used to store tuples inside map entries. I'll rename, though.

I'll also add a WF kit test that uses the indexes.

@rhauch
Copy link
Contributor Author

rhauch commented Aug 22, 2014

Added another commit that incorporates the aforementioned suggestions, and it also adds support for validating all index definitions (including via the affiliated providers) before any are registered.

rhauch added a commit that referenced this pull request Aug 22, 2014
MODE-2160 Added support for an index provider that stores indexes on the local file system
@rhauch rhauch merged commit 2e9bca2 into ModeShape:master Aug 22, 2014
@rhauch rhauch deleted the mode-2160 branch August 22, 2014 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants