public class LocalIndexProvider extends IndexProvider
IndexProvider
implementation that maintains indexes on the local file system using MapDB.
This provider maintains a separate
Constructor and Description |
---|
LocalIndexProvider() |
Modifier and Type | Method and Description |
---|---|
protected ManagedIndex |
createIndex(IndexDefinition defn,
String workspaceName,
NodeTypes.Supplier nodeTypesSupplier,
IndexFeedback feedback)
Method called when this provider needs to create a new index given the unique pair of workspace name and index definition.
|
protected void |
doInitialize()
Method that should do the provider-specific initialization work.
|
String |
getDirectory()
Get the absolute or relative path to the directory where this provider should store the indexes.
|
IndexPlanner |
getIndexPlanner()
Get the planner that, during the query planning/optimization phase, evaluates for a single source the AND-ed query
constraints and defines indexes that may be used.
|
protected void |
postShutdown()
Method called during #shutdown() after each of the managed indexes have been shutdown.
|
protected void |
removeIndex(IndexDefinition oldDefn,
ManagedIndex existingIndex,
String workspaceName)
Method called when this provider needs to remove an existing index given the unique pair of workspace name and index
definition.
|
protected ManagedIndex |
updateIndex(IndexDefinition oldDefn,
IndexDefinition updatedDefn,
ManagedIndex existingIndex,
String workspaceName,
NodeTypes.Supplier nodeTypesSupplier,
IndexFeedback feedback)
Method called when this provider needs to update an existing index given the unique pair of workspace name and index
definition.
|
context, getIndex, getIndexWriter, getName, getRepositoryName, initialize, logger, names, namespaces, notify, notify, preShutdown, shutdown, valueFactories
public String getDirectory()
protected void doInitialize() throws RepositoryException
IndexProvider
doInitialize
in class IndexProvider
RepositoryException
- if there is a problem initializing the providerprotected void postShutdown()
IndexProvider
postShutdown
in class IndexProvider
public IndexPlanner getIndexPlanner()
IndexProvider
This method is typically called only once after the provider has been initialized
.
getIndexPlanner
in class IndexProvider
protected ManagedIndex createIndex(IndexDefinition defn, String workspaceName, NodeTypes.Supplier nodeTypesSupplier, IndexFeedback feedback)
IndexProvider
createIndex
in class IndexProvider
defn
- the definition of the index; never nullworkspaceName
- the name of the actual workspace to which the new index applies; never nullnodeTypesSupplier
- the supplier for the current node types cache; never nullfeedback
- the feedback mechanism for this provider to signal to ModeShape that portions of the repository content
must be scanned to build/populate the new index; never nullManagedIndex
for the new index; may not be nullprotected ManagedIndex updateIndex(IndexDefinition oldDefn, IndexDefinition updatedDefn, ManagedIndex existingIndex, String workspaceName, NodeTypes.Supplier nodeTypesSupplier, IndexFeedback feedback)
IndexProvider
updateIndex
in class IndexProvider
oldDefn
- the previous definition of the index; never nullupdatedDefn
- the updated definition of the index; never nullexistingIndex
- the existing index prior to this update, as returned from IndexProvider.createIndex(org.modeshape.jcr.api.index.IndexDefinition, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)
or IndexProvider.updateIndex(org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.spi.index.provider.ManagedIndex, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)
; never nullworkspaceName
- the name of the actual workspace to which the new index applies; never nullnodeTypesSupplier
- the supplier for the current node types cache; never nullfeedback
- the feedback mechanism for this provider to signal to ModeShape that portions of the repository content
must be scanned to rebuild/repopulate the updated index; never nullprotected void removeIndex(IndexDefinition oldDefn, ManagedIndex existingIndex, String workspaceName)
IndexProvider
removeIndex
in class IndexProvider
oldDefn
- the previous definition of the index; never nullexistingIndex
- the existing index prior to this update, as returned from IndexProvider.createIndex(org.modeshape.jcr.api.index.IndexDefinition, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)
or IndexProvider.updateIndex(org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.api.index.IndexDefinition, org.modeshape.jcr.spi.index.provider.ManagedIndex, java.lang.String, org.modeshape.jcr.NodeTypes.Supplier, org.modeshape.jcr.spi.index.IndexFeedback)
; never nullworkspaceName
- the name of the actual workspace to which the new index applies; never nullCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.