org.apache.ignite.internal.processors.cache.persistence.file

## 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. Uses `ReadWriteLock` to provide such synchronization scenario.

### Constructor Summary

Constructors
Constructor and Description
`LongOperationAsyncExecutor(String igniteInstanceName, IgniteLogger log)`

### Method Summary

All Methods Instance Methods Concrete Methods
`<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)`.
`void` `async(Runnable runnable)` Executes long operation in dedicated thread.
`void` `awaitAsyncTaskCompletion(boolean cancel)` Cancels async tasks.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020