Class PurgeOldIndexVersion

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    LucenePurgeOldIndexVersion

    public abstract class PurgeOldIndexVersion
    extends java.lang.Object
    implements java.io.Closeable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.jackrabbit.guava.common.io.Closer closer  
    • Field Detail

      • closer

        protected final org.apache.jackrabbit.guava.common.io.Closer closer
    • Constructor Detail

      • PurgeOldIndexVersion

        public PurgeOldIndexVersion()
    • Method Detail

      • execute

        public void execute​(NodeStore nodeStore,
                            boolean isReadWriteRepository,
                            long purgeThresholdMillis,
                            java.util.List<java.lang.String> indexPaths)
                     throws java.io.IOException,
                            CommitFailedException
        Execute purging index based on the index version naming and last time index time. This will purge base index.
        Parameters:
        nodeStore - the node store
        isReadWriteRepository - bool to indicate if it's read write repository, if yes, the purge index will not execute
        purgeThresholdMillis - the threshold of time length since last time index time to determine, will purge if exceed that
        indexPaths - the index path or parent path
        Throws:
        java.io.IOException
        CommitFailedException
      • execute

        public void execute​(NodeStore nodeStore,
                            boolean isReadWriteRepository,
                            long purgeThresholdMillis,
                            java.util.List<java.lang.String> indexPaths,
                            boolean shouldPurgeBaseIndex)
                     throws java.io.IOException,
                            CommitFailedException
        Execute purging index based on the index version naming and last time index time
        Parameters:
        nodeStore - the node store
        isReadWriteRepository - bool to indicate if it's read write repository, if yes, the purge index will not execute
        purgeThresholdMillis - the threshold of time length since last time index time to determine, will purge if exceed that
        indexPaths - the index path or parent path
        shouldPurgeBaseIndex - If set to true, will apply purge operations on active base index i.e. DELETE or DELETE_HIDDEN_AND_DISABLE
        Throws:
        java.io.IOException
        CommitFailedException
      • getIndexType

        @NotNull
        protected abstract @NotNull java.lang.String getIndexType()
        Returns:
        IndexType served by the implementation like lucene or elasticsearch
      • postDeleteOp

        protected abstract void postDeleteOp​(java.lang.String idxPath)
        Parameters:
        idxPath - - index path on which to perform post delete operations
      • preserveDetailsFromIndexDefForPostOp

        protected abstract void preserveDetailsFromIndexDefForPostOp​(NodeBuilder builder)
        To preserve any required details from index def builder to be used in post op
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException