Package com.qfs.pool

Class ATasksPerNumaNode

java.lang.Object
com.qfs.pool.ATasksPerNumaNode
Direct Known Subclasses:
TasksPerNumaNode

public abstract class ATasksPerNumaNode extends Object
A CancellableCountedCompleter for components that can collect tasks to bind on NUMA nodes, and then run them all.
Author:
ActiveViam
  • Constructor Details

    • ATasksPerNumaNode

      public ATasksPerNumaNode()
  • Method Details

    • merge

      public abstract ATasksPerNumaNode merge(int defaultNumaNode, ATasksPerNumaNode toMerge)
      Merges all the given tasks inside this set of tasks, preserving the binding (NUMA node -> set of tasks) unchanged.
      Parameters:
      defaultNumaNode - the NUMA node on which to run all the merged tasks tagged with WHATEVER_NUMA_NODE
      toMerge - the ATasksPerNumaNode to merge into this one
      Returns:
      this instance, with the contribution of the given toMerge
    • merge

      public ATasksPerNumaNode merge(ATasksPerNumaNode tasksToMerge)
      Merges all the given tasks inside this set of tasks, preserving the binding (NUMA node -> set of tasks) unchanged.
      Parameters:
      tasksToMerge - the ATasksPerNumaNode to merge into this one
      Returns:
      this instance, with the contribution of the given toMerge
    • add

      public abstract ATasksPerNumaNode add(int numaNode, Runnable runnable)
      Adds the given action, binding it to the given NUMA node.
      Parameters:
      numaNode - the ID of the thread pool in which to run the compression action, or WHATEVER_NUMA_NODE if it doesn't matter
      runnable - the action to run
      Returns:
      this instance, with the new Runnable
    • add

      public ATasksPerNumaNode add(Runnable runnable)
      Adds the given action, binding it to the default NUMA node.
      Parameters:
      runnable - the action to run
      Returns:
      this instance, with the new Runnable
    • forEachTask

      public abstract void forEachTask(BiConsumer<Integer,Runnable> consumer)
      Iterates over all the registered tasks.
      Parameters:
      consumer - a BiConsumer that will be called for each registered task, along with the NUMA node ID it is bound to