Class IndexUtils
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.index.IndexUtils
-
public final class IndexUtils extends Object
TODO document
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tree
createIndexDefinition(@NotNull Tree indexNode, @NotNull String indexDefName, boolean unique, @NotNull String[] propertyNames, @NotNull String... declaringNodeTypeNames)
Create a new property2 index definition below the givenindexNode
.static Tree
createIndexDefinition(@NotNull Tree indexNode, @NotNull String indexDefName, boolean unique, @NotNull Collection<String> propertyNames, @Nullable Collection<String> declaringNodeTypeNames, @NotNull String propertyIndexType, @Nullable Map<String,String> properties)
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.static NodeBuilder
createIndexDefinition(@NotNull NodeBuilder index, @NotNull String indexDefName, boolean reindex, boolean unique, @NotNull Collection<String> propertyNames, @Nullable Collection<String> declaringNodeTypeNames)
Create a new property index definition below the givenindexNode
.static NodeBuilder
createIndexDefinition(@NotNull NodeBuilder indexNode, @NotNull String indexDefName, boolean unique, @NotNull Iterable<String> propertyNames, @Nullable String[] declaringNodeTypeNames, @NotNull String propertyIndexType, Map<String,String> properties)
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.static void
createReferenceIndex(@NotNull NodeBuilder index)
static @Nullable String
getAsyncLaneName(NodeState idxState, String indexPath)
static @Nullable String
getAsyncLaneName(NodeState idxState, String indexPath, PropertyState async)
static NodeBuilder
getOrCreateOakIndex(NodeBuilder root)
static boolean
isIndexNodeType(NodeState state)
static boolean
isIndexNodeType(NodeState state, String typeIn)
-
-
-
Method Detail
-
getOrCreateOakIndex
public static NodeBuilder getOrCreateOakIndex(NodeBuilder root)
-
createIndexDefinition
public static NodeBuilder createIndexDefinition(@NotNull @NotNull NodeBuilder index, @NotNull @NotNull String indexDefName, boolean reindex, boolean unique, @NotNull @NotNull Collection<String> propertyNames, @Nullable @Nullable Collection<String> declaringNodeTypeNames)
Create a new property index definition below the givenindexNode
.- Parameters:
index
- The oak:index node builderindexDefName
- The name of the new property index.reindex
-true
if the the reindex flag should be turned on.unique
-true
if the index is expected the assert property uniqueness.propertyNames
- The property names that should be indexed.declaringNodeTypeNames
- The declaring node type names ornull
.- Returns:
- the NodeBuilder of the new index definition.
-
createIndexDefinition
public static Tree createIndexDefinition(@NotNull @NotNull Tree indexNode, @NotNull @NotNull String indexDefName, boolean unique, @NotNull @NotNull String[] propertyNames, @NotNull @NotNull String... declaringNodeTypeNames) throws RepositoryException
Create a new property2 index definition below the givenindexNode
.- Parameters:
indexNode
-indexDefName
-unique
-propertyNames
-declaringNodeTypeNames
-- Throws:
RepositoryException
-
createIndexDefinition
public static Tree createIndexDefinition(@NotNull @NotNull Tree indexNode, @NotNull @NotNull String indexDefName, boolean unique, @NotNull @NotNull Collection<String> propertyNames, @Nullable @Nullable Collection<String> declaringNodeTypeNames, @NotNull @NotNull String propertyIndexType, @Nullable @Nullable Map<String,String> properties) throws RepositoryException
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.- Parameters:
indexNode
-indexDefName
-unique
-propertyNames
-declaringNodeTypeNames
-propertyIndexType
-properties
- any additional property to be added to the index definition.- Throws:
RepositoryException
-
createReferenceIndex
public static void createReferenceIndex(@NotNull @NotNull NodeBuilder index)
-
isIndexNodeType
public static boolean isIndexNodeType(NodeState state)
-
createIndexDefinition
public static NodeBuilder createIndexDefinition(@NotNull @NotNull NodeBuilder indexNode, @NotNull @NotNull String indexDefName, boolean unique, @NotNull @NotNull Iterable<String> propertyNames, @Nullable @Nullable String[] declaringNodeTypeNames, @NotNull @NotNull String propertyIndexType, Map<String,String> properties) throws RepositoryException
Create a new property index definition below the givenindexNode
of the providedpropertyIndexType
.- Parameters:
indexNode
- the oak:indexindexDefName
- the node for the index definitionunique
- true if uniquenesspropertyNames
- the list of properties to be indexeddeclaringNodeTypeNames
-propertyIndexType
- the type of the PropertyIndexproperties
- any additional property to be added to the index definition.- Throws:
RepositoryException
-
getAsyncLaneName
@Nullable public static @Nullable String getAsyncLaneName(NodeState idxState, String indexPath)
-
getAsyncLaneName
@Nullable public static @Nullable String getAsyncLaneName(NodeState idxState, String indexPath, PropertyState async)
-
-