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

## Class GridDhtPreloader<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCachePreloaderAdapter<K,V>
  - - org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader<K,V>

All Implemented Interfaces:
  GridCachePreloader<K,V>

    public class GridDhtPreloader<K,V>
    extends GridCachePreloaderAdapter<K,V>

DHT cache preloader.

### Field Summary

Fields
`static long` `DFLT_PRELOAD_RESEND_TIMEOUT` Default preload resend timeout.

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCachePreloaderAdapter

`aff, cctx, log, preloadPred`

### Constructor Summary

Constructors
Constructor and Description
`GridDhtPreloader(GridCacheContext<K,V> cctx)`

### Method Summary

Methods
`void` `addAssignments(GridDhtPreloaderAssignments<K,V> assignments, boolean forcePreload)` Adds assignments to preloader.
`void` `addDhtAssignmentFetchFuture(long topVer, GridDhtAssignmentFetchFuture<K,V> fut)`
`GridDhtPreloaderAssignments<K,V>` `assign(GridDhtPartitionsExchangeFuture<K,V> exchFut)`
`void` `forcePreload()` Force preload process.
`void` `onExchangeFutureAdded()` Callback by exchange manager when new exchange future is added to worker.
`void` `onInitialExchangeComplete(Throwable err)` Callback by exchange manager when initial partition exchange is complete.
`void` `onKernalStart()` Kernal start callback.
`void` `onKernalStop()` Kernal stop callback.
`void` `onPartitionEvicted(GridDhtLocalPartition<K,V> part, boolean updateSeq)` Resends partitions on partition evict within configured timeout.
`void` `preloadPredicate(IgnitePredicate<GridCacheEntryInfo<K,V>> preloadPred)`
`void` `removeDhtAssignmentFetchFuture(long topVer, GridDhtAssignmentFetchFuture<K,V> fut)`
`GridDhtFuture<Object>` `request(Collection<? extends K> keys, long topVer)` Requests that preloader sends the request for the key.
`void` `start()` Starts preloading.
`IgniteInternalFuture<Object>` `startFuture()`
`IgniteInternalFuture<?>` `syncFuture()`
`void` `unwindUndeploys()` Unwinds undeploys.
`void` `updateLastExchangeFuture(GridDhtPartitionsExchangeFuture<K,V> lastFut)` Updates last exchange future.

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCachePreloaderAdapter

`preloadPredicate, stop`

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

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

### Field Detail

#### DFLT_PRELOAD_RESEND_TIMEOUT

    public static final long DFLT_PRELOAD_RESEND_TIMEOUT

Default preload resend timeout.

See Also:
  Constant Field Values

### Constructor Detail

#### GridDhtPreloader

    public GridDhtPreloader(GridCacheContext<K,V> cctx)

Parameters:
  `cctx` - Cache context.

### Method Detail

#### start

    public void start()

Starts preloading.

Specified by:
  `start` in interface `GridCachePreloader<K,V>`
Overrides:
  `start` in class `GridCachePreloaderAdapter<K,V>`

#### onKernalStart

    public void onKernalStart()
                       throws IgniteCheckedException

Kernal start callback.

Specified by:
  `onKernalStart` in interface `GridCachePreloader<K,V>`
Overrides:
  `onKernalStart` in class `GridCachePreloaderAdapter<K,V>`
Throws:
  `IgniteCheckedException` - If failed.

#### preloadPredicate

    public void preloadPredicate(IgnitePredicate<GridCacheEntryInfo<K,V>> preloadPred)

Specified by:
  `preloadPredicate` in interface `GridCachePreloader<K,V>`
Overrides:
  `preloadPredicate` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `preloadPred` - Preload predicate.

#### onKernalStop

    public void onKernalStop()

Kernal stop callback.

Specified by:
  `onKernalStop` in interface `GridCachePreloader<K,V>`
Overrides:
  `onKernalStop` in class `GridCachePreloaderAdapter<K,V>`

#### onInitialExchangeComplete

    public void onInitialExchangeComplete(@Nullable
                                 Throwable err)

