Interface LocalTopologyManager

    • Method Detail

      • leave

        void leave​(String cacheName,
                   long timeout)
        Forwards the leave request to the coordinator.
      • confirmRebalancePhase

        void confirmRebalancePhase​(String cacheName,
                                   int topologyId,
                                   int rebalanceId,
                                   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.
        rebalanceId - the id of the current rebalance
        throwable - null unless local rebalance ended because of an error.
      • handleStatusRequest

        CompletionStage<ManagerStatusResponse> handleStatusRequest​(int viewId)
        Recovers the current topology information for all running caches and returns it to the coordinator.
        Parameters:
        viewId - The coordinator's view id
      • handleStableTopologyUpdate

        CompletionStage<Void> handleStableTopologyUpdate​(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.

      • getCacheTopology

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

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

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

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

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

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

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

        void setCacheAvailability​(String cacheName,
                                  AvailabilityMode availabilityMode)
                           throws Exception
        Updates the availability state of a cache (for the entire cluster).
        Throws:
        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​(String name)
        Initiates a cluster-wide cache shutdown for the specified cache
      • handleCacheShutdown

        CompletionStage<Void> handleCacheShutdown​(String cacheName)
        Handles the local operations related to gracefully shutting down a cache