org.apache.ignite.spi.failover

## Interface FailoverContext

-     public interface FailoverContext

  This interface defines a set of operations available to failover SPI one a given failed job.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `@Nullable String` | `affinityCacheName()` Returns affinity cache name `IgniteCompute.affinityRun(String, Object, IgniteRunnable)` and `IgniteCompute.affinityCall(String, Object, IgniteCallable)`.
    `ClusterNode` | `getBalancedNode(List<ClusterNode> top)` Gets the next balanced node for failed job.
    `ComputeJobResult` | `getJobResult()` Gets failed result of job execution.
    `ComputeTaskSession` | `getTaskSession()` Gets current task session.
    `int` | `partition()` Gets partition for `IgniteCompute.affinityRun(Collection, int, IgniteRunnable)` and `IgniteCompute.affinityCall(Collection, int, IgniteCallable)`.

- - ### Method Detail

    - #### getTaskSession

          ComputeTaskSession getTaskSession()

      Gets current task session.
      Returns:
        Grid task session.

    - #### getJobResult

          ComputeJobResult getJobResult()

      Gets failed result of job execution.
      Returns:
        Result of a failed job.

    - #### getBalancedNode

          ClusterNode getBalancedNode(List<ClusterNode> top)
                               throws IgniteException

      Gets the next balanced node for failed job. Internally this method will delegate to load balancing SPI (see `LoadBalancingSpi` to determine the optimal node for execution.
      Parameters:
        `top` - Topology to pick balanced node from.
      Returns:
        The next balanced node.
      Throws:
        `IgniteException` - If anything failed.

    - #### partition

          int partition()

      Gets partition for `IgniteCompute.affinityRun(Collection, int, IgniteRunnable)` and `IgniteCompute.affinityCall(Collection, int, IgniteCallable)`.
      Returns:
        Partition number.

    - #### affinityCacheName

          @Nullable
          @Nullable String affinityCacheName()

      Returns affinity cache name `IgniteCompute.affinityRun(String, Object, IgniteRunnable)` and `IgniteCompute.affinityCall(String, Object, IgniteCallable)`.
      Returns:
        Cache name.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020