Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13345

Warming up strategy

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.10
    • None
    • Implementation of cache warm-up strategies 2-part of IEP-40.
    • Docs Required

    Description

      Summary of Dev-list

      1. Adding a marker interface org.apache.ignite.configuration.WarmUpConfiguration;
      2. Adding a configuration to
        1. org.apache.ignite.configuration.DataRegionConfiguration#setWarmUpConfiguration
        2. org.apache.ignite.configuration.DataStorageConfiguration#setDefaultWarmUpConfiguration
      3. Add an internal warm-up interface that will start in [1] after [2] (after recovery);
        package org.apache.ignite.internal.processors.cache.warmup;
        
        import org.apache.ignite.IgniteCheckedException;
        import org.apache.ignite.configuration.WarmUpConfiguration;
        import org.apache.ignite.internal.GridKernalContext;
        import org.apache.ignite.internal.processors.cache.persistence.DataRegion;
        
        /**
         * Interface for warming up.
         */
        public interface WarmUpStrategy<T extends WarmUpConfiguration> {
            /**
             * Returns configuration class for mapping to strategy.
             *
             * @return Configuration class.
             */
            Class<T> configClass();
        
            /**
             * Warm up.
             *
             * @param kernalCtx Kernal context.
             * @param cfg       Warm-up configuration.
             * @param region    Data region.
             * @throws IgniteCheckedException if faild.
             */
            void warmUp(GridKernalContext kernalCtx, T cfg, DataRegion region) throws IgniteCheckedException;
        
            /**
             * Closing warm up.
             *
             * @throws IgniteCheckedException if faild.
             */
            void close() throws IgniteCheckedException;
        }
        
      4. Adding an internal plugin extension for add own strategies;
        package org.apache.ignite.internal.processors.cache.warmup;
         
        import java.util.Collection;
        import org.apache.ignite.plugin.Extension;
         
        /**
         * Interface for getting warm-up strategies from plugins.
         */
        public interface WarmUpStrategySupplier extends Extension {
            /**
             * Getting warm-up strategies.
             *
             * @return Warm-up strategies.
             */
            Collection<WarmUpStrategy> strategies();
        }
        
      5. Adding strategies:
        1. Without implementation, for the possibility of disabling the warm-up: NoOP
        2. Loading everything while there is RAM with priority to indexes: LoadAll
      6. Add a command to "control.sh", to stop current warm-up and cancel all others: --warm-up stop in IGNITE-13362

      [1] - org.apache.ignite.internal.processors.cache.GridCacheProcessor.CacheRecoveryLifecycle#afterLogicalUpdatesApplied
      [2] - org.apache.ignite.internal.processors.cache.GridCacheProcessor.CacheRecoveryLifecycle#restorePartitionStates

      Attachments

        Issue Links

          Activity

            People

              ktkalenko@gridgain.com Kirill Tkalenko
              ktkalenko@gridgain.com Kirill Tkalenko
              Anton Kalashnikov Anton Kalashnikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h