Class ClusteredAssignment

  • All Implemented Interfaces:
    com.tangosol.io.ExternalizableLite, com.tangosol.io.pof.PortableObject, Serializable

    public class ClusteredAssignment
    extends Object
    implements com.tangosol.io.ExternalizableLite, com.tangosol.io.pof.PortableObject
    Represents the state of a Task assignment to a registered Executor.
    Since:
    21.06
    Author:
    bo
    See Also:
    Serialized Form
    • Constructor Detail

      • ClusteredAssignment

        public ClusteredAssignment()
        Constructs a ClusteredAssignment (required for serialization).
    • Method Detail

      • readExternal

        public void readExternal​(DataInput in)
                          throws IOException
        Specified by:
        readExternal in interface com.tangosol.io.ExternalizableLite
        Throws:
        IOException
      • writeExternal

        public void writeExternal​(DataOutput out)
                           throws IOException
        Specified by:
        writeExternal in interface com.tangosol.io.ExternalizableLite
        Throws:
        IOException
      • readExternal

        public void readExternal​(com.tangosol.io.pof.PofReader in)
                          throws IOException
        Specified by:
        readExternal in interface com.tangosol.io.pof.PortableObject
        Throws:
        IOException
      • writeExternal

        public void writeExternal​(com.tangosol.io.pof.PofWriter out)
                           throws IOException
        Specified by:
        writeExternal in interface com.tangosol.io.pof.PortableObject
        Throws:
        IOException
      • getTaskId

        public String getTaskId()
        Obtains the Task identity.
        Returns:
        the Task identity
      • isRecovered

        public boolean isRecovered()
        Determines if the Task was recovered from being previously assigned to a different Executor.
        Returns:
        true if previously assigned to a different Executor, false otherwise
      • setRecovered

        public void setRecovered​(boolean fRecovered)
        Sets if the Task was previously assigned to a different Executor.
        Parameters:
        fRecovered - true if previously assigned to a different Executor, false otherwise
      • getCacheKey

        public String getCacheKey()
        Obtains the NamedCache key to use for the ClusteredAssignment.
        Returns:
        the NamedCache key for this assignment
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getCacheKey

        public static String getCacheKey​(String sExecutorId,
                                         String sTaskId)
        Obtains the NamedCache key to use for the ClusteredAssignment.
        Parameters:
        sExecutorId - the Executor identity
        sTaskId - the Task identity
        Returns:
        the NamedCache key for this assignment
      • registerAssignments

        public static void registerAssignments​(String sTaskId,
                                               ExecutionPlan executionPlan,
                                               com.tangosol.net.CacheService service)
        Process a list of assignments for a task.
        Parameters:
        sTaskId - the task
        executionPlan - the list of assignments
        service - the CacheService
      • cancelAssignments

        public static void cancelAssignments​(String sTaskId,
                                             com.tangosol.net.CacheService service)
        Cancels all assignments that are currently running.
        Parameters:
        sTaskId - the task
        service - the CacheService
      • removeAssignments

        public static void removeAssignments​(String sTaskId,
                                             com.tangosol.net.CacheService service)
        Remove assignments for a task.
        Parameters:
        sTaskId - the task
        service - the CacheService