Interface DiscoveryService


  • public interface DiscoveryService
    The discovery service can be used to get the current topology view.

    The discovery service is in charge of managing live instances that have announced themselves as being part of a topology view. The exact details of how this announcement occurs is implementation dependent.

    • Method Detail

      • getTopology

        TopologyView getTopology()
        Returns the topology that was last discovered by this service.

        If for some reason the service is currently not able to do topology discovery it will return the last valid topology marked with false in the call to . This is also true if the service has noticed a potential change in the topology and is in the process of settling the change in the topology (eg with peers, ie voting).

        Note that this call is synchronized with TopologyEventListener.handleTopologyEvent() calls: ie if calls to TopologyEventListener.handleTopologyEvent() are currently ongoing, then the call to this method will block until all TopologyEventListeners have been called. Be careful not to cause deadlock situations.

        Returns:
        the topology that was last discovered by this service. This will never be null (ie even if a change in the topology is ongoing at the moment or the cluster consists only of the local instance).