Class ExchangeLatchManager
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.latch.ExchangeLatchManager
-
-
Field Summary
Fields Modifier and Type Field Description static IgniteProductVersionPROTOCOL_V2_VERSION_SINCEExchange latch V2 protocol introduces following optimization: Joining nodes are explicitly excluded from possible latch participants.
-
Constructor Summary
Constructors Constructor Description ExchangeLatchManager(GridKernalContext ctx)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanSkipJoiningNodes(AffinityTopologyVersion topVer)Checks that latch manager can use V2 protocol and skip joining nodes from latch participants.voiddropClientLatches(AffinityTopologyVersion topVer)Drops client latches created bygetOrCreate(String, AffinityTopologyVersion).LatchgetOrCreate(String id, AffinityTopologyVersion topVer)Creates new latch with specifiedidandtopVeror returns existing latch.StringtoString()
-
-
-
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 specifiedidandtopVeror returns existing latch. Participants of latch are calculated from giventopVeras alive server nodes. If local node is coordinatorServerLatchinstance will be created, otherwiseClientLatchinstance.- Parameters:
id- Latch id.topVer- Latch topology version.- Returns:
- Latch instance.
-
dropClientLatches
public void dropClientLatches(AffinityTopologyVersion topVer)
Drops client latches created bygetOrCreate(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 giventopVercannot be found in the discovery history.
-
-