diff options
author | dwight <dwight@10gen.com> | 2010-07-23 23:20:00 -0400 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2010-07-23 23:20:00 -0400 |
commit | 53d5215cc65f5fcdcd1c9d4d8a2197007b9e6520 (patch) | |
tree | 74e376959a278248da82dd832f3960c1c8b9f133 /db/namespace.h | |
parent | 829d907ff889e6551c802b43254091eecdb4af16 (diff) | |
download | mongo-53d5215cc65f5fcdcd1c9d4d8a2197007b9e6520.tar.gz |
separate file for capped code
Diffstat (limited to 'db/namespace.h')
-rw-r--r-- | db/namespace.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/db/namespace.h b/db/namespace.h index d04aafcd6d1..c19fe0a5297 100644 --- a/db/namespace.h +++ b/db/namespace.h @@ -254,7 +254,7 @@ namespace mongo { IndexDetails _indexes[NIndexesBase]; public: int capped; - int max; // max # of objects for a capped table. + int max; // max # of objects for a capped table. TODO: should this be 64 bit? double paddingFactor; // 1.0 = no padding. int flags; DiskLoc capExtent; @@ -438,7 +438,7 @@ namespace mongo { DiskLoc lastRecord( const DiskLoc &startExtent = DiskLoc() ) const; bool inCapExtent( const DiskLoc &dl ) const; - void checkMigrate(); + void cappedCheckMigrate(); long long storageSize( int * numExtents = 0 ); private: @@ -453,6 +453,7 @@ namespace mongo { DiskLoc __stdAlloc(int len); DiskLoc __capAlloc(int len); DiskLoc _alloc(const char *ns, int len); + DiskLoc cappedAlloc(const char *ns, int len); // capped collections void compact(); // combine adjacent deleted records DiskLoc &firstDeletedInCapExtent(); bool nextIsInCapExtent( const DiskLoc &dl ) const; @@ -606,8 +607,8 @@ namespace mongo { return 0; Namespace n(ns); NamespaceDetails *d = ht->get(n); - if ( d ) - d->checkMigrate(); + if ( d && d->capped ) + d->cappedCheckMigrate(); return d; } |