summaryrefslogtreecommitdiff
path: root/cpp/lib/broker/Configuration.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2006-12-06 12:01:40 +0000
committerGordon Sim <gsim@apache.org>2006-12-06 12:01:40 +0000
commitc017c1cd768a88c7e74076b660be36902059528a (patch)
tree027de49a21a56ef7ac3952b7230028ec9c883b90 /cpp/lib/broker/Configuration.cpp
parent905c59a988010c9db7f64ee90f9d0b6e1011f0d0 (diff)
downloadqpid-python-c017c1cd768a88c7e74076b660be36902059528a.tar.gz
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
Diffstat (limited to 'cpp/lib/broker/Configuration.cpp')
-rw-r--r--cpp/lib/broker/Configuration.cpp29
1 files changed, 29 insertions, 0 deletions
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) :