Class FilePageStoreManager.LongOperationAsyncExecutor
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.LongOperationAsyncExecutor
-
- Enclosing class:
- FilePageStoreManager
protected static class FilePageStoreManager.LongOperationAsyncExecutor extends Object
Synchronization wrapper for long operations that should be executed asynchronously and operations that can not be executed in parallel with long operation. UsesReadWriteLockto provide such synchronization scenario.
-
-
Constructor Summary
Constructors Constructor Description LongOperationAsyncExecutor(String igniteInstanceName, IgniteLogger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TafterAsyncCompletion(IgniteOutClosure<T> closure)Executes closure that can't run in parallel with long operation that is executed byasync(java.lang.Runnable).voidasync(Runnable runnable)Executes long operation in dedicated thread.voidawaitAsyncTaskCompletion(boolean cancel)Cancels async tasks.
-
-
-
Constructor Detail
-
LongOperationAsyncExecutor
public LongOperationAsyncExecutor(String igniteInstanceName, IgniteLogger log)
-
-
Method Detail
-
async
public void async(Runnable runnable)
Executes long operation in dedicated thread. Uses write lock as such operations can't run simultaneously.- Parameters:
runnable- long operation
-
afterAsyncCompletion
public <T> T afterAsyncCompletion(IgniteOutClosure<T> closure)
Executes closure that can't run in parallel with long operation that is executed byasync(java.lang.Runnable). Uses read lock as such closures can run in parallel with each other.- Type Parameters:
T- return type.- Parameters:
closure- closure.- Returns:
- value that is returned by
closure.
-
awaitAsyncTaskCompletion
public void awaitAsyncTaskCompletion(boolean cancel)
Cancels async tasks.
-
-