summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_manager.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-02-15 18:12:53 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-02-18 16:58:05 -0500
commit585ade2ae5f776effa2c63c2221a4639f8545bc2 (patch)
tree227a763720311e43ce2caf19d83288a7e67a4583 /src/mongo/s/chunk_manager.h
parent41729cec076164077f13571e35596934477d7110 (diff)
downloadmongo-585ade2ae5f776effa2c63c2221a4639f8545bc2.tar.gz
SERVER-28030 Remove writes from ChunkManager
Also moves the 'chunks' tests from dbtests into the ChunkManager unit-tests.
Diffstat (limited to 'src/mongo/s/chunk_manager.h')
-rw-r--r--src/mongo/s/chunk_manager.h31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h
index 4cd6700cacf..f2d75fdb0b0 100644
--- a/src/mongo/s/chunk_manager.h
+++ b/src/mongo/s/chunk_manager.h
@@ -31,7 +31,6 @@
#include <map>
#include <set>
#include <string>
-#include <vector>
#include "mongo/base/disallow_copying.h"
#include "mongo/db/query/collation/collator_interface.h"
@@ -46,8 +45,8 @@
namespace mongo {
class CanonicalQuery;
-class CollectionType;
struct QuerySolutionNode;
+class NamespaceString;
class OperationContext;
// The key for the map is max for each Chunk or ChunkRange
@@ -57,11 +56,9 @@ class ChunkManager {
MONGO_DISALLOW_COPYING(ChunkManager);
public:
- ChunkManager(OperationContext* txn, const CollectionType& coll);
-
- // Creates an empty chunk manager for the namespace
- ChunkManager(const std::string& ns,
- const ShardKeyPattern& pattern,
+ ChunkManager(const NamespaceString& nss,
+ const OID& epoch,
+ const ShardKeyPattern& shardKeyPattern,
std::unique_ptr<CollatorInterface> defaultCollator,
bool unique);
@@ -91,29 +88,9 @@ public:
return _sequenceNumber;
}
- //
- // After constructor is invoked, we need to call loadExistingRanges. If this is a new
- // sharded collection, we can call createFirstChunks first.
- //
-
- // Creates new chunks based on info in chunk manager
- Status createFirstChunks(OperationContext* txn,
- const ShardId& primaryShardId,
- const std::vector<BSONObj>* initPoints,
- const std::set<ShardId>* initShardIds);
-
// Loads existing ranges based on info in chunk manager
void loadExistingRanges(OperationContext* txn, const ChunkManager* oldManager);
-
- // Helpers for load
- void calcInitSplitsAndShards(OperationContext* txn,
- const ShardId& primaryShardId,
- const std::vector<BSONObj>* initPoints,
- const std::set<ShardId>* initShardIds,
- std::vector<BSONObj>* splitPoints,
- std::vector<ShardId>* shardIds) const;
-
//
// Methods to use once loaded / created
//