Interface IAsyncProcessingPipelineSegmentGroup

All Known Implementing Classes:
AsyncProcessingPipelineSegmentGroup, OperationPipelineSegmentGroup

public interface IAsyncProcessingPipelineSegmentGroup
The segment group of the DD pipeline. Can hold several segments with parallel execution, or single segment with exclusive execution.
For parallel executions there is a major limitation - only one DD segment of BM top object could be computed concurrently (this means that other contexts of this object belonging to other segments combined in a single group cannot be computed in parallel).
  • Method Details

    • confirmTaskCompletion

      boolean confirmTaskCompletion(Object objectId)
      Confirms completion of a task from the current group. As it's impossible to compute same object contexts for different segments simultaneously in a single group, the segment definition is not required.
      Parameters:
      bmObjectId - The identifier of the target top object to confirm task completion for.
      Returns:
      True of the task was confirmed successfully. False in case if the task was absent in the target pipeline
    • gatherNextAvailableTask

      Pair<String,Object> gatherNextAvailableTask(Collection<AllowedComputations> allowedComputations)
      Gathers next available task.
      Parameters:
      allowedOperations - The set of allowed operation types. May not be null
      Returns:
      The next available task if any.
    • getGroupMultiThreadingComputePolicy

      MultithreadingComputationPolicy getGroupMultiThreadingComputePolicy()
      Gets the group multithreading policy. The group always has single policy. In case if grouped segments has different policies, the group selects highest one.
      Returns:
      The combined multithreading computation policy of the group.
    • getLocks

      Map<Object,String> getLocks()
      Gets the set of current locks in the pipeline
      Returns:
      The set of current locks. May not be null
    • getRegisteredSegmentIds

      Collection<String> getRegisteredSegmentIds()
      Gets an ordered list of registered segment ids for this group.
      Returns:
      The list of segment ids for async. DD pipeline segments belonging to this group.
    • getRunningExclusiveOperationType

      OperationType getRunningExclusiveOperationType()
      Gets the type of the exclusive operation being run in the current group
      Returns:
      The running exclusive operation type, if any. null otherwise
    • getRunningExclusiveTasks

      default Map<Object,String> getRunningExclusiveTasks()
      Gets running exclusive tasks if any
      Returns:
      The map of running exclusive tasks, never null
    • getRunningHalfExclusiveTasks

      default Set<Object> getRunningHalfExclusiveTasks()
      Gets the set of running half-exclusive tasks
      Returns:
      The set of tasks, never null
    • getSegment

      IAsyncProcessingPipelineSegment getSegment(String segmentId)
      Gets the pipeline segment from the group
      Parameters:
      segmentId - The identifier of the segment
      Returns:
      The segment, if presents. Could be null
    • hasAvaiableTasks

      boolean hasAvaiableTasks(Collection<AllowedComputations> allowedComputations)
      Checks if the group has available tasks. Tasks are available in case if there are scheduled context(s) in at least one segment, and those contexts aren't blocked by currently computed DD segments (block based on the top object).
      Parameters:
      allowedOperations - Types of allowed operations (if any)
      Returns:
      True if the next task is available; false otherwise.
    • hasPriorityTasks

      boolean hasPriorityTasks()
      Checks if this group has priority tasks to compute
      Returns:
      True if the group has priority tasks to compute
    • hasScheduledContexts

      boolean hasScheduledContexts()
      Checks if the given group has any scheduled contexts,
      Returns:
      True if any of group segments contains scheduled tasks; false otherwise.
    • hasUnfinishedBlockingTasks

      boolean hasUnfinishedBlockingTasks()
      Checks if the current group has active tasks being run at the moment.
      Returns:
      True in case if there are unfinished tasks belonging to this group being computed by DD subsystem.
    • increasePriority

      void increasePriority(String segmentId)
      Increase the priority of the segment.
      Parameters:
      segmentId - The DD segement to increase the priority for. Cannot be null
    • increasePriority

      void increasePriority(String segmentId, Object objectId)
      Increases priority of a specific object DD segment. Allows async. DD facility to compute this DD segment as soon as possible.
      Parameters:
      segmentId - The identifier of the DD segment.
      objectId - The identifier of the object.
    • remove

      void remove(Object objectId)
      Removes object from all segments of this group (if any).
      Parameters:
      bmObjectId - The identifier of the object to remove pipeline registration for.
    • remove

      default void remove(String segmentId, Object objectId)
      Removes object from a specified segment of this group (if any).
      Parameters:
      segmentId - The target DD segment identifier. May not be null
      bmObjectId - The identifier of the object to remove pipeline registration for.
    • schedule

      void schedule(String segmentId, Object objectId)
      Schedules the context into the group.
      Parameters:
      segmentId - The target DD segment identifier. May not be null
      objectId - The target object identifier. Must be either Long or String. May not be null
    • scheduleOperation

      void scheduleOperation(OperationContext operationContext)
      Schedules the orchestrated operation
      Parameters:
      operationContext - The context of the operation to schedule. May not be null
    • unlockTask

      void unlockTask(Object objectId)
      Unocks the task allowing the DD to compute it
      Parameters:
      bmObjectId - The target BM object identifier
    • getModalOperationContext

      OperationContext getModalOperationContext()
      Gets the active modal operation context in this group if any
      Returns:
      The active modal operation context if any. null otherwise
    • merge

      void merge(IAsyncProcessingPipelineSegmentGroup modalGroup)
      Merges the modal operation group back to the main pipeline group
      Parameters:
      modalGroup - The modal pipeline group to merge. May not be null
    • clear

      void clear()
      Clears the group completelly
    • hasRunningImportantTasks

      boolean hasRunningImportantTasks()
      Checks if this group has any of important tasks being run at the moment
      Returns:
      True if the group has any of important tasks being run at the moment
    • getStage

      Gets a DD pipeline stage this group is belongs to
      Returns:
      The DD pipeline stage of the group. May not be null
    • deactivateContexts

      void deactivateContexts(String segmentId)
      Deactivates scheduled contexts in the pipeline group for a specified segment
      Parameters:
      segmentId - The segment to deactivate scheduled contexts for. Cannot be null