public class GridCachePreloaderAdapter extends Object implements GridCachePreloader
| Modifier and Type | Field and Description |
|---|---|
protected GridCacheSharedContext |
ctx |
protected CacheGroupContext |
grp |
protected IgniteLogger |
log
Logger.
|
| Constructor and Description |
|---|
GridCachePreloaderAdapter(CacheGroupContext grp) |
| Modifier and Type | Method and Description |
|---|---|
GridDhtPartitionDemander.RebalanceFuture |
addAssignments(GridDhtPreloaderAssignments assignments,
boolean forcePreload,
long rebalanceId,
GridDhtPartitionDemander.RebalanceFuture next,
@Nullable GridCompoundFuture<Boolean,Boolean> forcedRebFut,
GridCompoundFuture<Boolean,Boolean> compatibleRebFut)
Adds assignments to preloader.
|
long |
batchesPrefetchCount()
The number of batches generated by supply node at rebalancing procedure start.
|
int |
batchSize()
The supply message size in bytes to be loaded within a single rebalance batch.
|
void |
dumpDebugInfo()
Dumps debug information.
|
void |
finishPreloading(AffinityTopologyVersion topVer,
long rebalanceId)
Finish preloading for given topology version.
|
IgniteInternalFuture<Boolean> |
forceRebalance()
Force Rebalance process.
|
GridDhtPreloaderAssignments |
generateAssignments(GridDhtPartitionExchangeId exchId,
GridDhtPartitionsExchangeFuture exchFut) |
void |
handleDemandMessage(int idx,
UUID id,
GridDhtPartitionDemandMessage d)
Handles Demand message.
|
void |
handleSupplyMessage(UUID id,
GridDhtPartitionSupplyMessage s)
Handles Supply message.
|
boolean |
needForceKeys() |
void |
onInitialExchangeComplete(@Nullable Throwable err)
Callback by exchange manager when initial partition exchange is complete.
|
void |
onKernalStop()
Kernal stop callback.
|
void |
onReconnected()
Client reconnected callback.
|
void |
onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut) |
void |
pause()
Pause preloader.
|
IgniteInternalFuture<Boolean> |
rebalanceFuture() |
boolean |
rebalanceRequired(GridDhtPartitionsExchangeFuture exchFut) |
GridDhtFuture<Object> |
request(GridCacheContext ctx,
Collection<KeyCacheObject> keys,
AffinityTopologyVersion topVer)
Requests that preloader sends the request for the key.
|
GridDhtFuture<Object> |
request(GridCacheContext ctx,
GridNearAtomicAbstractUpdateRequest req,
AffinityTopologyVersion topVer)
Requests that preloader sends the request for the key.
|
void |
resume()
Resume preloader.
|
void |
start()
Starts preloading.
|
IgniteInternalFuture<Object> |
startFuture() |
IgniteInternalFuture<?> |
syncFuture() |
long |
throttle()
Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
|
long |
timeout()
Rebalance timeout for supply and demand messages in milliseconds.
|
protected final CacheGroupContext grp
protected final GridCacheSharedContext ctx
protected final IgniteLogger log
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 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 handleSupplyMessage(UUID id, GridDhtPartitionSupplyMessage s)
handleSupplyMessage in interface GridCachePreloaderid - 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
@Nullable Throwable err)
onInitialExchangeComplete in interface GridCachePreloadererr - Error, if any happened on initial exchange.public boolean rebalanceRequired(GridDhtPartitionsExchangeFuture exchFut)
rebalanceRequired in interface GridCachePreloaderexchFut - 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 GridDhtPartitionDemander.RebalanceFuture addAssignments(GridDhtPreloaderAssignments assignments, boolean forcePreload, long rebalanceId, GridDhtPartitionDemander.RebalanceFuture next, @Nullable @Nullable GridCompoundFuture<Boolean,Boolean> forcedRebFut, GridCompoundFuture<Boolean,Boolean> compatibleRebFut)
addAssignments in interface GridCachePreloaderassignments - Assignments to add.forcePreload - True if preload requested by ForceRebalanceExchangeTask.rebalanceId - Rebalance id created by exchange thread.next - Rebalance's future follows after the current one.forcedRebFut - External future for forced rebalance.compatibleRebFut - Future for waiting for compatible rebalances.public void onTopologyChanged(GridDhtPartitionsExchangeFuture lastFut)
onTopologyChanged in interface GridCachePreloaderlastFut - Last future.public void dumpDebugInfo()
dumpDebugInfo in interface GridCachePreloaderpublic void pause()
pause in interface GridCachePreloaderpublic void resume()
resume in interface GridCachePreloaderpublic long timeout()
The IgniteConfiguration.getRebalanceTimeout() will be used by default. If an Ignite's configuration value
is not provided than the CacheConfiguration.getRebalanceTimeout() will be used instead.
timeout in interface GridCachePreloaderpublic long batchesPrefetchCount()
The IgniteConfiguration.getRebalanceBatchesPrefetchCount() will be used by default. If an Ignite's
configuration value is not provided than the CacheConfiguration.getRebalanceBatchesPrefetchCount()
will be used instead.
batchesPrefetchCount in interface GridCachePreloaderpublic long throttle()
The IgniteConfiguration.getRebalanceThrottle() will be used by default. If an Ignite's
configuration value is not provided than the CacheConfiguration.getRebalanceThrottle()
will be used instead.
throttle in interface GridCachePreloader0 to disable throttling.public int batchSize()
The IgniteConfiguration.getRebalanceBatchSize() will be used by default. If an Ignite's
configuration value is not provided than the CacheConfiguration.getRebalanceBatchSize()
will be used instead.
batchSize in interface GridCachePreloaderpublic void finishPreloading(AffinityTopologyVersion topVer, long rebalanceId)
finishPreloading in interface GridCachePreloadertopVer - Topology version.rebalanceId - Rebalance id.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021