Callback by exchange manager when initial partition exchange is complete.

Specified by:
  `onInitialExchangeComplete` in interface `GridCachePreloader<K,V>`
Overrides:
  `onInitialExchangeComplete` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `err` - Error, if any happened on initial exchange.

#### onExchangeFutureAdded

    public void onExchangeFutureAdded()

Callback by exchange manager when new exchange future is added to worker.

Specified by:
  `onExchangeFutureAdded` in interface `GridCachePreloader<K,V>`
Overrides:
  `onExchangeFutureAdded` in class `GridCachePreloaderAdapter<K,V>`

#### updateLastExchangeFuture

    public void updateLastExchangeFuture(GridDhtPartitionsExchangeFuture<K,V> lastFut)

Updates last exchange future.

Specified by:
  `updateLastExchangeFuture` in interface `GridCachePreloader<K,V>`
Overrides:
  `updateLastExchangeFuture` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `lastFut` - Last future.

#### assign

    public GridDhtPreloaderAssignments<K,V> assign(GridDhtPartitionsExchangeFuture<K,V> exchFut)

Specified by:
  `assign` in interface `GridCachePreloader<K,V>`
Overrides:
  `assign` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `exchFut` - Exchange future to assign.
Returns:
  Assignments.

#### addAssignments

    public void addAssignments(GridDhtPreloaderAssignments<K,V> assignments,
                      boolean forcePreload)

Adds assignments to preloader.

Specified by:
  `addAssignments` in interface `GridCachePreloader<K,V>`
Overrides:
  `addAssignments` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `assignments` - Assignments to add.
  `forcePreload` - Force preload flag.

#### startFuture

    public IgniteInternalFuture<Object> startFuture()

Description copied from class: `GridCachePreloaderAdapter`

Specified by:
  `startFuture` in interface `GridCachePreloader<K,V>`
Overrides:
  `startFuture` in class `GridCachePreloaderAdapter<K,V>`
Returns:
  Start future.

#### syncFuture

    public IgniteInternalFuture<?> syncFuture()

Specified by:
  `syncFuture` in interface `GridCachePreloader<K,V>`
Overrides:
  `syncFuture` in class `GridCachePreloaderAdapter<K,V>`
Returns:
  Future which will complete when preloading is finished.

#### addDhtAssignmentFetchFuture

    public void addDhtAssignmentFetchFuture(long topVer,
                                   GridDhtAssignmentFetchFuture<K,V> fut)

Parameters:
  `topVer` - Requested topology version.
  `fut` - Future to add.

#### removeDhtAssignmentFetchFuture

    public void removeDhtAssignmentFetchFuture(long topVer,
                                      GridDhtAssignmentFetchFuture<K,V> fut)

Parameters:
  `topVer` - Requested topology version.
  `fut` - Future to remove.

#### onPartitionEvicted

    public void onPartitionEvicted(GridDhtLocalPartition<K,V> part,
                          boolean updateSeq)

Resends partitions on partition evict within configured timeout.

Parameters:
  `part` - Evicted partition.
  `updateSeq` - Update sequence.

#### request

    public GridDhtFuture<Object> request(Collection<? extends K> keys,
                                long topVer)

Description copied from class: `GridCachePreloaderAdapter`
Requests that preloader sends the request for the key.

Specified by:
  `request` in interface `GridCachePreloader<K,V>`
Overrides:
  `request` in class `GridCachePreloaderAdapter<K,V>`
Parameters:
  `keys` - Keys to request.
  `topVer` - Topology version, `-1` if not required.
Returns:
  Future for request.

#### forcePreload

    public void forcePreload()

Force preload process.

Specified by:
  `forcePreload` in interface `GridCachePreloader<K,V>`
Overrides:
  `forcePreload` in class `GridCachePreloaderAdapter<K,V>`

#### unwindUndeploys

    public void unwindUndeploys()

Unwinds undeploys.

Specified by:
  `unwindUndeploys` in interface `GridCachePreloader<K,V>`
Overrides:
  `unwindUndeploys` in class `GridCachePreloaderAdapter<K,V>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015