Package com.qfs.pool

Class ATasksPerNumaNode

    • Constructor Detail

      • ATasksPerNumaNode

        public ATasksPerNumaNode()
    • Method Detail

      • 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