summaryrefslogtreecommitdiff
path: root/src/mongo/s/balancer/balancer_chunk_selection_policy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/balancer/balancer_chunk_selection_policy.h')
-rw-r--r--src/mongo/s/balancer/balancer_chunk_selection_policy.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/s/balancer/balancer_chunk_selection_policy.h b/src/mongo/s/balancer/balancer_chunk_selection_policy.h
index 7bdf049c331..1329f3f9194 100644
--- a/src/mongo/s/balancer/balancer_chunk_selection_policy.h
+++ b/src/mongo/s/balancer/balancer_chunk_selection_policy.h
@@ -103,6 +103,15 @@ public:
virtual StatusWith<boost::optional<MigrateInfo>> selectSpecificChunkToMove(
OperationContext* txn, const ChunkType& chunk) = 0;
+ /**
+ * Asks the chunk selection policy to validate that the specified chunk migration is allowed
+ * given the current rules. Returns OK if the migration won't violate any rules or any other
+ * failed status otherwise.
+ */
+ virtual Status checkMoveAllowed(OperationContext* txn,
+ const ChunkType& chunk,
+ const ShardId& newShardId) = 0;
+
protected:
BalancerChunkSelectionPolicy();
};