Class WalStateManager
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
-
- org.apache.ignite.internal.processors.cache.WalStateManager
-
- All Implemented Interfaces:
GridCacheSharedManager
public class WalStateManager extends GridCacheSharedManagerAdapter
Write-ahead log state manager. Manages WAL enable and disable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWalStateManager.WALDisableContextTemporary storage for disabled WALs of group.
-
Field Summary
Fields Modifier and Type Field Description static booleanDFLT_DISABLE_WAL_DURING_REBALANCINGstatic StringENABLE_DURABILITY_AFTER_REBALANCING-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
cctx, diagnosticLog
-
-
Constructor Summary
Constructors Constructor Description WalStateManager(GridKernalContext kernalCtx)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IgniteInternalFuture<Boolean>changeWalMode(Collection<String> cacheNames, boolean enabled)Change WAL mode.voiddisableGroupDurabilityForPreloading(GridDhtPartitionsExchangeFuture fut)Change local WAL state before exchange is done.booleanisDisabled(int grpId, long pageId)Checks WAL disabled for cache group.voidonAck(WalStateAckMessage msg)Handle ack message.voidonCachesInfoCollected()Callback invoked when caches info is collected inside cache processor start routine.voidonDisconnected(IgniteFuture reconnectFut)voidonFinishDiscovery(WalStateFinishMessage msg)Handle finish message in discovery thread.voidonKernalStart()Handle cache processor kernal start.voidonNodeLeft(UUID nodeId)Handle node leave event.voidonProposeDiscovery(WalStateProposeMessage msg)Handle propose message in discovery thread.voidonProposeExchange(WalStateProposeMessage msg)Handle propose message which is synchronized with other cache state actions through exchange thread.voidonReconnected(boolean active)booleanprohibitWALDisabling()Reports whether WAL disabling with subsequentinit(Collection, boolean)is denied.voidprohibitWALDisabling(boolean val)Denies or allows WAL disabling with subsequentinit(Collection, boolean)call.static Stringreason(long grpId, AffinityTopologyVersion topVer)Checkpoint reason for enabling group durability.voidrunWithOutWAL(IgniteRunnable cls)None record will be logged in closure call.protected voidstart0()protected voidstop0(boolean cancel)WalStateManager.WALDisableContextwalDisableContext()-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
context, isStopping, kernalStartInfo, kernalStopInfo, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, printMemoryStats, start, startInfo, stop, stopInfo, toString
-
-
-
-
Field Detail
-
ENABLE_DURABILITY_AFTER_REBALANCING
public static final String ENABLE_DURABILITY_AFTER_REBALANCING
- See Also:
- Constant Field Values
-
DFLT_DISABLE_WAL_DURING_REBALANCING
public static final boolean DFLT_DISABLE_WAL_DURING_REBALANCING
-
-
Constructor Detail
-
WalStateManager
public WalStateManager(GridKernalContext kernalCtx)
Constructor.- Parameters:
kernalCtx- Kernal context.
-
-
Method Detail
-
start0
protected void start0() throws IgniteCheckedException- Overrides:
start0in classGridCacheSharedManagerAdapter- Throws:
IgniteCheckedException- If failed.
-
stop0
protected void stop0(boolean cancel)
- Overrides:
stop0in classGridCacheSharedManagerAdapter- Parameters:
cancel- Cancel flag.
-
onCachesInfoCollected
public void onCachesInfoCollected()
Callback invoked when caches info is collected inside cache processor start routine. Discovery is not active at this point.
-
onKernalStart
public void onKernalStart()
Handle cache processor kernal start. At this point we already collected discovery data from other nodes (discovery already active), but exchange worker is not active yet. We need to iterate over available group descriptors and perform top operations, taking in count that no cache operations are possible at this point, so checkpoint is not needed.
-
onDisconnected
public void onDisconnected(IgniteFuture reconnectFut)
- Specified by:
onDisconnectedin interfaceGridCacheSharedManager- Overrides:
onDisconnectedin classGridCacheSharedManagerAdapter- Parameters:
reconnectFut- Reconnect future.
-
onReconnected
public void onReconnected(boolean active)
- Specified by:
onReconnectedin interfaceGridCacheSharedManager- Overrides:
onReconnectedin classGridCacheSharedManagerAdapter- Parameters:
active- Active flag.
-
prohibitWALDisabling
public void prohibitWALDisabling(boolean val)
Denies or allows WAL disabling with subsequentinit(Collection, boolean)call.- Parameters:
val- denial status.
-
prohibitWALDisabling
public boolean prohibitWALDisabling()
Reports whether WAL disabling with subsequentinit(Collection, boolean)is denied.- Returns:
- denial status.
-
changeWalMode
public IgniteInternalFuture<Boolean> changeWalMode(Collection<String> cacheNames, boolean enabled)
Change WAL mode.- Parameters:
cacheNames- Cache names.enabled- Enabled flag.- Returns:
- Future completed when operation finished.
-
disableGroupDurabilityForPreloading
public void disableGroupDurabilityForPreloading(GridDhtPartitionsExchangeFuture fut)
Change local WAL state before exchange is done. This method will disable WAL for groups without partitions in OWNING state if such feature is enabled.- Parameters:
fut- Exchange future.
-
onProposeDiscovery
public void onProposeDiscovery(WalStateProposeMessage msg)
Handle propose message in discovery thread.- Parameters:
msg- Message.
-
onProposeExchange
public void onProposeExchange(WalStateProposeMessage msg)
Handle propose message which is synchronized with other cache state actions through exchange thread. If operation is no-op (i.e. state is not changed), then no additional processing is needed, and coordinator will trigger finish request right away. Otherwise all nodes start asynchronous checkpoint flush, and send responses to coordinator. Once all responses are received, coordinator node will trigger finish message.- Parameters:
msg- Message.
-
onAck
public void onAck(WalStateAckMessage msg)
Handle ack message.- Parameters:
msg- Ack message.
-
onFinishDiscovery
public void onFinishDiscovery(WalStateFinishMessage msg)
Handle finish message in discovery thread.- Parameters:
msg- Message.
-
onNodeLeft
public void onNodeLeft(UUID nodeId)
Handle node leave event.- Parameters:
nodeId- Node ID.
-
isDisabled
public boolean isDisabled(int grpId, long pageId)Checks WAL disabled for cache group.- Parameters:
grpId- Group id.pageId- Page id.- Returns:
Trueif WAL disable for group.FalseIf not.
-
walDisableContext
public WalStateManager.WALDisableContext walDisableContext()
- Returns:
- WAL disable context.
-
runWithOutWAL
public void runWithOutWAL(IgniteRunnable cls) throws IgniteCheckedException
None record will be logged in closure call.- Parameters:
cls- Closure to execute out of WAL scope.- Throws:
IgniteCheckedException- If operation failed.
-
reason
public static String reason(long grpId, AffinityTopologyVersion topVer)
Checkpoint reason for enabling group durability.- Parameters:
grpId- Group id.topVer- Topology version.
-
-