Class PurgeOldIndexVersion
- java.lang.Object
-
- org.apache.jackrabbit.oak.indexversion.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
-
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, java.util.List<java.lang.String> indexPaths)
Execute purging index based on the index version naming and last time index time.void
execute(NodeStore nodeStore, boolean isReadWriteRepository, long purgeThresholdMillis, java.util.List<java.lang.String> indexPaths, boolean shouldPurgeBaseIndex)
Execute purging index based on the index version naming and last time index timeprotected abstract @NotNull java.lang.String
getIndexType()
protected abstract IndexVersionOperation
getIndexVersionOperationInstance(IndexName indexName)
java.util.List<IndexVersionOperation>
getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, java.util.List<java.lang.String> indexPaths)
java.util.List<IndexVersionOperation>
getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, java.util.List<java.lang.String> indexPaths, boolean shouldPurgeBaseIndex)
protected abstract void
postDeleteOp(java.lang.String idxPath)
protected abstract void
preserveDetailsFromIndexDefForPostOp(NodeBuilder builder)
To preserve any required details from index def builder to be used in post op
-
-
-
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 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:
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 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:
java.io.IOException
CommitFailedException
-
getPurgeIndexes
public java.util.List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, java.util.List<java.lang.String> indexPaths, boolean shouldPurgeBaseIndex) throws java.io.IOException, CommitFailedException
- Throws:
java.io.IOException
CommitFailedException
-
getPurgeIndexes
public java.util.List<IndexVersionOperation> getPurgeIndexes(NodeStore nodeStore, long purgeThresholdMillis, java.util.List<java.lang.String> indexPaths) throws java.io.IOException, CommitFailedException
- 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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
getIndexVersionOperationInstance
protected abstract IndexVersionOperation getIndexVersionOperationInstance(IndexName indexName)
-
-