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

## Class GridDhtPartitionDemander

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

    public class GridDhtPartitionDemander
    extends Object

Thread pool for requesting partitions from other nodes and populating local cache.

### Nested Class Summary

Nested Classes
`static class` `GridDhtPartitionDemander.RebalanceFuture` The future is created for each topology version if some partitions should present by affinity and completed when all partitions are transferred.

### Constructor Summary

Constructors
Constructor and Description
`GridDhtPartitionDemander(CacheGroupContext grp)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `handleSupplyMessage(UUID nodeId, GridDhtPartitionSupplyMessage supplyMsg)` Handles supply message from `nodeId` with specified `topicId`.
`protected void` `ownPartition(GridDhtPartitionDemander.RebalanceFuture fut, int p, UUID nodeId, GridDhtPartitionSupplyMessage supplyMsg)` Owns the partition recursively.
`void` `registerSupplyMessage(UUID nodeId, GridDhtPartitionSupplyMessage supplyMsg, Runnable r)` Enqueues supply message.
`String` `toString()`

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

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

### Constructor Detail

#### GridDhtPartitionDemander

    public GridDhtPartitionDemander(CacheGroupContext grp)

Parameters:
  `grp` - Ccahe group.

### Method Detail

#### registerSupplyMessage

    public void registerSupplyMessage(UUID nodeId,
                                      GridDhtPartitionSupplyMessage supplyMsg,
                                      Runnable r)

Enqueues supply message.

#### handleSupplyMessage

    public void handleSupplyMessage(UUID nodeId,
                                    GridDhtPartitionSupplyMessage supplyMsg)

Handles supply message from `nodeId` with specified `topicId`. Supply message contains entries to populate rebalancing partitions. There is a cyclic process: Populate rebalancing partitions with entries from Supply message. If not all partitions specified in `rebalanceFut` were rebalanced or marked as missed send new Demand message to request next batch of entries.

Parameters:
  `nodeId` - Node id.
  `supplyMsg` - Supply message.

#### ownPartition

    protected void ownPartition(GridDhtPartitionDemander.RebalanceFuture fut,
                                int p,
                                UUID nodeId,
                                GridDhtPartitionSupplyMessage supplyMsg)

Owns the partition recursively.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021