Class GridJobProcessor

    • Constructor Detail

      • GridJobProcessor

        public GridJobProcessor​(GridKernalContext ctx)
        Parameters:
        ctx - Kernal context.
    • Method Detail

      • stop

        public void stop​(boolean cancel)
        Stops grid component.
        Specified by:
        stop in interface GridComponent
        Overrides:
        stop in class GridProcessorAdapter
        Parameters:
        cancel - If true, then all ongoing tasks or jobs for relevant components need to be cancelled.
      • onKernalStop

        public void onKernalStop​(boolean cancel)
        Callback to notify that kernal is about to stop.
        Specified by:
        onKernalStop in interface GridComponent
        Overrides:
        onKernalStop in class GridProcessorAdapter
        Parameters:
        cancel - Flag indicating whether jobs should be canceled.
      • activeJob

        @Nullable
        public @Nullable GridJobWorker activeJob​(IgniteUuid jobId)
        Gets active job.
        Parameters:
        jobId - Job ID.
        Returns:
        Active job.
      • internal

        public boolean internal()
        Returns:
        True if running internal task.
      • masterLeaveLocal

        public void masterLeaveLocal​(IgniteUuid sesId)
        Notify processor that master leave aware handler must be invoked on all jobs with the given session ID.
        Parameters:
        sesId - Session ID.
      • cancelJob

        public void cancelJob​(@Nullable
                              @Nullable IgniteUuid sesId,
                              @Nullable
                              @Nullable IgniteUuid jobId,
                              boolean sys)
        Parameters:
        sesId - Session ID.
        jobId - Job ID.
        sys - System flag.
      • handleCollisions

        public void handleCollisions()
        Handles collisions.

        In most cases this method should be called from main read lock to avoid jobs activation after node stop has started.

      • currentTaskSession

        public void currentTaskSession​(GridJobSessionImpl ses)
        Callback from job worker to set current task session for execution.
        Parameters:
        ses - Session.
      • currentTaskNameHash

        public int currentTaskNameHash()
        Gets hash of task name executed by current thread.
        Returns:
        Task name hash or 0 if security is disabled.
      • currentTaskName

        public String currentTaskName()
        Gets name task executed by current thread.
        Returns:
        Task name or null if security is disabled.
      • currentDeployment

        public GridDeployment currentDeployment()
        Returns current deployment.
        Returns:
        Deployment.
      • onChangeTaskAttributes

        public void onChangeTaskAttributes​(IgniteUuid sesId,
                                           IgniteUuid jobId,
                                           Map<?,​?> attrs)
        Callback on changing task attributes.
        Parameters:
        sesId - Session ID.
        jobId - Job ID.
        attrs - Changed attributes.
      • jobStatuses

        public Map<ComputeJobStatusEnum,​Long> jobStatuses​(IgniteUuid sesId)
        Parameters:
        sesId - Task session ID.
        Returns:
        Job statistics for the task. Mapping: Job status -> count of jobs.
      • computeJobWorkerInterruptTimeout

        public long computeJobWorkerInterruptTimeout()
        Returns:
        Interruption timeout of workers (in millis) after cancel is called.