Class WalStateManager

    • Constructor Detail

      • WalStateManager

        public WalStateManager​(GridKernalContext kernalCtx)
        Constructor.
        Parameters:
        kernalCtx - Kernal context.
    • Method Detail

      • 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.
      • prohibitWALDisabling

        public void prohibitWALDisabling​(boolean val)
        Denies or allows WAL disabling with subsequent init(Collection, boolean) call.
        Parameters:
        val - denial status.
      • prohibitWALDisabling

        public boolean prohibitWALDisabling()
        Reports whether WAL disabling with subsequent init(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:
        True if WAL disable for group. False If not.
      • reason

        public static String reason​(long grpId,
                                    AffinityTopologyVersion topVer)
        Checkpoint reason for enabling group durability.
        Parameters:
        grpId - Group id.
        topVer - Topology version.