#include <file_allocator.h>
Public Member Functions | |
| void | allocateAsap (const string &name, unsigned long long &size) |
| void | requestAllocation (const string &name, long &size) |
| void | start () |
| void | waitUntilFinished () const |
Static Public Member Functions | |
| static void | ensureLength (int fd, long size) |
| static FileAllocator * | get () |
Private Member Functions | |
| void | checkFailure () |
| FileAllocator () | |
| bool | inProgress (const string &name) const |
| long | prevSize (const string &name) const |
Static Private Member Functions | |
| static void | run (FileAllocator *fa) |
Private Attributes | |
| bool | _failed |
| list< string > | _pending |
| mongo::mutex | _pendingMutex |
| map< string, long > | _pendingSize |
| boost::condition | _pendingUpdated |
Static Private Attributes | |
| static FileAllocator * | _instance |
Definition at line 27 of file file_allocator.h.
| mongo::FileAllocator::FileAllocator | ( | ) | [private] |
| void mongo::FileAllocator::allocateAsap | ( | const string & | name, | |
| unsigned long long & | size | |||
| ) |
Returns when file has been allocated. If file exists, size is updated to match existing file size.
| void mongo::FileAllocator::checkFailure | ( | ) | [private] |
| static void mongo::FileAllocator::ensureLength | ( | int | fd, | |
| long | size | |||
| ) | [static] |
| static FileAllocator* mongo::FileAllocator::get | ( | ) | [static] |
| bool mongo::FileAllocator::inProgress | ( | const string & | name | ) | const [private] |
| long mongo::FileAllocator::prevSize | ( | const string & | name | ) | const [private] |
| void mongo::FileAllocator::requestAllocation | ( | const string & | name, | |
| long & | size | |||
| ) |
May be called if file exists. If file exists, or its allocation has been requested, size is updated to match existing file size.
| static void mongo::FileAllocator::run | ( | FileAllocator * | fa | ) | [static, private] |
called from the worked thread
| void mongo::FileAllocator::start | ( | ) |
| void mongo::FileAllocator::waitUntilFinished | ( | ) | const |
bool mongo::FileAllocator::_failed [private] |
Definition at line 79 of file file_allocator.h.
FileAllocator* mongo::FileAllocator::_instance [static, private] |
Definition at line 82 of file file_allocator.h.
list< string > mongo::FileAllocator::_pending [private] |
Definition at line 76 of file file_allocator.h.
mongo::mutex mongo::FileAllocator::_pendingMutex [mutable, private] |
Definition at line 73 of file file_allocator.h.
map< string, long > mongo::FileAllocator::_pendingSize [mutable, private] |
Definition at line 77 of file file_allocator.h.
boost::condition mongo::FileAllocator::_pendingUpdated [mutable, private] |
Definition at line 74 of file file_allocator.h.