Interface PlanExecutionLockService

    • Method Detail

      • runWhenNoExecutionRequestsAreBeingMade

        <V> V runWhenNoExecutionRequestsAreBeingMade​(@NotNull
                                                     @NotNull Callable<V> callable)
                                              throws Exception
        Executes the given Callable when there are no requests being made to execute plans
        Type Parameters:
        V - callable result type
        Parameters:
        callable - to execute
        Returns:
        callable result
        Throws:
        Exception - if error
      • isLocked

        boolean isLocked​(@NotNull
                         @NotNull TriggerableInternalKey lockKey)
        Checks if the given String has been locked
        Parameters:
        lockKey - to check
        Returns:
        locked state
      • lock

        <V> V lock​(@NotNull
                   @NotNull TriggerableInternalKey lockKey,
                   @NotNull
                   @NotNull AcquisitionPolicy acquisitionPolicy,
                   @NotNull
                   @NotNull Callable<V> callable)
            throws Exception
        Acquires a lock on the given TriggerableInternalKey then calls the given Callable within the global request lock
        Type Parameters:
        V - callable result type
        Parameters:
        lockKey - to lock
        acquisitionPolicy - to acquire the lock
        callable - to execute
        Returns:
        callable result
        Throws:
        Exception - if error