summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_manager.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-01-26 14:57:32 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-01-30 16:43:13 -0500
commit3942d88af18cd7a2d9fff8ea3800f8c7769e5c9f (patch)
treeb59c6fa5a7694b7b8a5d1a8c70d0752bc3236f66 /src/mongo/s/chunk_manager.h
parent2922aea4adf8e8fe9bab3a5d6e986e7aecba7228 (diff)
downloadmongo-3942d88af18cd7a2d9fff8ea3800f8c7769e5c9f.tar.gz
SERVER-27809 Move Chunk::splitIfShould to cluster_write.h/.cpp
Diffstat (limited to 'src/mongo/s/chunk_manager.h')
-rw-r--r--src/mongo/s/chunk_manager.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h
index cbb0b6426ef..f809c6167c6 100644
--- a/src/mongo/s/chunk_manager.h
+++ b/src/mongo/s/chunk_manager.h
@@ -33,6 +33,7 @@
#include <string>
#include <vector>
+#include "mongo/base/disallow_copying.h"
#include "mongo/db/query/collation/collator_interface.h"
#include "mongo/db/repl/optime.h"
#include "mongo/s/catalog/type_chunk.h"
@@ -45,7 +46,6 @@
namespace mongo {
class CanonicalQuery;
-class Chunk;
class CollectionType;
struct QuerySolutionNode;
class OperationContext;
@@ -54,6 +54,8 @@ class OperationContext;
typedef BSONObjIndexedMap<std::shared_ptr<Chunk>> ChunkMap;
class ChunkManager {
+ MONGO_DISALLOW_COPYING(ChunkManager);
+
public:
typedef std::map<ShardId, ChunkVersion> ShardVersionMap;
@@ -270,27 +272,23 @@ private:
// OpTime of config server the last time chunks were loaded.
repl::OpTime _configOpTime;
- //
- // Split Heuristic info
- //
- class SplitHeuristics {
+ // Auto-split throttling state
+ struct AutoSplitThrottle {
public:
- SplitHeuristics() : _splitTickets(maxParallelSplits) {}
+ AutoSplitThrottle() : _splitTickets(maxParallelSplits) {}
TicketHolder _splitTickets;
// Maximum number of parallel threads requesting a split
static const int maxParallelSplits = 5;
- };
- mutable SplitHeuristics _splitHeuristics;
-
- //
- // End split heuristics
- //
+ } _autoSplitThrottle;
- friend class Chunk;
- static AtomicUInt32 NextSequenceNumber;
+ // This function needs to be able to access the auto-split throttle
+ friend void updateChunkWriteStatsAndSplitIfNeeded(OperationContext*,
+ ChunkManager*,
+ Chunk*,
+ long);
friend class TestableChunkManager;
};