Class ClusteredTaskManager<T,​A,​R>

    • Field Detail

      • m_sTaskId

        protected String m_sTaskId
        The unique identity of the Task.
      • m_lTaskSequence

        protected volatile long m_lTaskSequence
        The partition based sequence number of the Task.
      • m_nPartitionId

        protected int m_nPartitionId
        The partition ID of the Task.
      • m_fRunCompletionRunnable

        protected boolean m_fRunCompletionRunnable
        A flag to indicate whether to run the completionRunnable or not.
      • m_retainDuration

        protected Duration m_retainDuration
        The Duration to retain the Task after it is complete.
      • m_cPendingExecutionStrategyUpdateCount

        protected int m_cPendingExecutionStrategyUpdateCount
        The number of events/updates/changes that have occurred since the last time the ExecutionStrategy was evaluated, which may impact the ExecutionPlan.
      • m_cPendingExecutionPlanOptimizationCount

        protected int m_cPendingExecutionPlanOptimizationCount
        The number of potential optimizations that can occurred to the ExecutionPlan since it was last optimized.
      • m_lastResult

        protected volatile Result<R> m_lastResult
        The last collected result for the Task.
      • m_nResultVersion

        protected int m_nResultVersion
        The lastResult version represented by a monotonically increasing integer value.
      • m_lCurrentResultGeneration

        protected long m_lCurrentResultGeneration
        Monotonically increasing generation counter indicating how many times a result was provided.
      • m_lProcessedResultGeneration

        protected long m_lProcessedResultGeneration
        The generation counter of the last time the results were evaluated.
      • m_fCompleted

        protected volatile boolean m_fCompleted
        A flag to indicate if the Task is now completed, in which case no further results will be accepted and no future updates will be published.
      • m_fCancelled

        protected volatile boolean m_fCancelled
        A flag to indicate if the Task is now cancelled, in which case no further results will be accepted and no future updates will be published.
    • Method Detail

      • isOwner

        public boolean isOwner​(String executorId)
        Determines if an Executor has been allocated the Task.
        Parameters:
        executorId - the Executor ID
        Returns:
        true if the Executor with the specified identifier has been allocated the Task, false otherwise.
      • getTaskId

        public String getTaskId()
        Obtains the unique identity of the Task.
        Returns:
        the unique identity of the Task
      • setRunCompletionRunnable

        public void setRunCompletionRunnable​(boolean value)
        Sets the flag to indicate if we need to run the Task.CompletionRunnable.
        Parameters:
        value - the flag to indicate if we need to run the Task.CompletionRunnable
      • getRetainDuration

        public Duration getRetainDuration()
        Obtains the Duration to retain the Task after it is complete.
        Returns:
        the Duration
      • getTask

        public Task<T> getTask()
        Obtains the Task to be executed.
        Returns:
        the Task
      • isCompleted

        public boolean isCompleted()
        Determines if the Task has completed execution and can now be removed.
        Returns:
        true if the Task has completed execution, false otherwise
      • isCancelled

        public boolean isCancelled()
        Determines if the Task has been cancelled.
        Returns:
        true if the Task has been cancelled, false otherwise
      • isDone

        public boolean isDone()
        Returns true if the Task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.
        Returns:
        true the associated Task has is done false otherwise
      • getLastResult

        public Result<R> getLastResult()
        Get the last collected Result.
        Returns:
        the last collected Result
      • getResultVersion

        public int getResultVersion()
        Get the version number of the latest result.
        Returns:
        the version number of the latest result
      • getPartitionId

        public int getPartitionId()
        Gets the partition ID.
        Returns:
        the partition ID.
      • setPartitionId

        public void setPartitionId​(int nPartitionId)
        Sets the Task partition ID.
        Parameters:
        nPartitionId - the Task partition ID to set to
      • getTaskSequence

        public long getTaskSequence()
        Gets the partition based Task sequence number.
        Returns:
        the partition based Task sequence number
      • setTaskSequence

        public void setTaskSequence​(long sequence)
        Sets the partition based Task sequence number.
        Parameters:
        sequence - the Task sequence number to set to
      • readExternal

        public void readExternal​(DataInput in)
                          throws IOException
        Description copied from interface: ExternalizableLite
        Restore the contents of this object by loading the object's state from the passed DataInput object.
        Specified by:
        readExternal in interface ExternalizableLite
        Parameters:
        in - the DataInput stream to read data from in order to restore the state of this object
        Throws:
        IOException - if an I/O exception occurs
        NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
      • writeExternal

        public void writeExternal​(DataOutput out)
                           throws IOException
        Description copied from interface: ExternalizableLite
        Save the contents of this object by storing the object's state into the passed DataOutput object.
        Specified by:
        writeExternal in interface ExternalizableLite
        Parameters:
        out - the DataOutput stream to write the state of this object to
        Throws:
        IOException - if an I/O exception occurs
      • readExternal

        public void readExternal​(PofReader in)
                          throws IOException
        Description copied from interface: PortableObject
        Restore the contents of a user type instance by reading its state using the specified PofReader object.
        Specified by:
        readExternal in interface PortableObject
        Parameters:
        in - the PofReader from which to read the object's state
        Throws:
        IOException - if an I/O error occurs
      • writeExternal

        public void writeExternal​(PofWriter out)
                           throws IOException
        Description copied from interface: PortableObject
        Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
        Specified by:
        writeExternal in interface PortableObject
        Parameters:
        out - the PofWriter to which to write the object's state
        Throws:
        IOException - if an I/O error occurs
      • getParentSpanContext

        protected com.tangosol.internal.tracing.SpanContext getParentSpanContext()
        Return the SpanContext of the span that enqueued this task.
        Returns:
        the SpanContext of the span that enqueued this task
        Since:
        22.06
      • asyncEvaluateResult

        protected boolean asyncEvaluateResult​(Result<R> originalResult)
        Evaluate the result of the Task given the current Results made by each of the assigned Executor(s), returning if a result change occurred.
        Parameters:
        originalResult - the original Result to evaluate
        Returns:
        true if a new result is available, false otherwise
      • cleanup

        protected void cleanup​(CacheService service,
                               String sKey)
        Cleanup metadata associated with the given task key.
        Parameters:
        service - the associated CacheService
        sKey - the task key
      • cleanProperties

        protected void cleanProperties​(CacheService service)
        Clean up the task properties.
        Parameters:
        service - the CacheService
      • onDeleted

        public ComposableContinuation onDeleted​(CacheService service,
                                                InvocableMap.Entry entry,
                                                com.oracle.coherence.concurrent.executor.internal.Cause cause)
        Effectively, a no-op.
        Specified by:
        onDeleted in interface com.oracle.coherence.concurrent.executor.internal.LiveObject
        Parameters:
        service - the CacheService for the LiveObject
        entry - the entry being deleted
        cause - the Cause of the Event
        Returns:
        an optional ComposableContinuation to be performed asynchronously for the LiveObject (may be null)