public class PlanExecutionLockServiceImpl extends Object implements PlanExecutionLockService
| Constructor and Description |
|---|
PlanExecutionLockServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
<V> V |
inlineProcessLocks(TriggerableInternalKey internalKey,
AcquisitionPolicy acquisitionPolicy,
Callable<V> callable)
A parallel locking mechanism that allows a backdoor to the standard lock.
|
void |
interruptLockOwner(TriggerableInternalKey internalKey)
Interrupts the owner of the lock represented by
TriggerableInternalKey |
boolean |
isLocked(TriggerableInternalKey internalKey)
Checks if the given
String has been locked |
<V> V |
lock(TriggerableInternalKey internalKey,
AcquisitionPolicy acquisitionPolicy,
Callable<V> callable)
Quick note about the implementation
Since the acquisition policy
AcquisitionPolicy.WAIT can block for an indefinite amount of time
we acquire this lock before trying to take the global execution lock otherwise callers to runWhenNoExecutionRequestsAreBeingMade(Callable)
in the worst case will wait indefinitely. |
<V> V |
runWhenNoExecutionRequestsAreBeingMade(Callable<V> callable)
Executes the given
Callable when there are no requests being made to execute plans |
public <V> V runWhenNoExecutionRequestsAreBeingMade(@NotNull
Callable<V> callable)
throws Exception
PlanExecutionLockServiceCallable when there are no requests being made to execute plansrunWhenNoExecutionRequestsAreBeingMade in interface PlanExecutionLockServiceV - callable result typecallable - to executeException - if errorpublic boolean isLocked(@NotNull
TriggerableInternalKey internalKey)
PlanExecutionLockServiceString has been lockedisLocked in interface PlanExecutionLockServiceinternalKey - to check@Nullable
public <V> V lock(@NotNull
TriggerableInternalKey internalKey,
@NotNull
AcquisitionPolicy acquisitionPolicy,
@NotNull
Callable<V> callable)
throws Exception
AcquisitionPolicy.WAIT can block for an indefinite amount of time
we acquire this lock before trying to take the global execution lock otherwise callers to runWhenNoExecutionRequestsAreBeingMade(Callable)
in the worst case will wait indefinitely.lock in interface PlanExecutionLockServiceV - callable result typeinternalKey - to lockacquisitionPolicy - to acquire the lockcallable - to executeException - if error@Nullable
public <V> V inlineProcessLocks(@NotNull
TriggerableInternalKey internalKey,
@NotNull
AcquisitionPolicy acquisitionPolicy,
@NotNull
Callable<V> callable)
throws Exception
PlanExecutionLockServicePlanExecutionLockService.isLocked(TriggerableInternalKey) and PlanExecutionLockService.interruptLockOwner(TriggerableInternalKey)inlineProcessLocks in interface PlanExecutionLockServiceExceptionpublic void interruptLockOwner(@NotNull
TriggerableInternalKey internalKey)
PlanExecutionLockServiceTriggerableInternalKeyinterruptLockOwner in interface PlanExecutionLockServiceCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.