Zero  0.1.0
Public Member Functions | Private Member Functions | List of all members
stnode_cache_t Class Reference

Store creation/destroy/query interface. More...

#include <stnode_page.h>

Public Member Functions

 stnode_cache_t (bool virgin)
 
PageID get_root_pid (StoreID store) const
 
lsn_t get_root_elmsn (StoreID store) const
 
bool is_allocated (StoreID store) const
 
stnode_t get_stnode (StoreID store) const
 Make a copy of the entire stnode_t of the given store. More...
 
void get_used_stores (std::vector< StoreID > &) const
 Returns the StoreID of all allocated stores in the volume. More...
 
rc_t sx_create_store (PageID root_pid, StoreID &snum) const
 
rc_t sx_append_extent (StoreID store, extent_id_t ext) const
 
void dump (std::ostream &out) const
 
extent_id_t get_last_extent (StoreID stid) const
 

Private Member Functions

StoreID get_min_unused_stid (stnode_page *spage) const
 

Detailed Description

Store creation/destroy/query interface.

This object handles store create/destroy/query requests for one volume. 99.99% of the requests are, of course, querying the root page ID of indexes. This object does a lightweight synchronization (latch) to protect them from MT accesses. However, this object doesn't use locks because we don't need them. If the store is being destroyed, ss_m will check intent locks before calling this object, so we are safe.

This object and vol_t replace the "directory" thingies in original Shore-MT with more efficiency and simplicity.

Constructor & Destructor Documentation

§ stnode_cache_t()

stnode_cache_t::stnode_cache_t ( bool  virgin)

Member Function Documentation

§ dump()

void stnode_cache_t::dump ( std::ostream &  out) const

§ get_last_extent()

extent_id_t stnode_cache_t::get_last_extent ( StoreID  stid) const

§ get_min_unused_stid()

StoreID stnode_cache_t::get_min_unused_stid ( stnode_page spage) const
private

Returns the first StoreID that can be used for a new store in this volume or stnode_page::max if all available stores of this volume are already allocated.

§ get_root_elmsn()

lsn_t stnode_cache_t::get_root_elmsn ( StoreID  store) const

§ get_root_pid()

PageID stnode_cache_t::get_root_pid ( StoreID  store) const

Returns the root page ID of the given store. If that store isn't allocated, returns 0.

Parameters
[in]storeStore ID.

§ get_stnode()

stnode_t stnode_cache_t::get_stnode ( StoreID  store) const

Make a copy of the entire stnode_t of the given store.

§ get_used_stores()

void stnode_cache_t::get_used_stores ( std::vector< StoreID > &  ret) const

Returns the StoreID of all allocated stores in the volume.

§ is_allocated()

bool stnode_cache_t::is_allocated ( StoreID  store) const

§ sx_append_extent()

rc_t stnode_cache_t::sx_append_extent ( StoreID  store,
extent_id_t  ext 
) const

§ sx_create_store()

rc_t stnode_cache_t::sx_create_store ( PageID  root_pid,
StoreID snum 
) const

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