Interface LocalTopologyManager

    • Method Detail

      • join

        CacheTopology join​(java.lang.String cacheName,
                           CacheJoinInfo joinInfo,
                           CacheTopologyHandler stm,
                           org.infinispan.partitionhandling.impl.PartitionHandlingManager phm)
                    throws java.lang.Exception
        Forwards the join request to the coordinator.
        Returns:
        The current consistent hash.
        Throws:
        java.lang.Exception
      • leave

        void leave​(java.lang.String cacheName)
        Forwards the leave request to the coordinator.
      • confirmRebalancePhase

        void confirmRebalancePhase​(java.lang.String cacheName,
                                   int topologyId,
                                   int rebalanceId,
                                   java.lang.Throwable throwable)
        Confirm that the local cache cacheName has finished receiving the new data for topology topologyId.

        The coordinator can change during the state transfer, so we make the rebalance RPC async and we send the response as a different command.

        Parameters:
        cacheName - the name of the cache
        topologyId - the current topology id of the node at the time the rebalance is completed. This must be >= than the one when rebalance starts.
        rebalanceId -
        throwable - null unless local rebalance ended because of an error.
      • handleStatusRequest

        ManagerStatusResponse handleStatusRequest​(int viewId)
        Recovers the current topology information for all running caches and returns it to the coordinator.
        Parameters:
        viewId -
      • handleTopologyUpdate

        void handleTopologyUpdate​(java.lang.String cacheName,
                                  CacheTopology cacheTopology,
                                  AvailabilityMode availabilityMode,
                                  int viewId,
                                  Address sender)
                           throws java.lang.InterruptedException
        Updates the current and/or pending consistent hash, without transferring any state.
        Throws:
        java.lang.InterruptedException
      • handleStableTopologyUpdate

        void handleStableTopologyUpdate​(java.lang.String cacheName,
                                        CacheTopology cacheTopology,
                                        Address sender,
                                        int viewId)
        Update the stable cache topology. Mostly needed for backup, so that a new coordinator can recover the stable topology of the cluster.
      • handleRebalance

        void handleRebalance​(java.lang.String cacheName,
                             CacheTopology cacheTopology,
                             int viewId,
                             Address sender)
                      throws java.lang.InterruptedException
        Performs the state transfer.
        Throws:
        java.lang.InterruptedException
      • getCacheTopology

        CacheTopology getCacheTopology​(java.lang.String cacheName)
        Returns:
        the current topology for a cache.
      • getStableCacheTopology

        CacheTopology getStableCacheTopology​(java.lang.String cacheName)
        Returns:
        the last stable topology for a cache.
      • isTotalOrderCache

        boolean isTotalOrderCache​(java.lang.String cacheName)
        Checks if the cache defined by cacheName is using total order.

        If this component is not running or the cacheName is not defined, it returns false.

        Returns:
        true if the cache is using the total order protocol, false otherwise.
      • isRebalancingEnabled

        boolean isRebalancingEnabled()
                              throws java.lang.Exception
        Checks whether rebalancing is enabled for the entire cluster.
        Throws:
        java.lang.Exception
      • isCacheRebalancingEnabled

        boolean isCacheRebalancingEnabled​(java.lang.String cacheName)
                                   throws java.lang.Exception
        Checks whether rebalancing is enabled for the specified cache.
        Throws:
        java.lang.Exception
      • setRebalancingEnabled

        void setRebalancingEnabled​(boolean enabled)
                            throws java.lang.Exception
        Enable or disable rebalancing in the entire cluster.
        Throws:
        java.lang.Exception
      • setCacheRebalancingEnabled

        void setCacheRebalancingEnabled​(java.lang.String cacheName,
                                        boolean enabled)
                                 throws java.lang.Exception
        Enable or disable rebalancing for the specified cache.
        Throws:
        java.lang.Exception
      • getRebalancingStatus

        RebalancingStatus getRebalancingStatus​(java.lang.String cacheName)
                                        throws java.lang.Exception
        Retrieve the rebalancing status for the specified cache
        Throws:
        java.lang.Exception
      • getCacheAvailability

        AvailabilityMode getCacheAvailability​(java.lang.String cacheName)
        Retrieves the availability state of a cache.
      • setCacheAvailability

        void setCacheAvailability​(java.lang.String cacheName,
                                  AvailabilityMode availabilityMode)
                           throws java.lang.Exception
        Updates the availability state of a cache (for the entire cluster).
        Throws:
        java.lang.Exception
      • getPersistentUUID

        PersistentUUID getPersistentUUID()
        Returns the local UUID of this node. If global state persistence is enabled, this UUID will be saved and reused across restarts
      • cacheShutdown

        void cacheShutdown​(java.lang.String name)
                    throws java.lang.Exception
        Initiates a cluster-wide cache shutdown for the specified cache
        Throws:
        java.lang.Exception
      • handleCacheShutdown

        void handleCacheShutdown​(java.lang.String cacheName)
        Handles the local operations related to gracefully shutting down a cache