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.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 boolean rebalanceRequired(AffinityTopologyVersion rebTopVer, GridDhtPartitionsExchangeFuture exchFut)
rebalanceRequired in interface GridCachePreloaderrebTopVer - Previous rebalance topology version or NONE if there is no info.exchFut - Completed exchange future.True if rebalance should be started (previous will be interrupted).public GridDhtPreloaderAssignments generateAssignments(GridDhtPartitionExchangeId exchId, GridDhtPartitionsExchangeFuture exchFut)
generateAssignments in interface GridCachePreloaderexchId - Exchange ID.exchFut - Completed exchange future. Can be null if forced or reassigned generation occurs.public Runnable addAssignments(GridDhtPreloaderAssignments assignments, boolean forcePreload, long rebalanceId, Runnable next, @Nullable GridCompoundFuture<Boolean,Boolean> forcedRebFut)
addAssignments in interface GridCachePreloaderassignments - Assignments to add.forcePreload - True if preload requested by ForceRebalanceExchangeTask.rebalanceId - Rebalance id created by exchange thread.next - Runnable responsible for cache rebalancing chain.forcedRebFut - External future for forced rebalance.public void onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut)
onTopologyChanged in interface GridCachePreloaderlastFut - Last future.public void dumpDebugInfo()
dumpDebugInfo in interface GridCachePreloader
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019