Class ExchangeLatchManager


  • public class ExchangeLatchManager
    extends Object
    Class is responsible to create and manage instances of distributed latches Latch.
    • Field Detail

      • PROTOCOL_V2_VERSION_SINCE

        public static final IgniteProductVersion PROTOCOL_V2_VERSION_SINCE
        Exchange latch V2 protocol introduces following optimization: Joining nodes are explicitly excluded from possible latch participants.
    • Constructor Detail

      • ExchangeLatchManager

        public ExchangeLatchManager​(GridKernalContext ctx)
        Constructor.
        Parameters:
        ctx - Kernal context.
    • Method Detail

      • getOrCreate

        public Latch getOrCreate​(String id,
                                 AffinityTopologyVersion topVer)
        Creates new latch with specified id and topVer or returns existing latch. Participants of latch are calculated from given topVer as alive server nodes. If local node is coordinator ServerLatch instance will be created, otherwise ClientLatch instance.
        Parameters:
        id - Latch id.
        topVer - Latch topology version.
        Returns:
        Latch instance.
      • dropClientLatches

        public void dropClientLatches​(AffinityTopologyVersion topVer)
        Drops client latches created by getOrCreate(String, AffinityTopologyVersion). The corresponding latches should be created before this method is invoked.

        This method must be called when it is guaranteed that all nodes have processed the latches messages. In the context of partitions map exchange this can be done when exchange future is completed.

        Parameters:
        topVer - Latch topology version.
      • canSkipJoiningNodes

        public boolean canSkipJoiningNodes​(AffinityTopologyVersion topVer)
        Checks that latch manager can use V2 protocol and skip joining nodes from latch participants.
        Parameters:
        topVer - Topology version.
        Throws:
        IgniteException - If nodes for the given topVer cannot be found in the discovery history.