summaryrefslogtreecommitdiff
path: root/src/mongo/s/cluster_constants.cpp
blob: 46873c1591ba212b7f124774f48ce63f4fb187eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
 *    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
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "mongo/s/cluster_constants.h"

namespace mongo {

    const string ConfigNS::shard = "config.shards";
    BSONField<string> ShardFields::name("_id");
    BSONField<string> ShardFields::host("host");
    BSONField<bool> ShardFields::draining("draining");
    BSONField<long long> ShardFields::maxSize("maxSize");
    BSONField<BSONArray> ShardFields::tags("tags");

    const string ConfigNS::database = "config.databases";
    BSONField<string> DatabaseFields::name("_id");
    BSONField<bool> DatabaseFields::partitioned("partitioned");
    BSONField<string> DatabaseFields::primary("primary");
    BSONField<string> DatabaseFields::DEPRECATED_name("name");
    BSONField<bool> DatabaseFields::DEPRECATED_sharded("sharded");
    BSONField<string> DatabaseFields::NEW_shard("shard");
    BSONField<bool> DatabaseFields::NEW_draining("draining");
    BSONField<bool> DatabaseFields::NEW_scatterCollections("scatterCollections");

    const string ConfigNS::collection = "config.collections";
    BSONField<string> CollectionFields::name("_id");
    BSONField<string> CollectionFields::shard("shard");
    BSONField<BSONObj> CollectionFields::key("key");
    BSONField<bool> CollectionFields::unique("unique");
    BSONField<Date_t> CollectionFields::lastmod("lastmod");
    BSONField<bool> CollectionFields::dropped("dropped");
    BSONField<bool> CollectionFields::noBalance("noBalance");
    BSONField<OID> CollectionFields::epoch("lastmodEpoch");

    const string ConfigNS::tag = "config.tags";
    BSONField<string> TagFields::ns("ns");
    BSONField<string> TagFields::tag("tag");
    BSONField<BSONObj> TagFields::min("min");
    BSONField<BSONObj> TagFields::max("max");

    const string ConfigNS::mongos = "config.mongos";
    BSONField<string> MongosFields::name("_id");
    BSONField<Date_t> MongosFields::ping("ping");
    BSONField<int> MongosFields::up("up");
    BSONField<bool> MongosFields::waiting("waiting");

    const string ConfigNS::settings = "config.settings";
    BSONField<string> SettingsFields::key("_id");
    BSONField<int> SettingsFields::chunksize("value");
    BSONField<bool> SettingsFields::balancerStopped("stopped");
    BSONField<BSONObj> SettingsFields::balancerActiveWindow("activeWindow");
    BSONField<bool> SettingsFields::shortBalancerSleep("_nosleep");
    BSONField<bool> SettingsFields::secondaryThrottle("_secondaryThrottle");

    const string ConfigNS::changelog = "config.changelog";
    BSONField<string> ChangelogFields::changeID("_id");
    BSONField<string> ChangelogFields::server("server");
    BSONField<string> ChangelogFields::clientAddr("clientAddr");
    BSONField<Date_t> ChangelogFields::time("time");
    BSONField<string> ChangelogFields::what("what");
    BSONField<string> ChangelogFields::ns("ns");
    BSONField<BSONObj> ChangelogFields::details("details");

    const string ConfigNS::locks = "config.locks";
    BSONField<string> LockFields::name("_id");
    BSONField<int> LockFields::state("state");
    BSONField<string> LockFields::process("process");
    BSONField<OID> LockFields::lockID("ts");
    BSONField<string> LockFields::who("who");
    BSONField<string> LockFields::why("why");

    const string ConfigNS::lockpings = "config.lockpings";
    BSONField<string> LockPingFields::process("_id");
    BSONField<Date_t> LockPingFields::ping("ping");

} // namespace mongo