Class AsyncIndexUpdate
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Runnable
public class AsyncIndexUpdate extends java.lang.Object implements java.lang.Runnable, java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AsyncIndexUpdate.AsyncUpdateCallback
Index update callback that tries to raise the async status flag when the first index change is detected.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_ASYNC_NAME
Name of service property which determines the name of Async task
-
Constructor Summary
Constructors Constructor Description AsyncIndexUpdate(@NotNull java.lang.String name, @NotNull NodeStore store, @NotNull IndexEditorProvider provider)
AsyncIndexUpdate(@NotNull java.lang.String name, @NotNull NodeStore store, @NotNull IndexEditorProvider provider, boolean switchOnSync)
AsyncIndexUpdate(@NotNull java.lang.String name, @NotNull NodeStore store, @NotNull IndexEditorProvider provider, StatisticsProvider statsProvider, boolean switchOnSync)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
checkValidName(java.lang.String asyncName)
void
close()
org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.AsyncIndexStats
getIndexStats()
protected long
getLeaseTimeOut()
java.lang.String
getName()
static boolean
isAsyncLaneName(java.lang.String asyncName)
boolean
isClosed()
boolean
isFailing()
boolean
isFinished()
static java.lang.String
leasify(java.lang.String name)
protected AsyncIndexUpdate.AsyncUpdateCallback
newAsyncUpdateCallback(NodeStore store, java.lang.String name, long leaseTimeOut, java.lang.String beforeCheckpoint, org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.AsyncIndexStats indexStats, java.util.concurrent.atomic.AtomicBoolean stopFlag)
void
run()
protected AsyncIndexUpdate
setCloseTimeOut(int timeOutInSec)
void
setCorruptIndexHandler(TrackingCorruptIndexHandler corruptIndexHandler)
void
setIndexMBeanRegistration(IndexMBeanRegistration mbeanRegistration)
protected AsyncIndexUpdate
setLeaseTimeOut(long leaseTimeOut)
Milliseconds for the timeoutvoid
setValidatorProviders(java.util.List<ValidatorProvider> validatorProviders)
protected boolean
updateIndex(NodeState before, java.lang.String beforeCheckpoint, NodeState after, java.lang.String afterCheckpoint, java.lang.String afterTime, AsyncIndexUpdate.AsyncUpdateCallback callback, java.util.concurrent.atomic.AtomicReference<java.lang.String> checkpointToReleaseRef)
-
-
-
Field Detail
-
PROP_ASYNC_NAME
public static final java.lang.String PROP_ASYNC_NAME
Name of service property which determines the name of Async task- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AsyncIndexUpdate
public AsyncIndexUpdate(@NotNull @NotNull java.lang.String name, @NotNull @NotNull NodeStore store, @NotNull @NotNull IndexEditorProvider provider, boolean switchOnSync)
-
AsyncIndexUpdate
public AsyncIndexUpdate(@NotNull @NotNull java.lang.String name, @NotNull @NotNull NodeStore store, @NotNull @NotNull IndexEditorProvider provider, StatisticsProvider statsProvider, boolean switchOnSync)
-
AsyncIndexUpdate
public AsyncIndexUpdate(@NotNull @NotNull java.lang.String name, @NotNull @NotNull NodeStore store, @NotNull @NotNull IndexEditorProvider provider)
-
-
Method Detail
-
checkValidName
public static java.lang.String checkValidName(java.lang.String asyncName)
-
isAsyncLaneName
public static boolean isAsyncLaneName(java.lang.String asyncName)
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
newAsyncUpdateCallback
protected AsyncIndexUpdate.AsyncUpdateCallback newAsyncUpdateCallback(NodeStore store, java.lang.String name, long leaseTimeOut, java.lang.String beforeCheckpoint, org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.AsyncIndexStats indexStats, java.util.concurrent.atomic.AtomicBoolean stopFlag)
-
updateIndex
protected boolean updateIndex(NodeState before, java.lang.String beforeCheckpoint, NodeState after, java.lang.String afterCheckpoint, java.lang.String afterTime, AsyncIndexUpdate.AsyncUpdateCallback callback, java.util.concurrent.atomic.AtomicReference<java.lang.String> checkpointToReleaseRef) throws CommitFailedException
- Throws:
CommitFailedException
-
leasify
public static java.lang.String leasify(java.lang.String name)
-
setLeaseTimeOut
protected AsyncIndexUpdate setLeaseTimeOut(long leaseTimeOut)
Milliseconds for the timeout
-
getLeaseTimeOut
protected long getLeaseTimeOut()
-
setCloseTimeOut
protected AsyncIndexUpdate setCloseTimeOut(int timeOutInSec)
-
setValidatorProviders
public void setValidatorProviders(java.util.List<ValidatorProvider> validatorProviders)
-
setCorruptIndexHandler
public void setCorruptIndexHandler(TrackingCorruptIndexHandler corruptIndexHandler)
-
isClosed
public boolean isClosed()
-
getIndexStats
public org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.AsyncIndexStats getIndexStats()
-
isFinished
public boolean isFinished()
-
isFailing
public boolean isFailing()
-
setIndexMBeanRegistration
public void setIndexMBeanRegistration(IndexMBeanRegistration mbeanRegistration)
-
getName
public java.lang.String getName()
-
-