0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

get rid of clientIsEmpty() and add isEmpty() to Datbase

This commit is contained in:
Eliot Horowitz 2010-01-14 13:17:32 -05:00
parent c0a2b97769
commit 718ec488d5
4 changed files with 7 additions and 7 deletions

View File

@ -66,6 +66,10 @@ namespace mongo {
delete files[i];
}
bool isEmpty(){
return ! namespaceIndex.allocated();
}
bool exists(int n) {
stringstream ss;
ss << name << '.' << n;

View File

@ -162,10 +162,6 @@ namespace mongo {
// does not delete the files on disk
void closeDatabase( const char *cl, const string& path = dbpath );
inline bool clientIsEmpty() {
return !cc().database()->namespaceIndex.allocated();
}
struct dbtemprelease {
string clientname;
string clientpath;

View File

@ -714,7 +714,7 @@ namespace mongo {
boost::intmax_t size = dbSize( i->c_str() );
b.append( "sizeOnDisk", (double) size );
setClient( i->c_str() );
b.appendBool( "empty", clientIsEmpty() );
b.appendBool( "empty", cc().database()->isEmpty() );
totalSize += size;
dbInfos.push_back( b.obj() );
@ -733,7 +733,7 @@ namespace mongo {
BSONObjBuilder b;
b << "name" << name << "sizeOnDisk" << double( 1 );
setClient( name.c_str() );
b.appendBool( "empty", clientIsEmpty() );
b.appendBool( "empty", cc().database()->isEmpty() );
dbInfos.push_back( b.obj() );
}

View File

@ -873,7 +873,7 @@ namespace mongo {
return;
}
bool empty = clientIsEmpty();
bool empty = cc().database()->isEmpty();
bool incompleteClone = incompleteCloneDbs.count( clientName ) != 0;
log( 6 ) << "ns: " << ns << ", justCreated: " << justCreated << ", empty: " << empty << ", incompleteClone: " << incompleteClone << endl;