summaryrefslogtreecommitdiff
path: root/dbgrid
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-01-14 17:09:51 -0500
committerAaron <aaron@10gen.com>2009-01-14 17:09:51 -0500
commitad1f6b3cbdd1183eedc04f98fa813e63ce68a408 (patch)
treecc0498e49d55eae8e8e1cbb7f494b085a732a45d /dbgrid
parent023535d844a43627d1f2c934ffd349f4355ed4c2 (diff)
downloadmongo-ad1f6b3cbdd1183eedc04f98fa813e63ce68a408.tar.gz
Put our code in 'mongo' namespace
Diffstat (limited to 'dbgrid')
-rw-r--r--dbgrid/dbgrid.cpp14
-rw-r--r--dbgrid/dbgrid_commands.cpp4
-rw-r--r--dbgrid/gridconfig.cpp4
-rw-r--r--dbgrid/gridconfig.h4
-rw-r--r--dbgrid/griddatabase.cpp4
-rw-r--r--dbgrid/griddatabase.h4
-rw-r--r--dbgrid/request.cpp4
-rw-r--r--dbgrid/shard.cpp4
-rw-r--r--dbgrid/shard.h4
9 files changed, 46 insertions, 0 deletions
diff --git a/dbgrid/dbgrid.cpp b/dbgrid/dbgrid.cpp
index 9974e44859a..06b519b5001 100644
--- a/dbgrid/dbgrid.cpp
+++ b/dbgrid/dbgrid.cpp
@@ -22,6 +22,8 @@
#include "../client/connpool.h"
#include "gridconfig.h"
+namespace mongo {
+
bool dashDashInfer = false;
vector<string> dashDashGridDb;
int port = 27017;
@@ -34,8 +36,12 @@ string getDbContext() {
#if !defined(_WIN32)
+} // namespace mongo
+
#include <signal.h>
+namespace mongo {
+
void pipeSigHandler( int signal ) {
psignal( signal, "Signal Received : ");
}
@@ -124,6 +130,10 @@ void start() {
l.listen();
}
+} // namespace mongo
+
+using namespace mongo;
+
int main(int argc, char* argv[], char *envp[] ) {
#if !defined(_WIN32)
signal(SIGPIPE, pipeSigHandler);
@@ -179,8 +189,12 @@ int main(int argc, char* argv[], char *envp[] ) {
return 0;
}
+namespace mongo {
+
#undef exit
void dbexit(int rc, const char *why) {
log() << "dbexit: " << why << " rc:" << rc << endl;
exit(rc);
}
+
+} // namespace mongo
diff --git a/dbgrid/dbgrid_commands.cpp b/dbgrid/dbgrid_commands.cpp
index 9cbf13a2136..fa62f299f1b 100644
--- a/dbgrid/dbgrid_commands.cpp
+++ b/dbgrid/dbgrid_commands.cpp
@@ -36,6 +36,8 @@
#include "../db/commands.h"
#include "gridconfig.h"
+namespace mongo {
+
extern string ourHostname;
namespace dbgrid_cmds {
@@ -80,3 +82,5 @@ public:
} ismaster;
}
+
+} // namespace mongo
diff --git a/dbgrid/gridconfig.cpp b/dbgrid/gridconfig.cpp
index 1cfa82d0564..5f6e90121e1 100644
--- a/dbgrid/gridconfig.cpp
+++ b/dbgrid/gridconfig.cpp
@@ -24,6 +24,8 @@
#include "gridconfig.h"
#include "../client/model.h"
+namespace mongo {
+
/* --- Machine --- */
map<string, Machine*> Machine::machines;
@@ -63,3 +65,5 @@ Machine* Grid::owner(const char *ns, BSONObj& objOrKey) {
uassert("dbgrid: not implemented 100", false);
return 0;
}
+
+} // namespace mongo
diff --git a/dbgrid/gridconfig.h b/dbgrid/gridconfig.h
index 8864951d070..54fce505517 100644
--- a/dbgrid/gridconfig.h
+++ b/dbgrid/gridconfig.h
@@ -27,6 +27,8 @@
#include "../client/model.h"
#include "griddatabase.h"
+namespace mongo {
+
/* Machine is the concept of a host that runs the db process.
*/
class Machine {
@@ -103,3 +105,5 @@ public:
};
extern Grid grid;
+
+} // namespace mongo
diff --git a/dbgrid/griddatabase.cpp b/dbgrid/griddatabase.cpp
index f403e466332..dcb8c957ad9 100644
--- a/dbgrid/griddatabase.cpp
+++ b/dbgrid/griddatabase.cpp
@@ -25,6 +25,8 @@
#include "../util/background.h"
#include "griddatabase.h"
+namespace mongo {
+
static boost::mutex griddb_mutex;
GridDatabase gridDatabase;
DBClientWithCommands *Model::globalConn = gridDatabase.conn;
@@ -143,3 +145,5 @@ void GridDatabase::init() {
l << "ok" << endl;
}
}
+
+} // namespace mongo
diff --git a/dbgrid/griddatabase.h b/dbgrid/griddatabase.h
index 4e88c4b03cc..5b274234d77 100644
--- a/dbgrid/griddatabase.h
+++ b/dbgrid/griddatabase.h
@@ -25,6 +25,8 @@
#include "shard.h"
+namespace mongo {
+
class GridDatabase {
public:
DBClientWithCommands *conn;
@@ -41,3 +43,5 @@ public:
};
extern GridDatabase gridDatabase;
+
+} // namespace mongo
diff --git a/dbgrid/request.cpp b/dbgrid/request.cpp
index 9ae86caafa0..3b13ec2a59e 100644
--- a/dbgrid/request.cpp
+++ b/dbgrid/request.cpp
@@ -41,6 +41,8 @@
#include "../db/dbmessage.h"
#include "../client/connpool.h"
+namespace mongo {
+
const char *tempHost = "localhost:27018";
void getMore(Message& m, MessagingPort& p) {
@@ -129,3 +131,5 @@ void processRequest(Message& m, MessagingPort& p) {
writeOp(op, m, p);
}
}
+
+} // namespace mongo
diff --git a/dbgrid/shard.cpp b/dbgrid/shard.cpp
index 72958c0c289..97aed9e4b20 100644
--- a/dbgrid/shard.cpp
+++ b/dbgrid/shard.cpp
@@ -20,6 +20,8 @@
#include "shard.h"
#include "griddatabase.h"
+namespace mongo {
+
DBClientWithCommands* Shard::conn() {
return gridDatabase.conn;
}
@@ -32,3 +34,5 @@ void Shard::unserialize(BSONObj& from) {
name = from.getStringField("name");
uassert("bad grid.shards.name", !name.empty());
}
+
+} // namespace mongo
diff --git a/dbgrid/shard.h b/dbgrid/shard.h
index 2e49187ea38..00467322452 100644
--- a/dbgrid/shard.h
+++ b/dbgrid/shard.h
@@ -25,6 +25,8 @@
#include "../client/dbclient.h"
#include "../client/model.h"
+namespace mongo {
+
/* grid.shards
{ name: 'hostname'
}
@@ -40,3 +42,5 @@ public:
virtual void unserialize(BSONObj& from);
virtual DBClientWithCommands* conn();
};
+
+} // namespace mongo