Class IndexerSupport


  • public class IndexerSupport
    extends Object
    • Field Detail

      • LOCAL_INDEX_ROOT_DIR

        public static final 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,
                              String checkpoint)
    • Method Detail

      • getMinModified

        public long getMinModified()
      • setMinModified

        public void setMinModified​(long minModified)
      • withExistingDataDumpDir

        public IndexerSupport withExistingDataDumpDir​(File existingDataDumpDir)
      • getExistingDataDumpDir

        public File getExistingDataDumpDir()
      • getCheckpoint

        public String getCheckpoint()
      • retrieveNodeStateForCheckpoint

        public NodeState retrieveNodeStateForCheckpoint()
      • setIndexDefinitions

        public void setIndexDefinitions​(File indexDefinitions)
      • getPreferredPathElements

        public Set<String> getPreferredPathElements​(List<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions)
        Returns:
        set of preferred path elements referred from the given set of index definitions.
      • getFilterPredicate

        public <T> Predicate<T> getFilterPredicate​(List<org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition> indexDefinitions,
                                                   Function<T,​String> typeToRepositoryPath)
        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> Predicate<T> getFilterPredicateBasedOnCustomRegex​(Pattern pattern,
                                                                     Function<T,​String> typeToRepositoryPath)
        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.
      • computeSizeOfGeneratedIndexData

        public long computeSizeOfGeneratedIndexData()
        Computes the total size of the generated index data. This method is intended to be used when creating Lucene indexes, which are created locally. With Elastic, this will not include the Lucene files since the indexes are updated remotely.
        Returns:
        The total size of the index data generated or -1 if there is some error while computing the size.