Zero  0.1.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
lockid_t Class Reference

The means of identifying a desired or held lock. More...

#include <lock_s.h>

Public Member Functions

bool operator< (lockid_t const &p) const
 comparison operator for lockid_t, used by lock manager More...
 
bool operator== (const lockid_t &p) const
 equality operator for lockid_t More...
 
bool operator!= (const lockid_t &p) const
 inequality operator for lockid_t More...
 
uint32_t hash () const
 Used by lock cache. More...
 
void zero ()
 clear out the lockid - initialize to mean nothing More...
 
StoreID store () const
 extract store number lockid whose lspace() == t_store or has parent with lspace() == t_store More...
 
 lockid_t ()
 
 lockid_t (StoreID stid, const unsigned char *keystr, int16_t keylen)
 construct from key string in an index More...
 
 lockid_t (StoreID stid, const w_keystr_t &key)
 construct from key string in an index More...
 
 lockid_t (const lockid_t &i)
 copy constructor More...
 
lockid_toperator= (const lockid_t &i)
 copy operator More...
 

Private Member Functions

void set_store (StoreID s)
 
void _init_for_str (StoreID stid, const unsigned char *keystr, int16_t keylen)
 
uint64_t hash64 (uint32_t seed, const unsigned char *str, int16_t len)
 

Private Attributes

union {
   uint64_t   l [2]
 
   uint32_t   w [4]
 
}; 
 

Friends

ostream & operator<< (ostream &o, const lockid_t &i)
 

Detailed Description

The means of identifying a desired or held lock.

Lock manager requests (acquire, release, query) take an argument of this kind to identify the entity to be locked.

Currently, we have only lockid_t made from key. No other lock type exists in the main lock table. For intent locks, we use LIL (light-weight intent lock) which are separated from the main lock table. So, this object is drastically simplified from original Shore-MT.

Constructor & Destructor Documentation

§ lockid_t() [1/4]

lockid_t::lockid_t ( )
inline

§ lockid_t() [2/4]

lockid_t::lockid_t ( StoreID  stid,
const unsigned char *  keystr,
int16_t  keylen 
)
inline

construct from key string in an index

§ lockid_t() [3/4]

lockid_t::lockid_t ( StoreID  stid,
const w_keystr_t key 
)
inline

construct from key string in an index

§ lockid_t() [4/4]

lockid_t::lockid_t ( const lockid_t i)
inline

copy constructor

Member Function Documentation

§ _init_for_str()

void lockid_t::_init_for_str ( StoreID  stid,
const unsigned char *  keystr,
int16_t  keylen 
)
inlineprivate

§ hash()

uint32_t lockid_t::hash ( ) const
inline

Used by lock cache.

§ hash64()

uint64_t lockid_t::hash64 ( uint32_t  seed,
const unsigned char *  str,
int16_t  len 
)
inlineprivate

§ operator!=()

bool lockid_t::operator!= ( const lockid_t p) const
inline

inequality operator for lockid_t

§ operator<()

bool lockid_t::operator< ( lockid_t const &  p) const
inline

comparison operator for lockid_t, used by lock manager

§ operator=()

lockid_t & lockid_t::operator= ( const lockid_t i)
inline

copy operator

§ operator==()

bool lockid_t::operator== ( const lockid_t p) const
inline

equality operator for lockid_t

§ set_store()

void lockid_t::set_store ( StoreID  s)
inlineprivate

§ store()

StoreID lockid_t::store ( ) const
inline

extract store number lockid whose lspace() == t_store or has parent with lspace() == t_store

§ zero()

void lockid_t::zero ( )
inline

clear out the lockid - initialize to mean nothing

Friends And Related Function Documentation

§ operator<<

ostream& operator<< ( ostream &  o,
const lockid_t i 
)
friend

Member Data Documentation

§ @29

union { ... }

l and w are for convenience w[0] == vol w[1] == store w[2,3]== l[1] == key (its hash)

§ l

uint64_t lockid_t::l[2]

§ w

uint32_t lockid_t::w[4]

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