![]() |
Storage Engine API
|
This is a structure that caches 1 cursor for each uri. More...
#include <wiredtiger_session_cache.h>
This is a structure that caches 1 cursor for each uri.
The idea is that there is a pool of these somewhere. NOT THREADSAFE
Public Member Functions | |
WiredTigerSession (WT_CONNECTION *conn, uint64_t epoch=0, uint64_t cursorEpoch=0) | |
Creates a new WT session on the specified connection. More... | |
WiredTigerSession (WT_CONNECTION *conn, WiredTigerSessionCache *cache, uint64_t epoch=0, uint64_t cursorEpoch=0) | |
Creates a new WT session on the specified connection. More... | |
~WiredTigerSession () | |
WT_SESSION * | getSession () const |
WT_CURSOR * | getCursor (const std::string &uri, uint64_t id, bool forRecordStore) |
void | releaseCursor (uint64_t id, WT_CURSOR *cursor) |
void | closeCursorsForQueuedDrops (WiredTigerKVEngine *engine) |
void | closeAllCursors (const std::string &uri) |
Closes all cached cursors matching the uri. More... | |
int | cursorsOut () const |
bool | isDropQueuedIdentsAtSessionEndAllowed () const |
void | dropQueuedIdentsAtSessionEndAllowed (bool dropQueuedIdentsAtSessionEnd) |
Static Public Member Functions | |
static uint64_t | genTableId () |
Static Public Attributes | |
static const uint64_t | kMetadataTableId = 0 |
For "metadata:" cursors. More... | |
Private Types | |
typedef std::list< WiredTigerCachedCursor > | CursorCache |
Private Member Functions | |
uint64_t | _getEpoch () const |
uint64_t | _getCursorEpoch () const |
Private Attributes | |
const uint64_t | _epoch |
uint64_t | _cursorEpoch |
WiredTigerSessionCache * | _cache |
WT_SESSION * | _session |
CursorCache | _cursors |
uint64_t | _cursorGen |
int | _cursorsOut |
bool | _dropQueuedIdentsAtSessionEnd = true |
Friends | |
class | WiredTigerSessionCache |
|
private |
mongo::WiredTigerSession::WiredTigerSession | ( | WT_CONNECTION * | conn, |
uint64_t | epoch = 0 , |
||
uint64_t | cursorEpoch = 0 |
||
) |
Creates a new WT session on the specified connection.
conn | WT connection |
epoch | In which session cache cleanup epoch was this session instantiated. |
cursorEpoch | In which cursor cache cleanup epoch was this session instantiated. |
mongo::WiredTigerSession::WiredTigerSession | ( | WT_CONNECTION * | conn, |
WiredTigerSessionCache * | cache, | ||
uint64_t | epoch = 0 , |
||
uint64_t | cursorEpoch = 0 |
||
) |
Creates a new WT session on the specified connection.
conn | WT connection |
cache | The WiredTigerSessionCache that owns this session. |
epoch | In which session cache cleanup epoch was this session instantiated. |
cursorEpoch | In which cursor cache cleanup epoch was this session instantiated. |
mongo::WiredTigerSession::~WiredTigerSession | ( | ) |
|
inlineprivate |
|
inlineprivate |
void mongo::WiredTigerSession::closeAllCursors | ( | const std::string & | uri | ) |
Closes all cached cursors matching the uri.
If the uri is empty, all cached cursors are closed.
void mongo::WiredTigerSession::closeCursorsForQueuedDrops | ( | WiredTigerKVEngine * | engine | ) |
|
inline |
|
inline |
|
static |
WT_CURSOR * mongo::WiredTigerSession::getCursor | ( | const std::string & | uri, |
uint64_t | id, | ||
bool | forRecordStore | ||
) |
|
inline |
|
inline |
void mongo::WiredTigerSession::releaseCursor | ( | uint64_t | id, |
WT_CURSOR * | cursor | ||
) |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
For "metadata:" cursors.
Guaranteed never to collide with genTableId() ids.