Package org.apache.jackrabbit.oak.index
Class IndexerSupport
- java.lang.Object
-
- org.apache.jackrabbit.oak.index.IndexerSupport
-
public class IndexerSupport extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexHelper
indexHelper
static java.lang.String
LOCAL_INDEX_ROOT_DIR
Directory name in output directory under which indexes are stored
-
Constructor Summary
Constructors Constructor Description IndexerSupport(IndexHelper indexHelper, java.lang.String checkpoint)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeBuilder
childBuilder(NodeBuilder nb, java.lang.String path, boolean createNew)
java.io.File
copyIndexFilesToOutput()
protected void
dumpIndexDefinitions(NodeStore nodeStore)
java.lang.String
getCheckpoint()
java.util.Map<java.lang.String,java.lang.String>
getCheckpointInfo()
java.io.File
getExistingDataDumpDir()
<T> java.util.function.Predicate<T>
getFilterPredicate(java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions, java.util.function.Function<T,java.lang.String> typeToRepositoryPath)
<T> java.util.function.Predicate<T>
getFilterPredicateBasedOnCustomRegex(java.util.regex.Pattern pattern, java.util.function.Function<T,java.lang.String> typeToRepositoryPath)
java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition>
getIndexDefinitions()
java.io.File
getLocalIndexDir()
java.util.Set<java.lang.String>
getPreferredPathElements(java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions)
void
postIndexWork(NodeStore copyOnWriteStore)
NodeState
retrieveNodeStateForCheckpoint()
void
setIndexDefinitions(java.io.File indexDefinitions)
void
switchIndexLanesAndReindexFlag(NodeStore copyOnWriteStore)
protected void
switchIndexLanesBack(NodeStore copyOnWriteStore)
void
updateIndexDefinitions(NodeBuilder rootBuilder)
IndexerSupport
withExistingDataDumpDir(java.io.File existingDataDumpDir)
void
writeMetaInfo(java.lang.String checkpoint)
-
-
-
Field Detail
-
LOCAL_INDEX_ROOT_DIR
public static final java.lang.String LOCAL_INDEX_ROOT_DIR
Directory name in output directory under which indexes are stored- See Also:
- Constant Field Values
-
indexHelper
protected final IndexHelper indexHelper
-
-
Constructor Detail
-
IndexerSupport
public IndexerSupport(IndexHelper indexHelper, java.lang.String checkpoint)
-
-
Method Detail
-
withExistingDataDumpDir
public IndexerSupport withExistingDataDumpDir(java.io.File existingDataDumpDir)
-
getExistingDataDumpDir
public java.io.File getExistingDataDumpDir()
-
getLocalIndexDir
public java.io.File getLocalIndexDir() throws java.io.IOException
- Throws:
java.io.IOException
-
copyIndexFilesToOutput
public java.io.File copyIndexFilesToOutput() throws java.io.IOException
- Throws:
java.io.IOException
-
writeMetaInfo
public void writeMetaInfo(java.lang.String checkpoint) throws java.io.IOException
- Throws:
java.io.IOException
-
getCheckpoint
public java.lang.String getCheckpoint()
-
retrieveNodeStateForCheckpoint
public NodeState retrieveNodeStateForCheckpoint()
-
updateIndexDefinitions
public void updateIndexDefinitions(NodeBuilder rootBuilder) throws java.io.IOException, CommitFailedException
- Throws:
java.io.IOException
CommitFailedException
-
dumpIndexDefinitions
protected void dumpIndexDefinitions(NodeStore nodeStore) throws java.io.IOException
- Throws:
java.io.IOException
-
switchIndexLanesAndReindexFlag
public void switchIndexLanesAndReindexFlag(NodeStore copyOnWriteStore) throws CommitFailedException, java.io.IOException
- Throws:
CommitFailedException
java.io.IOException
-
postIndexWork
public void postIndexWork(NodeStore copyOnWriteStore) throws CommitFailedException, java.io.IOException
- Throws:
CommitFailedException
java.io.IOException
-
switchIndexLanesBack
protected void switchIndexLanesBack(NodeStore copyOnWriteStore) throws CommitFailedException
- Throws:
CommitFailedException
-
getCheckpointInfo
public java.util.Map<java.lang.String,java.lang.String> getCheckpointInfo()
-
setIndexDefinitions
public void setIndexDefinitions(java.io.File indexDefinitions)
-
childBuilder
public static NodeBuilder childBuilder(NodeBuilder nb, java.lang.String path, boolean createNew)
-
getIndexDefinitions
public java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> getIndexDefinitions() throws java.io.IOException, CommitFailedException
- Throws:
java.io.IOException
CommitFailedException
-
getPreferredPathElements
public java.util.Set<java.lang.String> getPreferredPathElements(java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions)
- Parameters:
indexDefinitions
-- Returns:
- set of preferred path elements referred from the given set of index definitions.
-
getFilterPredicate
public <T> java.util.function.Predicate<T> getFilterPredicate(java.util.Set<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions, java.util.function.Function<T,java.lang.String> typeToRepositoryPath)
- Type Parameters:
T
-- Parameters:
indexDefinitions
- set of IndexDefinition to be used to calculate the Path PredicatetypeToRepositoryPath
- Function to convert typeto valid repository path of type - Returns:
- filter predicate based on the include/exclude path rules of the given set of index definitions.
-
getFilterPredicateBasedOnCustomRegex
public <T> java.util.function.Predicate<T> getFilterPredicateBasedOnCustomRegex(java.util.regex.Pattern pattern, java.util.function.Function<T,java.lang.String> typeToRepositoryPath)
- Type Parameters:
T
-- Parameters:
pattern
- Pattern for a custom excludes regex based on which paths would be filtered outtypeToRepositoryPath
- Function to convert typeto valid repository path of type - Returns:
- Return a predicate that should test true for all paths that do not match the provided regex pattern.
-
-