diff options
Diffstat (limited to 'jstests/sharding/libs/with_partial_shard_key_util.js')
| -rw-r--r-- | jstests/sharding/libs/with_partial_shard_key_util.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/jstests/sharding/libs/with_partial_shard_key_util.js b/jstests/sharding/libs/with_partial_shard_key_util.js deleted file mode 100644 index bcfeae08926..00000000000 --- a/jstests/sharding/libs/with_partial_shard_key_util.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Utilities for the find_and_modify_with_partial_shard_key.js and delete_with_partial_shard_key.js - * tests. - */ -"use strict"; - -/** - * Runs an explain on the `cmdObj` and checks that the explain targets the shard given be - * `expectedShardName`. - */ -function assertExplainTargetsCorrectShard(db, cmdObj, expectedShardName) { - var res = db.runCommand({explain: cmdObj}); - assert.eq(res.queryPlanner.winningPlan.shards.length, 1); - assert.eq(res.queryPlanner.winningPlan.shards[0].shardName, expectedShardName); -} - -/** - * Performs a split given by the `splitDoc`, and then moves the chunk containg `moveShard0Doc` to - * shard0 and the chunk containing `moveShard1Doc` to shard1. - */ -function splitAndMoveChunks(st, splitDoc, moveShard0Doc, moveShard1Doc) { - assert.commandWorked(st.s0.adminCommand({split: "test.sharded_coll", middle: splitDoc})); - - assert.commandWorked(st.s0.adminCommand( - {moveChunk: "test.sharded_coll", find: moveShard0Doc, to: st.shard0.shardName})); - assert.commandWorked(st.s0.adminCommand( - {moveChunk: "test.sharded_coll", find: moveShard1Doc, to: st.shard1.shardName})); -} |
