mongo::Database Class Reference

#include <database.h>

List of all members.

Public Member Functions

MongoDataFileaddAFile (int sizeNeeded, bool preallocateNextFile)
ExtentallocExtent (const char *ns, int size, bool capped)
 Database (const char *nm, bool &newDb, const string &_path=dbpath)
bool exists (int n) const
boost::filesystem::path fileName (int n) const
long long fileSize () const
void finishInit ()
void flushFiles (bool sync) const
MongoDataFilegetFile (int n, int sizeNeeded=0, bool preallocateOnly=false)
bool isEmpty ()
bool isOk () const
MongoDataFilenewestFile ()
int numFiles () const
void openAllFiles ()
bool ownsNS (const string &ns) const
void preallocateAFile ()
bool setProfilingLevel (int newLevel, string &errmsg)
MongoDataFilesuitableFile (int sizeNeeded, bool preallocate)

Static Public Member Functions

static void closeDatabase (const char *db, const string &path)
static bool validDBName (const string &ns)

Public Attributes

CCByLoc ccByLoc
vector< MongoDataFile * > files
int magic
const string name
NamespaceIndex namespaceIndex
const string path
int profile
const string profileName

Static Public Attributes

static bool _openAllFiles

Private Member Functions

 ~Database ()

Detailed Description

Database represents a database database Each database database has its own set of files -- dbname.ns, dbname.0, dbname.1, ... NOT memory mapped

Definition at line 34 of file database.h.


Constructor & Destructor Documentation

mongo::Database::Database ( const char *  nm,
bool &  newDb,
const string &  _path = dbpath 
)
mongo::Database::~Database (  )  [private]

Member Function Documentation

MongoDataFile* mongo::Database::addAFile ( int  sizeNeeded,
bool  preallocateNextFile 
)
Extent* mongo::Database::allocExtent ( const char *  ns,
int  size,
bool  capped 
)
static void mongo::Database::closeDatabase ( const char *  db,
const string &  path 
) [static]
bool mongo::Database::exists ( int  n  )  const [inline]

Definition at line 70 of file database.h.

boost::filesystem::path mongo::Database::fileName ( int  n  )  const

returns file valid for file number n

long long mongo::Database::fileSize (  )  const

total file size of Database in bytes

void mongo::Database::finishInit (  ) 
void mongo::Database::flushFiles ( bool  sync  )  const
MongoDataFile* mongo::Database::getFile ( int  n,
int  sizeNeeded = 0,
bool  preallocateOnly = false 
)

return file n. if it doesn't exist, create it

bool mongo::Database::isEmpty (  )  [inline]

Definition at line 56 of file database.h.

bool mongo::Database::isOk (  )  const [inline]

tries to make sure that this hasn't been deleted

Definition at line 54 of file database.h.

MongoDataFile* mongo::Database::newestFile (  ) 
int mongo::Database::numFiles (  )  const [inline]

Definition at line 63 of file database.h.

void mongo::Database::openAllFiles (  ) 
bool mongo::Database::ownsNS ( const string &  ns  )  const [inline]
Returns:
true if ns is part of the database ns=foo.bar, db=foo returns true

Definition at line 103 of file database.h.

void mongo::Database::preallocateAFile (  )  [inline]

makes sure we have an extra file at the end that is empty safe to call this multiple times - the implementation will only preallocate one file

Definition at line 83 of file database.h.

bool mongo::Database::setProfilingLevel ( int  newLevel,
string &  errmsg 
)
Returns:
true if success. false if bad level or error creating profile ns
MongoDataFile* mongo::Database::suitableFile ( int  sizeNeeded,
bool  preallocate 
)
static bool mongo::Database::validDBName ( const string &  ns  )  [static]

Member Data Documentation

Definition at line 36 of file database.h.

Definition at line 119 of file database.h.

Definition at line 113 of file database.h.

Definition at line 120 of file database.h.

const string mongo::Database::name

Definition at line 114 of file database.h.

Definition at line 116 of file database.h.

const string mongo::Database::path

Definition at line 115 of file database.h.

Definition at line 117 of file database.h.

Definition at line 118 of file database.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:54 2013