summaryrefslogtreecommitdiff
path: root/src/mongo/s/move_chunk_request.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-06-10 16:54:56 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-06-13 15:19:43 -0400
commit97ad19ed5bc71835e9783b932411b0ea9f83d572 (patch)
tree2e58cfdd0f5f17b567aec956d7d2e69bbf3fbeb0 /src/mongo/s/move_chunk_request.cpp
parent6b6cd6727d262d5db5e4f226e4da0d2bc410a4d8 (diff)
downloadmongo-97ad19ed5bc71835e9783b932411b0ea9f83d572.tar.gz
SERVER-24467 Make MoveChunkRequest and dependencies comparable
This change implements the '==' operator on MoveChunkRequest and any dependent classes which do not have it.
Diffstat (limited to 'src/mongo/s/move_chunk_request.cpp')
-rw-r--r--src/mongo/s/move_chunk_request.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mongo/s/move_chunk_request.cpp b/src/mongo/s/move_chunk_request.cpp
index a3f7bd91fda..8370000d511 100644
--- a/src/mongo/s/move_chunk_request.cpp
+++ b/src/mongo/s/move_chunk_request.cpp
@@ -154,4 +154,31 @@ void MoveChunkRequest::appendAsCommand(BSONObjBuilder* builder,
builder->append(kTakeDistLock, takeDistLock);
}
+bool MoveChunkRequest::operator==(const MoveChunkRequest& other) const {
+ if (_nss != other._nss)
+ return false;
+ if (_configServerCS != other._configServerCS)
+ return false;
+ if (_fromShardId != other._fromShardId)
+ return false;
+ if (_toShardId != other._toShardId)
+ return false;
+ if (_range != other._range)
+ return false;
+ if (_maxChunkSizeBytes != other._maxChunkSizeBytes)
+ return false;
+ if (_secondaryThrottle != other._secondaryThrottle)
+ return false;
+ if (_waitForDelete != other._waitForDelete)
+ return false;
+ if (_takeDistLock != other._takeDistLock)
+ return false;
+
+ return true;
+}
+
+bool MoveChunkRequest::operator!=(const MoveChunkRequest& other) const {
+ return !(*this == other);
+}
+
} // namespace mongo