Class PurgeOldIndexVersion

    • Field Detail

      • closer

        protected final Closer closer
    • Constructor Detail

      • PurgeOldIndexVersion

        public PurgeOldIndexVersion()
    • Method Detail

      • execute

        public void execute​(NodeStore nodeStore,
                            boolean isReadWriteRepository,
                            long purgeThresholdMillis,
                            List<String> indexPaths)
                     throws 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:
        IOException
        CommitFailedException
      • execute

        public void execute​(NodeStore nodeStore,
                            boolean isReadWriteRepository,
                            long purgeThresholdMillis,
                            List<String> indexPaths,
                            boolean shouldPurgeBaseIndex)
                     throws 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:
        IOException
        CommitFailedException
      • getIndexType

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

        protected abstract void postDeleteOp​(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