jstests/sharding/libs/zone_changes_util.js
/**
 * Asserts that the given shards have the given chunks.
 *
 * @param shardChunkBounds {Object} a map from each shard name to an array of the bounds for all
 *                                  the chunks on the shard. Each pair of chunk bounds is an array
 *                                  of the form [minKey, maxKey].
 */
Asserts that the given shards have the given chunks.
@param shardChunkBounds {Object} a map from each shard name to an array of the bounds for all
the chunks on the shard. Each pair of chunk bounds is an array
of the form [minKey, maxKey].
Asserts that the given shards have the given chunks . @param shardChunkBounds { Object } a map from each shard name to an array of the bounds for all the chunks on the shard . Each pair of chunk bounds is an array of the form [ minKey maxKey ] .
function assertChunksOnShards(configDB, ns, shardChunkBounds) {
    for (let [shardName, chunkBounds] of Object.entries(shardChunkBounds)) {
        for (let bounds of chunkBounds) {
            assert.eq(
                shardName,
                findChunksUtil.findOneChunkByNs(configDB, ns, {min: bounds[0], max: bounds[1]})
                    .shard,
                "expected to find chunk " + tojson(bounds) + " on shard \"" + shardName + "\"");
        }
    }
}
function assertChunksOnShards ( configDB , ns , shardChunkBounds ) { for ( let [ shardName , chunkBounds ] of Object . entries ( shardChunkBounds ) ) { for ( let bounds of chunkBounds ) { assert . eq ( shardName , findChunksUtil . findOneChunkByNs ( configDB , ns , { min : bounds [ 0 ] , max : bounds [ 1 ] } ) . shard , "expected to find chunk " + tojson ( bounds ) + " on shard \"" + shardName + "\"" ) ; } } }
Asserts that the given shards have the given chunks.
Asserts that the given shards have the given chunks .