public class GridCachePreloaderAdapter extends Object implements GridCachePreloader
| Modifier and Type | Field and Description |
|---|---|
protected AffinityFunction |
aff
Affinity.
|
protected GridCacheContext<?,?> |
cctx
Cache context.
|
protected IgniteLogger |
log
Logger.
|
protected IgnitePredicate<GridCacheEntryInfo> |
preloadPred
Preload predicate.
|
| Constructor and Description |
|---|
GridCachePreloaderAdapter(GridCacheContext<?,?> cctx) |
| Modifier and Type | Method and Description |
|---|---|
Callable<Boolean> |
addAssignments(GridDhtPreloaderAssignments assignments,
boolean forcePreload,
Collection<String> caches,
int cnt)
Adds assignments to preloader.
|
GridDhtPreloaderAssignments |
assign(GridDhtPartitionsExchangeFuture exchFut) |
void |
dumpDebugInfo()
Dumps debug information.
|
void |
evictPartitionAsync(GridDhtLocalPartition part)
Evicts partition asynchronously.
|
void |
forcePreload()
Force preload 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 |
onKernalStart()
Kernal start callback.
|
void |
onKernalStop()
Kernal stop callback.
|
void |
onReconnected()
Client reconnected callback.
|
void |
onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut) |
IgnitePredicate<GridCacheEntryInfo> |
preloadPredicate() |
void |
preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred) |
IgniteInternalFuture<Boolean> |
rebalanceFuture() |
IgniteInternalFuture<Object> |
request(Collection<KeyCacheObject> keys,
AffinityTopologyVersion topVer)
Requests that preloader sends the request for the key.
|
void |
start()
Starts preloading.
|
IgniteInternalFuture<Object> |
startFuture() |
void |
stop()
Stops preloading.
|
IgniteInternalFuture<?> |
syncFuture() |
void |
unwindUndeploys()
Unwinds undeploys.
|
protected final GridCacheContext<?,?> cctx
protected final IgniteLogger log
protected final AffinityFunction aff
protected IgnitePredicate<GridCacheEntryInfo> preloadPred
public GridCachePreloaderAdapter(GridCacheContext<?,?> cctx)
cctx - Cache context.public void start()
throws IgniteCheckedException
start in interface GridCachePreloaderIgniteCheckedException - If start failed.public void stop()
stop in interface GridCachePreloaderpublic void onKernalStart()
throws IgniteCheckedException
onKernalStart in interface GridCachePreloaderIgniteCheckedException - If failed.public void onKernalStop()
onKernalStop in interface GridCachePreloaderpublic void forcePreload()
forcePreload 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,
GridDhtPartitionSupplyMessageV2 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 IgniteInternalFuture<Object> request(Collection<KeyCacheObject> keys, AffinityTopologyVersion topVer)
request in interface GridCachePreloaderkeys - 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 assign(GridDhtPartitionsExchangeFuture exchFut)
assign in interface GridCachePreloaderexchFut - Exchange future to assign.null if detected that there are pending exchanges.public Callable<Boolean> addAssignments(GridDhtPreloaderAssignments assignments, boolean forcePreload, Collection<String> caches, int cnt)
addAssignments in interface GridCachePreloaderassignments - Assignments to add.forcePreload - Force preload flag.caches - Rebalancing of these caches will be finished before this started.cnt - Counter.public void evictPartitionAsync(GridDhtLocalPartition part)
evictPartitionAsync in interface GridCachePreloaderpart - Partition.public void onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut)
onTopologyChanged in interface GridCachePreloaderlastFut - Last future.public void dumpDebugInfo()
dumpDebugInfo in interface GridCachePreloader
Follow @ApacheIgnite
Ignite Fabric : ver. 1.6.0 Release Date : May 18 2016