Class GridJobResultImpl

    • Constructor Detail

      • GridJobResultImpl

        public GridJobResultImpl​(ComputeJob job,
                                 IgniteUuid jobId,
                                 ClusterNode node,
                                 GridJobSiblingImpl sib)
        Parameters:
        job - Job instance.
        jobId - ID of the job.
        node - Node from where this result was received.
        sib - Sibling associated with this result.
    • Method Detail

      • getJobContext

        public ComputeJobContext getJobContext()
        Gets job context. Use job context to access job unique ID or to get/set jobs attributes. Context is attached to a job and travels with it wherever it goes. For example, if a job gets failed-over from one node to another, then its context will be failed over with it and all attributes that were set on the job on the first node will be available on the new node.
        Specified by:
        getJobContext in interface ComputeJobResult
        Returns:
        Job context.
      • getSibling

        public GridJobSiblingImpl getSibling()
        Returns:
        Sibling associated with this result.
      • isCancelled

        public boolean isCancelled()
        Gets job cancellation status. Returns true if job received cancellation request on remote node. Note that job, after receiving cancellation request, will still need to finish and return, hence ComputeJobResult.getData() method may contain execution result even if the job was canceled.

        Job can receive cancellation request if the task was explicitly cancelled from future (see IgniteFuture.cancel()) or if task completed prior to getting results from all remote jobs.

        Specified by:
        isCancelled in interface ComputeJobResult
        Returns:
        true if job received cancellation request and false otherwise.
      • setNode

        public void setNode​(ClusterNode node)
        Parameters:
        node - Node from where this result was received.
      • onResponse

        public void onResponse​(@Nullable
                               @Nullable Object data,
                               @Nullable
                               @Nullable IgniteException ex,
                               @Nullable
                               @Nullable Map<Object,​Object> jobAttrs,
                               boolean isCancelled)
        Parameters:
        data - Job data.
        ex - Job exception.
        jobAttrs - Job attributes.
        isCancelled - Whether job was cancelled or not.
      • setOccupied

        public void setOccupied​(boolean isOccupied)
        Parameters:
        isOccupied - True if job for this response is being sent.
      • isOccupied

        public boolean isOccupied()
        Returns:
        True if job for this response is being sent.
      • clearData

        public void clearData()
        Clears stored job data.
      • resetResponse

        public void resetResponse()
      • hasResponse

        public boolean hasResponse()
        Returns:
        true if remote job responded.