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 void
close()
void
execute(NodeStore nodeStore, boolean isReadWriteRepository, long purgeThresholdMillis, List<String> indexPaths)
Execute purging index based on the index version naming and last time index time.void
execute(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 String
getIndexType()
protected abstract IndexVersionOperation
getIndexVersionOperationInstance(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 void
postDeleteOp(String idxPath)
protected abstract void
preserveDetailsFromIndexDefForPostOp(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:
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 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:
IOException
CommitFailedException
-
getPurgeIndexes
public List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths, boolean shouldPurgeBaseIndex) throws IOException, CommitFailedException
- Throws:
IOException
CommitFailedException
-
getPurgeIndexes
public List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, List<String> indexPaths) throws IOException, CommitFailedException
- 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
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getIndexVersionOperationInstance
protected abstract IndexVersionOperation getIndexVersionOperationInstance(IndexName indexName)
-
-