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:
parent
c0a2b97769
commit
718ec488d5
@ -66,6 +66,10 @@ namespace mongo {
|
||||
delete files[i];
|
||||
}
|
||||
|
||||
bool isEmpty(){
|
||||
return ! namespaceIndex.allocated();
|
||||
}
|
||||
|
||||
bool exists(int n) {
|
||||
stringstream ss;
|
||||
ss << name << '.' << n;
|
||||
|
4
db/db.h
4
db/db.h
@ -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;
|
||||
|
@ -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() );
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user