public class GridCachePreloaderAdapter extends Object implements GridCachePreloader
| Modifier and Type | Field and Description |
|---|---|
protected GridCacheSharedContext |
ctx |
protected CacheGroupContext |
grp |
protected IgniteLogger |
log
Logger.
|
protected IgnitePredicate<GridCacheEntryInfo> |
preloadPred
Preload predicate.
|
| Constructor and Description |
|---|
GridCachePreloaderAdapter(CacheGroupContext grp) |
protected final CacheGroupContext grp
protected final GridCacheSharedContext ctx
protected final IgniteLogger log
protected IgnitePredicate<GridCacheEntryInfo> preloadPred
public GridCachePreloaderAdapter(CacheGroupContext grp)
grp - Cache group.public void start()
throws IgniteCheckedException
start in interface GridCachePreloaderIgniteCheckedException - If start failed.public void onKernalStop()
onKernalStop in interface GridCachePreloaderpublic IgniteInternalFuture<Boolean> forceRebalance()
forceRebalance in interface GridCachePreloaderpublic boolean needForceKeys()
needForceKeys in interface GridCachePreloadertrue if there is no need to force keys preloading
(e.g. rebalancing has been completed).public void onReconnected()
onReconnected in interface GridCachePreloaderpublic void preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred)
preloadPredicate in interface GridCachePreloaderpreloadPred - Preload predicate.public IgnitePredicate<GridCacheEntryInfo> preloadPredicate()
preloadPredicate in interface GridCachePreloadernull, will evaluate each preloaded entry during
send and receive, and if predicate evaluates to false, entry will be skipped.public IgniteInternalFuture<Object> startFuture()
startFuture in interface GridCachePreloaderpublic IgniteInternalFuture<?> syncFuture()
syncFuture in interface GridCachePreloaderpublic IgniteInternalFuture<Boolean> rebalanceFuture()
rebalanceFuture in interface GridCachePreloadertrue 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 unwindUndeploys()
unwindUndeploys in interface GridCachePreloaderpublic void handleSupplyMessage(int idx,
UUID id,
GridDhtPartitionSupplyMessage s)
handleSupplyMessage in interface GridCachePreloaderidx - Index.id - Node Id.s - Supply message.public void handleDemandMessage(int idx,
UUID id,
GridDhtPartitionDemandMessage d)
handleDemandMessage in interface GridCachePreloaderidx - Index.id - Node Id.d - Demand message.public GridDhtFuture<Object> request(GridCacheContext ctx, Collection<KeyCacheObject> keys, AffinityTopologyVersion topVer)
request in interface GridCachePreloaderctx - Cache context.keys - Keys to request.topVer - Topology version, -1 if not required.public GridDhtFuture<Object> request(GridCacheContext ctx, GridNearAtomicAbstractUpdateRequest req, AffinityTopologyVersion topVer)
request in interface GridCachePreloaderctx - Cache context.req - Message with keys to request.topVer - Topology version, -1 if not required.public void onInitialExchangeComplete(@Nullable
Throwable err)
onInitialExchangeComplete in interface GridCachePreloadererr - Error, if any happened on initial exchange.public GridDhtPreloaderAssignments generateAssignments(GridDhtPartitionExchangeId exchId, GridDhtPartitionsExchangeFuture exchFut)
generateAssignments in interface GridCachePreloaderexchId - Exchange ID.exchFut - Exchange future.null if detected that there are pending exchanges.public Runnable addAssignments(GridDhtPreloaderAssignments assignments, boolean forcePreload, long rebalanceId, Runnable next, @Nullable GridCompoundFuture<Boolean,Boolean> forcedRebFut)
addAssignments in interface GridCachePreloaderassignments - Assignments to add.forcePreload - Force preload flag.rebalanceId - Rebalance id.next - Runnable responsible for cache rebalancing start.forcedRebFut - Rebalance future.public void onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut)
onTopologyChanged in interface GridCachePreloaderlastFut - Last future.public void dumpDebugInfo()
dumpDebugInfo in interface GridCachePreloader
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018