summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/collection_cloner.cpp
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2018-03-01 17:37:52 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2018-04-04 17:23:50 -0400
commit7d09f278a2acf9791b36927d6af1d30347d60391 (patch)
tree91138c5de49ba3f300df43f840e63c9979a9cebd /src/mongo/db/repl/collection_cloner.cpp
parent09253ad8f4187f4e7e4c453cc157362d751e0918 (diff)
downloadmongo-7d09f278a2acf9791b36927d6af1d30347d60391.tar.gz
SERVER-33323 Use the IDL to serialize the ARM
Diffstat (limited to 'src/mongo/db/repl/collection_cloner.cpp')
-rw-r--r--src/mongo/db/repl/collection_cloner.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mongo/db/repl/collection_cloner.cpp b/src/mongo/db/repl/collection_cloner.cpp
index 773f54a0b8b..8aee68a4c58 100644
--- a/src/mongo/db/repl/collection_cloner.cpp
+++ b/src/mongo/db/repl/collection_cloner.cpp
@@ -43,7 +43,6 @@
#include "mongo/db/repl/storage_interface_mock.h"
#include "mongo/db/server_parameters.h"
#include "mongo/rpc/get_status_from_command_result.h"
-#include "mongo/s/query/cluster_client_cursor_params.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/destructor_guard.h"
#include "mongo/util/fail_point_service.h"
@@ -613,20 +612,25 @@ void CollectionCloner::_establishCollectionCursorsCallback(const RemoteCommandCa
<< " cursors established.";
// Initialize the 'AsyncResultsMerger'(ARM).
- std::vector<ClusterClientCursorParams::RemoteCursor> remoteCursors;
+ std::vector<RemoteCursor> remoteCursors;
for (auto&& cursorResponse : cursorResponses) {
// A placeholder 'ShardId' is used until the ARM is made less sharding specific.
- remoteCursors.emplace_back(
- ShardId("CollectionClonerSyncSource"), _source, std::move(cursorResponse));
+ remoteCursors.emplace_back();
+ auto& newCursor = remoteCursors.back();
+ newCursor.setShardId("CollectionClonerSyncSource");
+ newCursor.setHostAndPort(_source);
+ newCursor.setCursorResponse(std::move(cursorResponse));
}
- _clusterClientCursorParams = stdx::make_unique<ClusterClientCursorParams>(_sourceNss);
- _clusterClientCursorParams->remotes = std::move(remoteCursors);
- if (_collectionCloningBatchSize > 0)
- _clusterClientCursorParams->batchSize = _collectionCloningBatchSize;
+ AsyncResultsMergerParams armParams;
+ armParams.setNss(_sourceNss);
+ armParams.setRemotes(std::move(remoteCursors));
+ if (_collectionCloningBatchSize > 0) {
+ armParams.setBatchSize(_collectionCloningBatchSize);
+ }
Client::initThreadIfNotAlready();
_arm = stdx::make_unique<AsyncResultsMerger>(
- cc().getOperationContext(), _executor, _clusterClientCursorParams.get());
+ cc().getOperationContext(), _executor, std::move(armParams));
// This completion guard invokes _finishCallback on destruction.
auto cancelRemainingWorkInLock = [this]() { _cancelRemainingWork_inlock(); };