From c017c1cd768a88c7e74076b660be36902059528a Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 6 Dec 2006 12:01:40 +0000 Subject: Added new configuration option for staging threshold (size above which messages will be written to disk as content arrives rather than accumulating that content in memory). Pass this through to all channels and to the store on recovery. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@483046 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/lib/broker/Configuration.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'cpp/lib/broker/Configuration.cpp') diff --git a/cpp/lib/broker/Configuration.cpp b/cpp/lib/broker/Configuration.cpp index ccc5de7fa9..65d60ae1ca 100644 --- a/cpp/lib/broker/Configuration.cpp +++ b/cpp/lib/broker/Configuration.cpp @@ -32,6 +32,7 @@ Configuration::Configuration() : maxConnections("max-connections", "Set the maximum number of connections the broker can accept (default=500).", 500), connectionBacklog("connection-backlog", "Set the connection backlog for the servers socket (default=10)", 10), store('s', "store", "Set the message store module to use (default='' which implies no store)", ""), + stagingThreshold("staging-threshold", "Set the message size threshold above which messages will be written to disk as they arrive (default=5,000,000)", 5000000), help("help", "Print usage information", false), version("version", "Print version information", false) { @@ -41,6 +42,7 @@ Configuration::Configuration() : options.push_back(&maxConnections); options.push_back(&connectionBacklog); options.push_back(&store); + options.push_back(&stagingThreshold); options.push_back(&help); options.push_back(&version); } @@ -106,6 +108,11 @@ const std::string& Configuration::getStore() const { return store.getValue(); } +long Configuration::getStagingThreshold() const { + return stagingThreshold.getValue(); +} + + Configuration::Option::Option(const char _flag, const string& _name, const string& _desc) : flag(string("-") + _flag), name("--" +_name), desc(_desc) {} @@ -192,6 +199,28 @@ void Configuration::IntOption::setValue(const std::string& _value){ value = atoi(_value.c_str()); } +// Long Option: + +Configuration::LongOption::LongOption(const char _flag, const string& _name, const string& _desc, const long _value) : + Option(_flag,_name,_desc), defaultValue(_value), value(_value) {} + +Configuration::LongOption::LongOption(const string& _name, const string& _desc, const long _value) : + Option(_name,_desc), defaultValue(_value), value(_value) {} + +Configuration::LongOption::~LongOption(){} + +long Configuration::LongOption::getValue() const { + return value; +} + +bool Configuration::LongOption::needsValue() const { + return true; +} + +void Configuration::LongOption::setValue(const std::string& _value){ + value = atol(_value.c_str()); +} + // Bool Option: Configuration::BoolOption::BoolOption(const char _flag, const string& _name, const string& _desc, const bool _value) : -- cgit v1.2.1