Class PlatformBalancingMultiClosureTask

    • Constructor Detail

      • PlatformBalancingMultiClosureTask

        public PlatformBalancingMultiClosureTask​(PlatformContext ctx,
                                                 long taskPtr)
        Constructor.
        Parameters:
        ctx - Platform context.
        taskPtr - Task pointer.
    • Method Detail

      • map

        @NotNull
        public @NotNull Map<? extends ComputeJob,​ClusterNode> map​(List<ClusterNode> subgrid,
                                                                        @Nullable
                                                                        @Nullable Object arg)
        This method is called to map or split grid task into multiple grid jobs. This is the first method that gets called when task execution starts.
        Parameters:
        subgrid - Nodes available for this task execution. Note that order of nodes is guaranteed to be randomized by container. This ensures that every time you simply iterate through grid nodes, the order of nodes will be random which over time should result into all nodes being used equally.
        arg - Task execution argument. Can be null. This is the same argument as the one passed into Grid#execute(...) methods.
        Returns:
        Map of grid jobs assigned to subgrid node. Unless ComputeTaskContinuousMapper is injected into task, if null or empty map is returned, exception will be thrown.