Class IndexerSupport


  • public class IndexerSupport
    extends java.lang.Object
    • 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
    • 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()
      • dumpIndexDefinitions

        protected void dumpIndexDefinitions​(NodeStore nodeStore)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • 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 Predicate
        typeToRepositoryPath - Function to convert type to 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 out
        typeToRepositoryPath - Function to convert type to valid repository path of type
        Returns:
        Return a predicate that should test true for all paths that do not match the provided regex pattern.