Class 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. Uses ReadWriteLock to provide such synchronization scenario.
    • 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 by async(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.