Class MutexOrchestrator
java.lang.Object
org.tasktide.mutex.orchestrator.MutexOrchestrator
Implementing
Currently the algorithm only runs as a waiter/holds the executing thread.
MutexActor lock by composing the NfsMutexActor,
and FileChannelActor which collectively offer a Mutex which
can be acquired and released.Currently the algorithm only runs as a waiter/holds the executing thread.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OrchestratorResultstatic voidClear filesstatic voidConfiguresMutexOrchestratorif not alreadystatic voidconfigureForTestCases(MutexActor nfsMutex, MutexActor fileChannelMutex) ConfiguresMutexOrchestratorwith providedMutexActorstatic voidconfirmLeader(Mutex mutex) Confirm active leadership or dropoutstatic MutexFetch activeMutexstatic booleanReturns whetherMutexOrchestratoris configuredstatic voidReleasesFileChannelActorbefore the centralMutexActoronNfsMutexActorusing theMutexFilesUtilsjitter time configured throughMutexConstantsstatic voidTry acquire lock until successful
-
Constructor Details
-
MutexOrchestrator
public MutexOrchestrator()
-
-
Method Details
-
isInitialized
public static boolean isInitialized()Returns whetherMutexOrchestratoris configured- Returns:
- boolean
-
configure
public static void configure()ConfiguresMutexOrchestratorif not already -
configureForTestCases
ConfiguresMutexOrchestratorwith providedMutexActor- Parameters:
nfsMutex-fileChannelMutex-
-
acquireLock
- Returns:
- OrchestratorResult
- Throws:
MutexCheckedException
-
tryAcquireUntilSuccess
-
releaseLock
ReleasesFileChannelActorbefore the centralMutexActoronNfsMutexActorusing theMutexFilesUtilsjitter time configured throughMutexConstants- Throws:
MutexCheckedException
-
fetchActive
-
confirmLeader
Confirm active leadership or dropout- Parameters:
mutex-- Throws:
MutexCheckedException
-
cleanUp
-