Interface IgniteSpi

    • Method Detail

      • getName

        String getName()
        Gets SPI name.
        Returns:
        SPI name.
      • getNodeAttributes

        Map<String,​Object> getNodeAttributes()
                                            throws IgniteSpiException
        This method is called before SPI starts (before method spiStart(String) is called). It allows SPI implementation to add attributes to a local node. Kernal collects these attributes from all SPI implementations loaded up and then passes it to discovery SPI so that they can be exchanged with other nodes.
        Returns:
        Map of local node attributes this SPI wants to add.
        Throws:
        IgniteSpiException - Throws in case of any error.
      • spiStart

        void spiStart​(@Nullable
                      @Nullable String igniteInstanceName)
               throws IgniteSpiException
        This method is called to start SPI. After this method returns successfully kernel assumes that SPI is fully operational.
        Parameters:
        igniteInstanceName - Name of Ignite instance this SPI is being started for (null for default Ignite instance).
        Throws:
        IgniteSpiException - Throws in case of any error during SPI start.
      • onContextInitialized

        void onContextInitialized​(IgniteSpiContext spiCtx)
                           throws IgniteSpiException
        Callback invoked when SPI context is initialized. SPI implementation may store SPI context for future access.

        This method is invoked after spiStart(String) method is completed, so SPI should be fully functional at this point. Use this method for post-start initialization, such as subscribing a discovery listener, sending a message to remote node, etc...

        Parameters:
        spiCtx - Spi context.
        Throws:
        IgniteSpiException - If context initialization failed (grid will be stopped).
      • onContextDestroyed

        void onContextDestroyed()
        Callback invoked prior to stopping grid before SPI context is destroyed. Once this method is complete, grid will begin shutdown sequence. Use this callback for de-initialization logic that may involve SPI context. Note that invoking SPI context after this callback is complete is considered illegal and may produce unknown results.

        If IgniteSpiAdapter is used for SPI implementation, then it will replace actual context with dummy no-op context which is usually good-enough since grid is about to shut down.

      • spiStop

        void spiStop()
              throws IgniteSpiException
        This method is called to stop SPI. After this method returns kernel assumes that this SPI is finished and all resources acquired by it are released.

        Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.

        Throws:
        IgniteSpiException - Thrown in case of any error during SPI stop.
      • onClientDisconnected

        void onClientDisconnected​(IgniteFuture<?> reconnectFut)
        Client node disconnected callback.
        Parameters:
        reconnectFut - Future that will be completed when client reconnected.
      • onClientReconnected

        void onClientReconnected​(boolean clusterRestarted)
        Client node reconnected callback.
        Parameters:
        clusterRestarted - True if all cluster nodes restarted while client was disconnected.