public class GridDhtPreloader extends GridCachePreloaderAdapter
| Modifier and Type | Field and Description |
|---|---|
static long |
DFLT_PRELOAD_RESEND_TIMEOUT
Default preload resend timeout.
|
static IgniteProductVersion |
REBALANCING_VER_2_SINCE
Rebalancing was refactored at version 1.5.0, but backward compatibility to previous implementation was saved.
|
aff, cctx, log, preloadPred| Constructor and Description |
|---|
GridDhtPreloader(GridCacheContext<?,?> cctx) |
| Modifier and Type | Method and Description |
|---|---|
Runnable |
addAssignments(GridDhtPreloaderAssignments assignments,
boolean forceRebalance,
int cnt,
Runnable next,
GridFutureAdapter<Boolean> forcedRebFut)
Adds assignments to preloader.
|
GridDhtPreloaderAssignments |
assign(GridDhtPartitionsExchangeFuture exchFut) |
void |
dumpDebugInfo()
Dumps debug information.
|
void |
evictPartitionAsync(GridDhtLocalPartition part)
Evicts partition asynchronously.
|
IgniteInternalFuture<Boolean> |
forceRebalance()
Force Rebalance process.
|
void |
handleDemandMessage(int idx,
UUID id,
GridDhtPartitionDemandMessage d)
Handles Demand message.
|
void |
handleSupplyMessage(int idx,
UUID id,
GridDhtPartitionSupplyMessageV2 s)
Handles Supply message.
|
boolean |
needForceKeys() |
void |
onInitialExchangeComplete(Throwable err)
Callback by exchange manager when initial partition exchange is complete.
|
void |
onKernalStop()
Kernal stop callback.
|
void |
onPartitionEvicted(GridDhtLocalPartition part,
boolean updateSeq)
Resends partitions on partition evict within configured timeout.
|
void |
onReconnected()
Client reconnected callback.
|
void |
onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut) |
void |
preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred) |
IgniteInternalFuture<Boolean> |
rebalanceFuture() |
GridDhtFuture<Object> |
request(Collection<KeyCacheObject> keys,
AffinityTopologyVersion topVer)
Requests that preloader sends the request for the key.
|
IgniteInternalFuture<Object> |
request(GridNearAtomicAbstractUpdateRequest req,
AffinityTopologyVersion topVer)
Requests that preloader sends the request for the key.
|
void |
start()
Starts preloading.
|
IgniteInternalFuture<Object> |
startFuture() |
IgniteInternalFuture<?> |
syncFuture() |
void |
unwindUndeploys()
Unwinds undeploys.
|
onKernalStart, preloadPredicate, stoppublic static final IgniteProductVersion REBALANCING_VER_2_SINCE
public static final long DFLT_PRELOAD_RESEND_TIMEOUT
public GridDhtPreloader(GridCacheContext<?,?> cctx)
cctx - Cache context.public void start()
start in interface GridCachePreloaderstart in class GridCachePreloaderAdapterpublic void preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred)
preloadPredicate in interface GridCachePreloaderpreloadPredicate in class GridCachePreloaderAdapterpreloadPred - Preload predicate.public void onKernalStop()
onKernalStop in interface GridCachePreloaderonKernalStop in class GridCachePreloaderAdapterpublic void onInitialExchangeComplete(@Nullable
Throwable err)
onInitialExchangeComplete in interface GridCachePreloaderonInitialExchangeComplete in class GridCachePreloaderAdaptererr - Error, if any happened on initial exchange.public void onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut)
onTopologyChanged in interface GridCachePreloaderonTopologyChanged in class GridCachePreloaderAdapterlastFut - Last future.public GridDhtPreloaderAssignments assign(GridDhtPartitionsExchangeFuture exchFut)
assign in interface GridCachePreloaderassign in class GridCachePreloaderAdapterexchFut - Exchange future to assign.null if detected that there are pending exchanges.public void onReconnected()
onReconnected in interface GridCachePreloaderonReconnected in class GridCachePreloaderAdapterpublic void handleSupplyMessage(int idx,
UUID id,
GridDhtPartitionSupplyMessageV2 s)
handleSupplyMessage in interface GridCachePreloaderhandleSupplyMessage in class GridCachePreloaderAdapteridx - Index.id - Node Id.s - Supply message.public void handleDemandMessage(int idx,
UUID id,
GridDhtPartitionDemandMessage d)
handleDemandMessage in interface GridCachePreloaderhandleDemandMessage in class GridCachePreloaderAdapteridx - Index.id - Node Id.d - Demand message.public Runnable addAssignments(GridDhtPreloaderAssignments assignments, boolean forceRebalance, int cnt, Runnable next, @Nullable GridFutureAdapter<Boolean> forcedRebFut)
addAssignments in interface GridCachePreloaderaddAssignments in class GridCachePreloaderAdapterassignments - Assignments to add.forceRebalance - Force preload flag.cnt - Counter.next - Runnable responsible for cache rebalancing start.public IgniteInternalFuture<Object> startFuture()
GridCachePreloaderAdapterstartFuture in interface GridCachePreloaderstartFuture in class GridCachePreloaderAdapterpublic IgniteInternalFuture<?> syncFuture()
syncFuture in interface GridCachePreloadersyncFuture in class GridCachePreloaderAdapterpublic IgniteInternalFuture<Boolean> rebalanceFuture()
rebalanceFuture in interface GridCachePreloaderrebalanceFuture in class GridCachePreloaderAdaptertrue in case rebalancing successfully finished at current topology.
Future result is false in case rebalancing cancelled or finished with missed partitions and will be
restarted at current or pending topology.
Note that topology change creates new futures and finishes previous.public void onPartitionEvicted(GridDhtLocalPartition part, boolean updateSeq)
part - Evicted partition.updateSeq - Update sequence.public boolean needForceKeys()
needForceKeys in interface GridCachePreloaderneedForceKeys in class GridCachePreloaderAdaptertrue if there is no need to force keys preloading
(e.g. rebalancing has been completed).public IgniteInternalFuture<Object> request(GridNearAtomicAbstractUpdateRequest req, AffinityTopologyVersion topVer)
request in interface GridCachePreloaderrequest in class GridCachePreloaderAdapterreq - Message with keys to request.topVer - Topology version, -1 if not required.public GridDhtFuture<Object> request(Collection<KeyCacheObject> keys, AffinityTopologyVersion topVer)
GridCachePreloaderAdapterrequest in interface GridCachePreloaderrequest in class GridCachePreloaderAdapterkeys - Keys to request.topVer - Topology version, -1 if not required.public IgniteInternalFuture<Boolean> forceRebalance()
forceRebalance in interface GridCachePreloaderforceRebalance in class GridCachePreloaderAdapterpublic void unwindUndeploys()
unwindUndeploys in interface GridCachePreloaderunwindUndeploys in class GridCachePreloaderAdapterpublic void evictPartitionAsync(GridDhtLocalPartition part)
evictPartitionAsync in interface GridCachePreloaderevictPartitionAsync in class GridCachePreloaderAdapterpart - Partition.public void dumpDebugInfo()
dumpDebugInfo in interface GridCachePreloaderdumpDebugInfo in class GridCachePreloaderAdapter
Follow @ApacheIgnite
Ignite Fabric : ver. 1.9.0 Release Date : March 2 2017