diff options
| author | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:07 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-06-12 21:20:07 +0000 |
| commit | ed0d321d0ad56b9ea3d370d8b6b34fce2c8ef892 (patch) | |
| tree | 1e225776914dc5b14e0e38c8e2236d5ce144ac3b /cpp/src/qpid/ha/ReplicationTest.cpp | |
| parent | c9fc98ae80a5d8c4f58541f9738aa975723ff3d6 (diff) | |
| download | qpid-python-ed0d321d0ad56b9ea3d370d8b6b34fce2c8ef892.tar.gz | |
QPID-3603: Introduced RemoteBackup to track backup status.
The primary creates RemoteBackup object for each connected or expected
backup. On first being promoted, the new primary has a RemoteBackup
for each of the known backups at the time of the failure.
The RemoteBackup manages queue guards for its backup and
tracks it's readiness.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1349540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/ha/ReplicationTest.cpp')
| -rw-r--r-- | cpp/src/qpid/ha/ReplicationTest.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cpp/src/qpid/ha/ReplicationTest.cpp b/cpp/src/qpid/ha/ReplicationTest.cpp index 1db101dc94..613ac0a8c6 100644 --- a/cpp/src/qpid/ha/ReplicationTest.cpp +++ b/cpp/src/qpid/ha/ReplicationTest.cpp @@ -52,18 +52,23 @@ namespace { const std::string AUTO_DELETE_TIMEOUT("qpid.auto_delete_timeout"); } -bool ReplicationTest::isReplicated(const Variant::Map& args, bool autodelete, bool exclusive) { +bool ReplicationTest::isReplicated( + ReplicateLevel level, const Variant::Map& args, bool autodelete, bool exclusive) +{ bool ignore = autodelete && exclusive && args.find(AUTO_DELETE_TIMEOUT) == args.end(); - return replicateLevel(args) && !ignore; + return !ignore && replicateLevel(args) >= level; } -bool ReplicationTest::isReplicated(const framing::FieldTable& args, bool autodelete, bool exclusive) { +bool ReplicationTest::isReplicated( + ReplicateLevel level, const framing::FieldTable& args, bool autodelete, bool exclusive) +{ bool ignore = autodelete && exclusive && !args.isSet(AUTO_DELETE_TIMEOUT); - return replicateLevel(args) && !ignore; + return !ignore && replicateLevel(args) >= level; } -bool ReplicationTest::isReplicated(const broker::Queue& q) { - return isReplicated(q.getSettings(), q.isAutoDelete(), q.hasExclusiveOwner()); +bool ReplicationTest::isReplicated(ReplicateLevel level, const broker::Queue& q) +{ + return isReplicated(level, q.getSettings(), q.isAutoDelete(), q.hasExclusiveOwner()); } |
