From f415aad16ec26a89110a71232dc898218dc5d85c Mon Sep 17 00:00:00 2001 From: Spencer T Brody Date: Wed, 19 Aug 2015 17:14:33 -0400 Subject: SERVER-19875 Add OperationContext to CatalogManager::getAllShards --- src/mongo/s/chunk.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/mongo/s/chunk.h') diff --git a/src/mongo/s/chunk.h b/src/mongo/s/chunk.h index 1ec9a9447cb..ef4b619b342 100644 --- a/src/mongo/s/chunk.h +++ b/src/mongo/s/chunk.h @@ -28,6 +28,7 @@ #pragma once +#include "mongo/s/catalog/type_chunk.h" #include "mongo/s/chunk_version.h" #include "mongo/s/client/shard.h" @@ -62,7 +63,7 @@ public: autoSplitInternal }; - Chunk(const ChunkManager* info, BSONObj from); + Chunk(OperationContext* txn, const ChunkManager* info, ChunkType from); Chunk(const ChunkManager* info, const BSONObj& min, const BSONObj& max, @@ -161,7 +162,7 @@ public: * * @param medianKey the key that divides this chunk, if there is one, or empty */ - void pickMedianKey(BSONObj& medianKey) const; + void pickMedianKey(OperationContext* txn, BSONObj& medianKey) const; /** * Ask the mongod holding this chunk to figure out the split points. @@ -170,7 +171,8 @@ public: * @param maxPoints limits the number of split points that are needed, zero is max (optional) * @param maxObjs limits the number of objects in each chunk, zero is as max (optional) */ - void pickSplitVector(std::vector& splitPoints, + void pickSplitVector(OperationContext* txn, + std::vector& splitPoints, long long chunkSize, int maxPoints = 0, int maxObjs = 0) const; @@ -198,12 +200,6 @@ public: int maxTimeMS, BSONObj& res) const; - /** - * @return size of shard in bytes - * talks to mongod to do this - */ - long getPhysicalSize() const; - /** * marks this chunk as a jumbo chunk * that means the chunk will be inelligble for migrates @@ -261,7 +257,7 @@ private: /** * Returns the connection string for the shard on which this chunk resides. */ - std::string _getShardConnectionString() const; + std::string _getShardConnectionString(OperationContext* txn) const; // if min/max key is pos/neg infinity bool _minIsInf() const; @@ -293,7 +289,7 @@ private: * is simply an ordered list of ascending/descending field names. Examples: * {a : 1, b : -1} is not special. {a : "hashed"} is. */ - BSONObj _getExtremeKey(bool doSplitAtLower) const; + BSONObj _getExtremeKey(OperationContext* txn, bool doSplitAtLower) const; /** * Determines the appropriate split points for this chunk. @@ -301,7 +297,9 @@ private: * @param atMedian perform a single split at the middle of this chunk. * @param splitPoints out parameter containing the chosen split points. Can be empty. */ - void determineSplitPoints(bool atMedian, std::vector* splitPoints) const; + void determineSplitPoints(OperationContext* txn, + bool atMedian, + std::vector* splitPoints) const; /** * initializes _dataWritten with a random value so that a mongos restart -- cgit v1.2.1