summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/ErrorCheck.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-07-14 14:49:33 +0000
committerAlan Conway <aconway@apache.org>2009-07-14 14:49:33 +0000
commit141f7814e093845265b24c47509fb0a9047c1881 (patch)
tree7f4fda51f6bf4eec62f332d4c44bf353c08913a5 /cpp/src/qpid/cluster/ErrorCheck.cpp
parent8978cf64e20e9cc89aa973ea7cce2ed3c85ec568 (diff)
downloadqpid-python-141f7814e093845265b24c47509fb0a9047c1881.tar.gz
Minor cluster optimizations.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@793917 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ErrorCheck.cpp')
-rw-r--r--cpp/src/qpid/cluster/ErrorCheck.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/cpp/src/qpid/cluster/ErrorCheck.cpp b/cpp/src/qpid/cluster/ErrorCheck.cpp
index 2af820c8a0..d498b252f5 100644
--- a/cpp/src/qpid/cluster/ErrorCheck.cpp
+++ b/cpp/src/qpid/cluster/ErrorCheck.cpp
@@ -67,8 +67,8 @@ void ErrorCheck::error(
}
void ErrorCheck::delivered(const EventFrame& e) {
- FrameQueue::iterator i = frames.insert(frames.end(), e);
- review(i);
+ frames.push_back(e);
+ review(frames.end()-1);
}
// Review a frame in the queue with respect to the current error.
@@ -84,7 +84,7 @@ ErrorCheck::FrameQueue::iterator ErrorCheck::review(const FrameQueue::iterator&
if (errorCheck->getType() < type) { // my error is worse than his
QPID_LOG(critical, cluster << " error " << frameSeq
<< " did not occur on " << i->getMemberId());
- throw Exception("Aborted by local failure that did not occur on all replicas");
+ throw Exception("Aborted by failure that did not occur on all replicas");
}
else { // his error is worse/same as mine.
QPID_LOG(debug, cluster << " error " << frameSeq
@@ -96,12 +96,12 @@ ErrorCheck::FrameQueue::iterator ErrorCheck::review(const FrameQueue::iterator&
else {
const ClusterConfigChangeBody* configChange = 0;
if (i->frame.getBody())
- configChange = dynamic_cast<const ClusterConfigChangeBody*>(i->frame.getMethod());
+ configChange = dynamic_cast<const ClusterConfigChangeBody*>(
+ i->frame.getMethod());
if (configChange) {
MemberSet members(ClusterMap::decode(configChange->getCurrent()));
QPID_LOG(debug, cluster << " apply config change to unresolved: "
<< members);
-
MemberSet intersect;
set_intersection(members.begin(), members.end(),
unresolved.begin(), unresolved.end(),
@@ -130,12 +130,4 @@ EventFrame ErrorCheck::getNext() {
return e;
}
-bool ErrorCheck::canProcess() const {
- return type == ERROR_TYPE_NONE && !frames.empty();
-}
-
-bool ErrorCheck::isUnresolved() const {
- return type != ERROR_TYPE_NONE;
-}
-
}} // namespace qpid::cluster