Class ContentMirrorStoreStrategy
java.lang.Object
org.apache.jackrabbit.oak.plugins.index.property.strategy.ContentMirrorStoreStrategy
- All Implemented Interfaces:
IndexStoreStrategy
An IndexStoreStrategy implementation that saves the nodes under a hierarchy
that mirrors the repository tree.
This should minimize the chance that concurrent updates overlap on the same content node.
For example for a node that is under
This should minimize the chance that concurrent updates overlap on the same content node.
For example for a node that is under
/test/node, the index
structure will be /oak:index/index/test/node:
/
test
node
oak:index
index
test
node
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intlogging a warning everyoak.traversing.warntraversed nodes. -
Constructor Summary
ConstructorsConstructorDescriptionContentMirrorStoreStrategy(String indexName) ContentMirrorStoreStrategy(String indexName, String pathPrefix, boolean prependPathPrefix) Constructs a ContentMirrorStoreStrategy -
Method Summary
Modifier and TypeMethodDescriptionlongCount the occurrence of a given set of values.longCount the occurrence of a given set of values.booleanexists(org.apache.jackrabbit.guava.common.base.Supplier<NodeBuilder> index, String key) Check whether an entry for the given key exists.Search for a given set of values.query(Filter filter, String indexName, NodeState indexMeta, String indexStorageNodeName, Iterable<String> values) voidupdate(org.apache.jackrabbit.guava.common.base.Supplier<NodeBuilder> index, String path, @Nullable String indexName, @Nullable NodeBuilder indexMeta, Set<String> beforeKeys, Set<String> afterKeys) Updates the index for the given path.
-
Field Details
-
TRAVERSING_WARN
public static final int TRAVERSING_WARNlogging a warning everyoak.traversing.warntraversed nodes. Default10000
-
-
Constructor Details
-
ContentMirrorStoreStrategy
public ContentMirrorStoreStrategy() -
ContentMirrorStoreStrategy
-
ContentMirrorStoreStrategy
Constructs a ContentMirrorStoreStrategy- Parameters:
indexName- name of sub node under which paths are storedpathPrefix- path of the index in repository. Defaults to empty for indexes at root nodes i.e. those stored directly under '/oak:index'. For non root index its the path excluding the '/oak:index' node. For e.g. for index at '/content/oak:index/fooIndex' the pathPrefix would be '/content'. If this is appened to the paths returned by index then they would become absolute path in repositoryprependPathPrefix- Should the path prefix be added to the query result
-
-
Method Details
-
update
public void update(org.apache.jackrabbit.guava.common.base.Supplier<NodeBuilder> index, String path, @Nullable @Nullable String indexName, @Nullable @Nullable NodeBuilder indexMeta, Set<String> beforeKeys, Set<String> afterKeys) Description copied from interface:IndexStoreStrategyUpdates the index for the given path.- Specified by:
updatein interfaceIndexStoreStrategy- Parameters:
index- the index node supplierpath- path stored in the indexindexName- the name of the index. May be null.indexMeta- the definition of the index. May be null.beforeKeys- keys that no longer apply to the pathafterKeys- keys that now do apply to the path
-
query
-
query
public Iterable<String> query(Filter filter, String name, NodeState indexMeta, Iterable<String> values) Description copied from interface:IndexStoreStrategySearch for a given set of values.- Specified by:
queryin interfaceIndexStoreStrategy- Parameters:
filter- the filter (can optionally be used for optimized query execution)name- the name of the index (for logging)indexMeta- the index metadata node (may not be null)values- values to look for (null to check for property existence)- Returns:
- an iterator of paths
-
count
Description copied from interface:IndexStoreStrategyCount the occurrence of a given set of values. Used in calculating the cost of an index.- Specified by:
countin interfaceIndexStoreStrategy- Parameters:
root- the root node (may not be null)indexMeta- the index metadata node (may not be null)values- values to look for (null to check for property existence)max- the maximum value to return- Returns:
- the aggregated count of occurrences for each provided value
-
count
Description copied from interface:IndexStoreStrategyCount the occurrence of a given set of values. Used in calculating the cost of an index.- Specified by:
countin interfaceIndexStoreStrategy- Parameters:
filter- the filter which can be used to estimate better costroot- the root node (may not be null)indexMeta- the index metadata node (may not be null)values- values to look for (null to check for property existence)max- the maximum value to return- Returns:
- the aggregated count of occurrences for each provided value
-
exists
public boolean exists(org.apache.jackrabbit.guava.common.base.Supplier<NodeBuilder> index, String key) Description copied from interface:IndexStoreStrategyCheck whether an entry for the given key exists.- Specified by:
existsin interfaceIndexStoreStrategy- Parameters:
index- the index node supplierkey- the key- Returns:
- true if at least one entry exists
-
getIndexNodeName
- Specified by:
getIndexNodeNamein interfaceIndexStoreStrategy
-