Interface StateProvider

  • All Known Subinterfaces:
    ScatteredStateProvider
    All Known Implementing Classes:
    StateProviderImpl

    public interface StateProvider
    Handles outbound state transfers.
    Since:
    5.2
    Author:
    anistor@redhat.com
    • Method Detail

      • isStateTransferInProgress

        boolean isStateTransferInProgress()
      • onTopologyUpdate

        CompletableFuture<Void> onTopologyUpdate​(CacheTopology cacheTopology,
                                                 boolean isRebalance)
        Receive notification of topology changes. Cancels all outbound transfers to destinations that are no longer members. The other outbound transfers remain unaffected.
        Parameters:
        cacheTopology -
        isRebalance -
      • getTransactionsForSegments

        List<TransactionInfo> getTransactionsForSegments​(Address destination,
                                                         int topologyId,
                                                         IntSet segments)
                                                  throws InterruptedException
        Gets the list of transactions that affect keys from the given segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.GET_TRANSACTIONS.
        Parameters:
        destination - the address of the requester
        topologyId -
        segments -
        Returns:
        list transactions and locks for the given segments
        Throws:
        InterruptedException
      • startOutboundTransfer

        void startOutboundTransfer​(Address destination,
                                   int topologyId,
                                   IntSet segments,
                                   boolean applyState)
                            throws InterruptedException
        Start to send cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.START_STATE_TRANSFER. If the applyState field is set to false, then upon delivery at the destination the cache entries are processed by a StateReceiver and are not applied to the local cache.
        Parameters:
        destination - the address of the requester
        topologyId -
        segments -
        applyState -
        Throws:
        InterruptedException
      • cancelOutboundTransfer

        void cancelOutboundTransfer​(Address destination,
                                    int topologyId,
                                    IntSet segments)
        Cancel sending of cache entries that belong to the given set of segments. This is invoked in response to a StateRequestCommand of type StateRequestCommand.Type.CANCEL_STATE_TRANSFER.
        Parameters:
        destination - the address of the requester
        topologyId -
        segments - the segments that we have to cancel transfer for
      • start

        void start()
      • stop

        void stop()
        Cancels all outbound state transfers. This is executed when the cache is shutting down.