~ubuntu-branches/ubuntu/utopic/mongodb/utopic

« back to all changes in this revision

Viewing changes to jstests/sharding/basic_sharding_params.js

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-07-03 09:23:46 UTC
  • mfrom: (1.3.10) (44.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20140703092346-c5bvt46wnzougyly
Tags: 1:2.6.3-0ubuntu1
* New upstream stable release:
  - Dropped patches, included upstream:
    + 0003-All-platforms-but-Windows-find-hash-in-std-tr1.patch
    + 0008-Use-system-libstemmer.patch
    + 0011-Use-a-signed-char-to-store-BSONType-enumerations.patch
    + 0001-SERVER-12064-Atomic-operations-for-gcc-non-Intel-arc.patch
    + 0002-SERVER-12065-Support-ARM-and-AArch64-builds.patch
  - d/p/*: Refreshed/rebased remaining patches.
  - Use system provided libyaml-cpp:
    + d/control: Add libyaml-cpp-dev to BD's.
    + d/rules: Enable --with-system-yaml option.
    + d/p/fix-yaml-detection.patch: Fix detection of libyaml-cpp library.
  - d/mongodb-server.mongodb.upstart: Sync changes from upstream.
  - d/control,mongodb-dev.*: Drop mongodb-dev package; it has no reverse
    dependencies and upstream no longer install header files.
  - d/NEWS: Point users to upstream upgrade documentation for upgrades
    from 2.4 to 2.6.
* Merge from Debian unstable.
* d/control: BD on libv8-3.14-dev to ensure that transitioning to new v8
  versions is a explicit action due to changes in behaviour in >= 3.25
  (LP: #1295723).
* d/mongodb-server.prerm: Dropped debug echo call from maintainer script
  (LP: #1294455).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Test of complex sharding initialization
 
2
 
 
3
function shardingTestUsingObjects() {
 
4
    var st = new ShardingTest( {
 
5
    
 
6
       mongos : { s0 : { verbose : 6 }, s1 : { verbose : 5 } },
 
7
       config : { c0 : { verbose : 4 } },
 
8
       shards : { d0 : { verbose : 3 }, 
 
9
                  rs1 : {
 
10
                      nodes : { d0 : { verbose : 2 }, 
 
11
                                a1 : { verbose : 1 } } }
 
12
       }
 
13
    } );
 
14
 
 
15
    var s0 = st.s0;
 
16
    assert.eq( s0, st._mongos[0] );
 
17
 
 
18
    var s1 = st.s1;
 
19
    assert.eq( s1, st._mongos[1] );
 
20
 
 
21
    var c0 = st.c0;
 
22
    assert.eq( c0, st._configServers[0] );
 
23
 
 
24
    var d0 = st.d0;
 
25
    assert.eq( d0, st._shardServers[0] );
 
26
 
 
27
    var rs1 = st.rs1;
 
28
    assert.eq( rs1, st._rsObjects[1] );
 
29
 
 
30
    var rs1_d0 = rs1.nodes[0];
 
31
    var rs1_a1 = rs1.nodes[1];
 
32
 
 
33
    assert.contains( "-vvvvvv", s0.commandLine );
 
34
    assert.contains( "-vvvvv", s1.commandLine );
 
35
    assert.contains( "-vvvv", c0.commandLine );
 
36
    assert.contains( "-vvv", d0.commandLine );
 
37
    assert.contains( "-vv", rs1_d0.commandLine );
 
38
    assert.contains( "-v", rs1_a1.commandLine );
 
39
 
 
40
    st.stop();
 
41
}
 
42
 
 
43
function shardingTestUsingArrays() {
 
44
    var st = new ShardingTest( {
 
45
       mongos : [{ verbose : 5 },  { verbose : 4 } ],
 
46
       config : [{ verbose : 3 }],
 
47
       shards : [{ verbose : 2 }, { verbose : 1 } ]
 
48
    });
 
49
 
 
50
    var s0 = st.s0;
 
51
    assert.eq( s0, st._mongos[0] );
 
52
 
 
53
    var s1 = st.s1;
 
54
    assert.eq( s1, st._mongos[1] );
 
55
 
 
56
    var c0 = st.c0;
 
57
    assert.eq( c0, st._configServers[0] );
 
58
 
 
59
    var d0 = st.d0;
 
60
    assert.eq( d0, st._shardServers[0] );
 
61
 
 
62
    var d1 = st.d1;
 
63
    assert.eq( d1, st._shardServers[1] );
 
64
 
 
65
    assert.contains( "-vvvvv", s0.commandLine );
 
66
    assert.contains( "-vvvv", s1.commandLine );
 
67
    assert.contains( "-vvv", c0.commandLine );
 
68
    assert.contains( "-vv", d0.commandLine );
 
69
    assert.contains( "-v", d1.commandLine );
 
70
 
 
71
    st.stop();
 
72
}
 
73
 
 
74
shardingTestUsingObjects();
 
75
shardingTestUsingArrays();
 
76