org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch

## Class ExchangeLatchManager

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.ExchangeLatchManager

    public class ExchangeLatchManager
    extends Object

Class is responsible to create and manage instances of distributed latches `Latch`.

### Field Summary

Fields
`static IgniteProductVersion` `PROTOCOL_V2_VERSION_SINCE` Exchange latch V2 protocol introduces following optimization: Joining nodes are explicitly excluded from possible latch participants.

### Constructor Summary

Constructors
Constructor and Description
`ExchangeLatchManager(GridKernalContext ctx)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `canSkipJoiningNodes(AffinityTopologyVersion topVer)` Checks that latch manager can use V2 protocol and skip joining nodes from latch participants.
`Latch` `getOrCreate(String id, AffinityTopologyVersion topVer)` Creates new latch with specified `id` and `topVer` or returns existing latch.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### 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.

#### 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.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019