Class PurgeOldIndexVersion
- java.lang.Object
-
- org.apache.jackrabbit.oak.indexversion.PurgeOldIndexVersion
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
LucenePurgeOldIndexVersion
public abstract class PurgeOldIndexVersion extends Object implements Closeable
-
-
Constructor Summary
Constructors Constructor Description PurgeOldIndexVersion()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()voidexecute(NodeStore nodeStore, boolean isReadWriteRepository, long purgeThresholdMillis, List<String> indexPaths)Execute purging index based on the index version naming and last time index time.voidexecute(NodeStore nodeStore, boolean isReadWriteRepository, long purgeThresholdMillis, List<String> indexPaths, boolean shouldPurgeBaseIndex)Execute purging index based on the index version naming and last time index timeprotected abstract @NotNull StringgetIndexType()protected abstract IndexVersionOperationgetIndexVersionOperationInstance(IndexName indexName)List<IndexVersionOperation>getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths)List<IndexVersionOperation>getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths, boolean shouldPurgeBaseIndex)protected abstract voidpostDeleteOp(String idxPath)protected abstract voidpreserveDetailsFromIndexDefForPostOp(NodeBuilder builder)To preserve any required details from index def builder to be used in post op
-
-
-
Field Detail
-
closer
protected final Closer closer
-
-
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 storeisReadWriteRepository- bool to indicate if it's read write repository, if yes, the purge index will not executepurgeThresholdMillis- the threshold of time length since last time index time to determine, will purge if exceed thatindexPaths- the index path or parent path- Throws:
IOExceptionCommitFailedException
-
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 storeisReadWriteRepository- bool to indicate if it's read write repository, if yes, the purge index will not executepurgeThresholdMillis- the threshold of time length since last time index time to determine, will purge if exceed thatindexPaths- the index path or parent pathshouldPurgeBaseIndex- If set to true, will apply purge operations on active base index i.e. DELETE or DELETE_HIDDEN_AND_DISABLE- Throws:
IOExceptionCommitFailedException
-
getPurgeIndexes
public List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths, boolean shouldPurgeBaseIndex) throws IOException, CommitFailedException
- Throws:
IOExceptionCommitFailedException
-
getPurgeIndexes
public List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths) throws IOException, CommitFailedException
- Throws:
IOExceptionCommitFailedException
-
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
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getIndexVersionOperationInstance
protected abstract IndexVersionOperation getIndexVersionOperationInstance(IndexName indexName)
-
-