Storage Engine API
mongo::WiredTigerSession Class Reference

This is a structure that caches 1 cursor for each uri. More...

#include <wiredtiger_session_cache.h>

Detailed Description

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< WiredTigerCachedCursorCursorCache
 

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
 

Member Typedef Documentation

◆ CursorCache

Constructor & Destructor Documentation

◆ WiredTigerSession() [1/2]

mongo::WiredTigerSession::WiredTigerSession ( WT_CONNECTION *  conn,
uint64_t  epoch = 0,
uint64_t  cursorEpoch = 0 
)

Creates a new WT session on the specified connection.

Parameters
connWT connection
epochIn which session cache cleanup epoch was this session instantiated.
cursorEpochIn which cursor cache cleanup epoch was this session instantiated.

◆ WiredTigerSession() [2/2]

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.

Parameters
connWT connection
cacheThe WiredTigerSessionCache that owns this session.
epochIn which session cache cleanup epoch was this session instantiated.
cursorEpochIn which cursor cache cleanup epoch was this session instantiated.

◆ ~WiredTigerSession()

mongo::WiredTigerSession::~WiredTigerSession ( )

Member Function Documentation

◆ _getCursorEpoch()

uint64_t mongo::WiredTigerSession::_getCursorEpoch ( ) const
inlineprivate

◆ _getEpoch()

uint64_t mongo::WiredTigerSession::_getEpoch ( ) const
inlineprivate

◆ closeAllCursors()

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.

◆ closeCursorsForQueuedDrops()

void mongo::WiredTigerSession::closeCursorsForQueuedDrops ( WiredTigerKVEngine engine)

◆ cursorsOut()

int mongo::WiredTigerSession::cursorsOut ( ) const
inline

◆ dropQueuedIdentsAtSessionEndAllowed()

void mongo::WiredTigerSession::dropQueuedIdentsAtSessionEndAllowed ( bool  dropQueuedIdentsAtSessionEnd)
inline

◆ genTableId()

uint64_t mongo::WiredTigerSession::genTableId ( )
static

◆ getCursor()

WT_CURSOR * mongo::WiredTigerSession::getCursor ( const std::string &  uri,
uint64_t  id,
bool  forRecordStore 
)

◆ getSession()

WT_SESSION* mongo::WiredTigerSession::getSession ( ) const
inline

◆ isDropQueuedIdentsAtSessionEndAllowed()

bool mongo::WiredTigerSession::isDropQueuedIdentsAtSessionEndAllowed ( ) const
inline

◆ releaseCursor()

void mongo::WiredTigerSession::releaseCursor ( uint64_t  id,
WT_CURSOR *  cursor 
)

Friends And Related Function Documentation

◆ WiredTigerSessionCache

friend class WiredTigerSessionCache
friend

Member Data Documentation

◆ _cache

WiredTigerSessionCache* mongo::WiredTigerSession::_cache
private

◆ _cursorEpoch

uint64_t mongo::WiredTigerSession::_cursorEpoch
private

◆ _cursorGen

uint64_t mongo::WiredTigerSession::_cursorGen
private

◆ _cursors

CursorCache mongo::WiredTigerSession::_cursors
private

◆ _cursorsOut

int mongo::WiredTigerSession::_cursorsOut
private

◆ _dropQueuedIdentsAtSessionEnd

bool mongo::WiredTigerSession::_dropQueuedIdentsAtSessionEnd = true
private

◆ _epoch

const uint64_t mongo::WiredTigerSession::_epoch
private

◆ _session

WT_SESSION* mongo::WiredTigerSession::_session
private

◆ kMetadataTableId

const uint64_t mongo::WiredTigerSession::kMetadataTableId = 0
static

For "metadata:" cursors.

Guaranteed never to collide with genTableId() ids.


The documentation for this class was generated from the following files: