summaryrefslogtreecommitdiff
path: root/src/mongo/s/client/shard_registry.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/client/shard_registry.h')
-rw-r--r--src/mongo/s/client/shard_registry.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mongo/s/client/shard_registry.h b/src/mongo/s/client/shard_registry.h
index d0daccd4d41..75b2af8bf72 100644
--- a/src/mongo/s/client/shard_registry.h
+++ b/src/mongo/s/client/shard_registry.h
@@ -28,6 +28,7 @@
#pragma once
+#include <boost/optional.hpp>
#include <memory>
#include <mutex>
#include <string>
@@ -39,11 +40,15 @@ namespace mongo {
class BSONObjBuilder;
class CatalogManager;
+ class HostAndPort;
+ class NamespaceString;
class RemoteCommandRunner;
class RemoteCommandTargeterFactory;
class Shard;
class ShardType;
+ template<typename T> class StatusWith;
+
namespace executor {
class TaskExecutor;
@@ -95,6 +100,26 @@ namespace executor {
void toBSON(BSONObjBuilder* result);
+ /**
+ * Executes 'find' command against the specified host and fetches *all* the results that
+ * the host will return until there are no more or until an error is returned.
+ *
+ * Returns either the complete set of results or an error, never partial results.
+ *
+ * Note: should never be used outside of CatalogManagerReplicaSet or DistLockCatalogImpl.
+ */
+ StatusWith<std::vector<BSONObj>> exhaustiveFind(const HostAndPort& host,
+ const NamespaceString& nss,
+ const BSONObj& query,
+ boost::optional<int> limit);
+
+ /**
+ * Runs a command against the specified host and returns the result.
+ */
+ StatusWith<BSONObj> runCommand(const HostAndPort& host,
+ const std::string& dbName,
+ const BSONObj& cmdObj);
+
private:
typedef std::map<ShardId, std::shared_ptr<Shard>> ShardMap;