|
|
Choosing A Webhost: |
CVS update of carob (2 files): msg#00166db.carob.cvs
Date: Wednesday, January 25, 2006 @ 23:07:40 Author: gilles Path: /cvsroot/carob/carob Modified: include/ConnectionParameters.hpp (1.15 -> 1.16) src/ConnectionParameters.cpp (1.13 -> 1.14) Added failure number field used by AbstractControllerConnectPolicy to determine the order in which controllers failed ----------------------------------+ include/ConnectionParameters.hpp | 9 +++++++++ src/ConnectionParameters.cpp | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) Index: carob/include/ConnectionParameters.hpp diff -u carob/include/ConnectionParameters.hpp:1.15 carob/include/ConnectionParameters.hpp:1.16 --- carob/include/ConnectionParameters.hpp:1.15 Tue Jan 24 11:06:11 2006 +++ carob/include/ConnectionParameters.hpp Wed Jan 25 23:07:40 2006 @@ -63,11 +63,20 @@ * @return sql query as a string */ operator std::wstring () const; + /** Sets the failure number */ + void setFailureNumber(int n) { failure_number = n; } + /** Gets the failure number */ + int getFailureNumber() const { return failure_number; } private: /** String representation of the host name, fully qualified or IP address */ std::wstring host_name; /** Host port */ in_port_t host_port; + /** + * Failure number (since start of process) associated to the last failure of + * this controller (set and used only by AbstractControllerConnectPolicy) + */ + int failure_number; }; /** Index: carob/src/ConnectionParameters.cpp diff -u carob/src/ConnectionParameters.cpp:1.13 carob/src/ConnectionParameters.cpp:1.14 --- carob/src/ConnectionParameters.cpp:1.13 Tue Jan 24 11:06:11 2006 +++ carob/src/ConnectionParameters.cpp Wed Jan 25 23:07:40 2006 @@ -27,12 +27,17 @@ using namespace CarobNS; -ControllerInfo::ControllerInfo() : host_name(L""), host_port(0) +ControllerInfo::ControllerInfo() : + host_name(L""), + host_port(0), + failure_number(0) { } ControllerInfo::ControllerInfo(const wstring &name, in_port_t port) : - host_name(name), host_port(port) + host_name(name), + host_port(port), + failure_number(0) { } @@ -40,17 +45,23 @@ { host_name = ci.host_name; host_port = ci.host_port; + failure_number = ci.failure_number; return *this; } bool ControllerInfo::operator ==(const ControllerInfo& ci) const { + //don't compare failure # return ((host_name == ci.host_name) && (host_port == ci.host_port)); } ControllerInfo::operator std::wstring() const { - return (host_name + toWString((int)host_port)); + std::wostringstream buffer; + buffer<<host_name<<L":"<<host_port; + if (failure_number>0) + buffer<<L" controller failure #"<<failure_number; + return buffer.str(); } ConnectionParameters::ConnectionParameters(
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS update of carob (3 files), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
|---|---|
| Next by Date: | CVS update of carob/include (Common.hpp SQLDataSerialization.hpp), marc-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Previous by Thread: | CVS update of carob (2 files), gilles-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Next by Thread: | CVS update of carob (2 files), gilles-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|