This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Both must be objects | |
assert.throws(function() { | |
bsonWoCompare({ x: 1 }, 1); | |
}); | |
assert.throws(function() { | |
bsonWoCompare(1, { x: 1 }); | |
}); | |
assert.throws(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Tests whether the balancer continues with inconsistent chunks | |
// | |
var options = {separateConfig : true, sync : true}; | |
var st = new ShardingTest({shards : 2, mongos : 1, other : options}); | |
st.stopBalancer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var st = new ShardingTest({ shards: 2 }); | |
st.adminCommand({ enablesharding: "test" }); | |
st.adminCommand({ shardcollection: "test.col0", key: { a: 1, b: 1 }}); | |
st.adminCommand({ shardcollection: "test.col1", key: { 'x.a': 1 }}); | |
var db = st.s.getDB( "test" ); | |
var col = db.getCollection( "col0" ); | |
var dotCol = db.getCollection( "col1" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace mongo { | |
template <typename T> | |
bool rangeIsNewer(const T* lhs, const T* rhs); | |
/** | |
* Given a list of ranges (note: must be sorted by min), outputs the operations needed | |
* to squash the the overlapping ranges such that the list of ranges will not overlap | |
* one another. | |
* | |
* The caller owns the pointer to both the input and output vectors. The method guarantees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2012 10gen Inc. | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Affero General Public License, version 3, | |
* as published by the Free Software Foundation. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/mongo/SConscript b/src/mongo/SConscript | |
index e23047f..95465ca 100644 | |
--- a/src/mongo/SConscript | |
+++ b/src/mongo/SConscript | |
@@ -700,3 +700,9 @@ env.Alias("clientBuild", ['#buildscripts/build_and_test_client.py', | |
'$PYTHON ${SOURCES[0]} ${SOURCES[2]} ${EXTRAPATH and "--extrapath"} $EXTRAPATH' | |
) | |
env.AlwaysBuild("clientBuild") | |
+ | |
+bench_fp = env.Install('#/', env.Program('bench_fp', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# A simple test that modifies random bytes of an existing dump file created | |
# from mongodump and runs mongorestore against a running mongod process on | |
# the default port | |
import random | |
import string | |
import subprocess | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based from: https://gist.github.com/3fcf2a1c8583416c6ef9 | |
var host = "replicaset.local"; | |
var rsName = 'rs'; | |
/** | |
* @return the connection string of the bridged replica set. | |
*/ | |
var getBridgedConnection = function (startDestPort, startBridgePort, delays) { | |
var bridgeHosts = []; |