summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-05-28 15:22:24 -0400
committerAaron <aaron@10gen.com>2009-05-28 15:22:24 -0400
commit6a2a8d385f70db58e864b424aa43643822d04f84 (patch)
tree2485450b9225e05b9aaab3250bead43b549df4e4
parent0c2ab274ee2be1aadc0e616bb54a08545c3aa97e (diff)
downloadmongo-6a2a8d385f70db58e864b424aa43643822d04f84.tar.gz
comments MINOR
-rw-r--r--db/clientcursor.h1
-rw-r--r--db/cursor.h1
-rw-r--r--db/dbhelpers.h1
-rw-r--r--db/jsobj.h2
-rw-r--r--db/pdfile.h3
-rw-r--r--db/query.cpp1
-rw-r--r--db/queryoptimizer.h2
-rw-r--r--db/queryutil.h6
-rw-r--r--db/repl.h7
-rw-r--r--dbtests/dbtests.h1
-rw-r--r--util/file_allocator.h3
-rw-r--r--util/log.h4
-rw-r--r--util/top.h1
13 files changed, 29 insertions, 4 deletions
diff --git a/db/clientcursor.h b/db/clientcursor.h
index e2b31bfa250..5e9158b0ea0 100644
--- a/db/clientcursor.h
+++ b/db/clientcursor.h
@@ -42,6 +42,7 @@ namespace mongo {
extern BSONObj id_obj;
+ // utility class for de duping ids
class IdSet {
public:
IdSet() : mySize_(), inMem_( true ) {}
diff --git a/db/cursor.h b/db/cursor.h
index 68214cd251d..84c8527171b 100644
--- a/db/cursor.h
+++ b/db/cursor.h
@@ -106,6 +106,7 @@ namespace mongo {
virtual bool capped() const { return false; }
};
+ // strategy object implementing direction of traversal.
class AdvanceStrategy {
public:
virtual ~AdvanceStrategy() {}
diff --git a/db/dbhelpers.h b/db/dbhelpers.h
index d52790f421b..f9ee2246098 100644
--- a/db/dbhelpers.h
+++ b/db/dbhelpers.h
@@ -88,6 +88,7 @@ namespace mongo {
}
};
+ // manage a set using collection backed storage
class DbSet {
public:
DbSet( const string &name = "", const BSONObj &key = BSONObj() ) :
diff --git a/db/jsobj.h b/db/jsobj.h
index f8bba08be0c..3a18456937b 100644
--- a/db/jsobj.h
+++ b/db/jsobj.h
@@ -798,6 +798,7 @@ namespace mongo {
*/
#define BSON(x) (( BSONObjBuilder() << x ).obj())
+ // Utility class to implement GT, GTE, etc as described above.
class Labeler {
public:
struct Label {
@@ -826,6 +827,7 @@ namespace mongo {
extern Labeler::Label NE;
extern Labeler::Label SIZE;
+ // Utility class to implement BSON( key << val ) as described above.
class BSONObjBuilderValueStream : public boost::noncopyable {
public:
friend class Labeler;
diff --git a/db/pdfile.h b/db/pdfile.h
index 9a7938b6a0c..af15264af24 100644
--- a/db/pdfile.h
+++ b/db/pdfile.h
@@ -364,9 +364,12 @@ namespace mongo {
namespace mongo {
+ // Heritable class to implement an operation that may be applied to all
+ // files in a database using _applyOpToDataFiles()
class FileOp {
public:
virtual ~FileOp() {}
+ // Return true if file exists and operation successful
virtual bool apply( const boost::filesystem::path &p ) = 0;
virtual const char * op() const = 0;
};
diff --git a/db/query.cpp b/db/query.cpp
index ae61980f18f..a6710657713 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -166,6 +166,7 @@ namespace mongo {
return nDeleted;
}
+ // utility class for assembling hierarchical objects
class EmbeddedBuilder {
public:
EmbeddedBuilder( BSONObjBuilder *b ) {
diff --git a/db/queryoptimizer.h b/db/queryoptimizer.h
index 2c695fa203f..b10657e54cd 100644
--- a/db/queryoptimizer.h
+++ b/db/queryoptimizer.h
@@ -99,6 +99,8 @@ namespace mongo {
bool error_;
};
+ // Set of candidate query plans for a particular query. Used for running
+ // a QueryOp on these plans.
class QueryPlanSet {
public:
QueryPlanSet( const char *ns,
diff --git a/db/queryutil.h b/db/queryutil.h
index 21bb20638fc..5c509da8397 100644
--- a/db/queryutil.h
+++ b/db/queryutil.h
@@ -22,6 +22,8 @@
namespace mongo {
+ // bounds on a field's value that may be determined from query -- used to
+ // determine index limits
class FieldBound {
public:
FieldBound( const BSONElement &e = BSONObj().firstElement() );
@@ -51,6 +53,8 @@ namespace mongo {
vector< BSONObj > objData_;
};
+ // implements query pattern matching, used to determine if a query is
+ // similar to an earlier query and should use the same plan
class QueryPattern {
public:
friend class FieldBoundSet;
@@ -114,6 +118,8 @@ namespace mongo {
BSONObj sort_;
};
+ // bounds on fields' value that may be determined from query -- used to
+ // determine index limits
class FieldBoundSet {
public:
FieldBoundSet( const char *ns, const BSONObj &query );
diff --git a/db/repl.h b/db/repl.h
index 272bdeb80b5..44bc9b1fa17 100644
--- a/db/repl.h
+++ b/db/repl.h
@@ -149,6 +149,7 @@ namespace mongo {
void _logOp(const char *opstr, const char *ns, const char *logNs, const BSONObj& obj, BSONObj *patt, bool *b, const OpTime &ts);
void logOp(const char *opstr, const char *ns, const BSONObj& obj, BSONObj *patt = 0, bool *b = 0);
+ // class for managing a set of ids in memory
class MemIds {
public:
MemIds() : size_() {}
@@ -174,7 +175,8 @@ namespace mongo {
IdSets imp_;
long long size_;
};
-
+
+ // class for managing a set of ids in a db collection
// All functions must be called with db mutex held
class DbIds {
public:
@@ -198,7 +200,8 @@ namespace mongo {
}
DbSet impl_;
};
-
+
+ // class for tracking ids and mod ids, in memory or on disk
// All functions must be called with db mutex held
// Kind of sloppy class structure, for now just want to keep the in mem
// version speedy.
diff --git a/dbtests/dbtests.h b/dbtests/dbtests.h
index ec32b0e77b7..113fb2c9077 100644
--- a/dbtests/dbtests.h
+++ b/dbtests/dbtests.h
@@ -21,6 +21,7 @@
using namespace mongo;
+// Utility class to handle per suite cleanup
class Suite : public UnitTest::Suite {
public:
~Suite();
diff --git a/util/file_allocator.h b/util/file_allocator.h
index 10bb4e4e67f..7430a2444a2 100644
--- a/util/file_allocator.h
+++ b/util/file_allocator.h
@@ -26,7 +26,8 @@
#endif
namespace mongo {
- // Handles allocation of contiguous files on disk.
+ // Handles allocation of contiguous files on disk. Allocation may be
+ // requested asynchronously or synchronously.
class FileAllocator {
// The public functions may not be called concurrently. The allocation
// functions may be called multiple times per file, but only the first
diff --git a/util/log.h b/util/log.h
index 96fba916ec4..5f8d7589f87 100644
--- a/util/log.h
+++ b/util/log.h
@@ -20,12 +20,14 @@
namespace mongo {
+ // Utility interface for stringifying object only when val() called.
class LazyString {
public:
virtual ~LazyString() {}
virtual string val() const = 0;
};
-
+
+ // Utility class for stringifying object only when val() called.
template< class T >
class LazyStringImpl : public LazyString {
public:
diff --git a/util/top.h b/util/top.h
index f2802ca0418..15862cf37bc 100644
--- a/util/top.h
+++ b/util/top.h
@@ -19,6 +19,7 @@
namespace mongo {
+// Records per namespace utilization of the mongod process.
// No two functions of this class may be called concurrently.
class Top {
public: