Beispiel #1
0
        public PoolSetConfiguration ConvertElasticPoolSetterOption(ConfigType type, CommandApi command, Options.SetPoolOptions option)
        {
            PoolSetConfiguration config = new PoolSetConfiguration(type, CommandApi.Set);

            SetDefaultRunConfigurationOption(config, type, command, option);

            config.ElasticMinimumTotalNodes  = option.ElasticMinimumTotalNodes;
            config.ElasticMaximumTotalNodes  = option.ElasticMaximumTotalNodes;
            config.ElasticMinimumIdlingNodes = option.ElasticMinimumIdlingNodes;
            config.ElasticResizePeriod       = option.ElasticResizePeriod;
            config.ElasticResizeFactor       = option.ElasticResizeFactor;
            config.ElasticMinimumIdlingTime  = option.ElasticMinimumIdlingTime;
            return(config);
        }
Beispiel #2
0
        public virtual async Task <CommandValues.GenericInfoCommandValue> ExecuteAsync(QPool pool, IConfiguration iconfig, CancellationToken ct = default(CancellationToken))
        {
            CLILogs.Debug("Command pool : Pool name " + pool.Name);
            PoolSetConfiguration config = iconfig as PoolSetConfiguration;

            CLILogs.Debug("Command pool : Set Pool Elastic info");
            pool.ElasticMinimumTotalNodes  = config.ElasticMinimumTotalNodes == default(int) ? pool.ElasticMinimumTotalNodes : config.ElasticMinimumTotalNodes;
            pool.ElasticMaximumTotalNodes  = config.ElasticMaximumTotalNodes == default(int) ? pool.ElasticMaximumTotalNodes : config.ElasticMaximumTotalNodes;
            pool.ElasticMinimumIdlingNodes = config.ElasticMinimumIdlingNodes == default(int) ? pool.ElasticMinimumIdlingNodes : config.ElasticMinimumIdlingNodes;
            pool.ElasticResizePeriod       = config.ElasticResizePeriod == default(int) ? pool.ElasticResizePeriod : config.ElasticResizePeriod;
            pool.ElasticResizeFactor       = config.ElasticResizeFactor == default(int) ? pool.ElasticResizeFactor : config.ElasticResizeFactor;
            pool.ElasticMinimumIdlingTime  = config.ElasticMinimumIdlingTime == default(int) ? pool.ElasticMinimumIdlingTime : config.ElasticMinimumIdlingTime;
            await pool.CommitAsync(ct);

            return(new CommandValues.GenericInfoCommandValue()
            {
                Uuid = pool.Uuid.ToString(),
                Message = "Pool set ",
            });
        }