Package com.illumon.iris.importers.merge
Interface SyncOperator
- All Known Implementing Classes:
SyncOperator.Concurrent
,SyncOperator.ExecutorDriven
,SyncOperator.Final
,SyncOperator.Immediate
public interface SyncOperator
Abstraction for various
SyncMode
-driven behaviors.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SyncOperator.Concurrent
SyncOperator
implementation forSyncMode.CONCURRENT
.static class
SyncOperator.ExecutorDriven
static class
SyncOperator.Final
SyncOperator
implementation forSyncMode.FINAL
.static class
SyncOperator.Immediate
SyncOperator
implementation forSyncMode.IMMEDIATE
. -
Method Summary
Modifier and Type Method Description boolean
awaitAll(long timeout, TimeUnit timeoutUnit)
Await successful termination of all synchronization tasks.void
finished()
Declare that no further synchronization tasks will be submitted.void
submitSyncTask(Runnable syncTask)
Submit a synchronization task for immediate or deferred invocation.
-
Method Details
-
submitSyncTask
Submit a synchronization task for immediate or deferred invocation.- Parameters:
syncTask
- The synchronization task
-
finished
void finished()Declare that no further synchronization tasks will be submitted. -
awaitAll
boolean awaitAll(long timeout, @NotNull TimeUnit timeoutUnit) throws InterruptedException, ExecutionExceptionAwait successful termination of all synchronization tasks.- Parameters:
timeout
- The timeouttimeoutUnit
- Units for the timeout- Returns:
- True on success, false if timed out
- Throws:
InterruptedException
- If this thread was interrupted while awaiting terminationExecutionException
- If one of the synchronization tasks reported an execution exception
-