Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
cat::bombay::Table Class Reference

#include <BombayTable.hpp>

Inheritance diagram for cat::bombay::Table:

List of all members.

Public Member Functions

CAT_INLINE u32 GetCacheBytes ()
CAT_INLINE u32 GetRecordBytes ()
bool Initialize ()
u64 Insert (void *data)
template<class THashFunc >
CAT_INLINE TableIndexMakeIndex (const char *index_file_path, bool unique)
bool Query (u64 offset, AsyncBuffer *buffer)
bool Remove (u64 offset)
bool RequestIndexRebuild (TableIndex *index)
 Table (const char *file_path, u32 record_bytes, u32 cache_bytes, ShutdownObserver *shutdown_observer)
bool Update (void *data, u64 offset)
virtual ~Table ()

Protected Member Functions

bool AllocateCache ()
CacheNodeFindNode (u64 offset)
void FreeCache ()
void InsertNode (u64 offset, u32 key, CacheNode *hint, CacheNode *node)
u8InsertOffset (u64 offset)
void OnIndexingDone ()
virtual bool OnIndexingRead (ThreadPoolLocalStorage *tls, int error, AsyncBuffer *buffer, u32 bytes)
virtual bool OnQueryRead (ThreadPoolLocalStorage *tls, int error, AsyncBuffer *buffer, u32 bytes)
virtual bool OnRemoveRead (ThreadPoolLocalStorage *tls, int error, AsyncBuffer *buffer, u32 bytes)
u8PeekOffset (u64 offset)
bool RemoveOffset (u64 offset)
u8SetOffset (u64 offset)
bool StartIndexing ()
bool StartIndexingRead ()
void UnlinkNode (CacheNode *node)

Protected Attributes

u8_cache
u32 _cache_bytes
bool _cache_full
CacheNode ** _cache_hash_table
u32 _hash_table_size
TableIndex_head_index
TableIndex_head_index_unique
TableIndex_head_index_update
TableIndex_head_index_waiting
u64 _index_database_size
u64 _index_read_completed
u64 _index_read_offset
u32 _index_read_size
RWLock _lock
u32 _next_cache_slot

Static Protected Attributes

static const u32 MAX_INDEX_READ_SIZE = 32768
static const u32 MIN_TABLE_SIZE = 2048
static const int NUM_PARALLEL_INDEX_READS = 3
static const u32 TARGET_TREE_SIZE = 16

Private Member Functions

TableIndexMakeIndex (const char *index_file_path, IHash *hash_function, bool unique)
u64 UniqueIndexLookup (const void *data)

Private Attributes

u64 _next_record
u32 _record_bytes
ShutdownObserver_shutdown_observer

Detailed Description

Definition at line 72 of file BombayTable.hpp.


Constructor & Destructor Documentation

cat::bombay::Table::Table ( const char *  file_path,
u32  record_bytes,
u32  cache_bytes,
ShutdownObserver shutdown_observer 
)
virtual cat::bombay::Table::~Table ( ) [virtual]

Member Function Documentation

bool cat::bombay::Table::AllocateCache ( ) [protected]
CacheNode* cat::bombay::Table::FindNode ( u64  offset) [protected]
void cat::bombay::Table::FreeCache ( ) [protected]
CAT_INLINE u32 cat::bombay::Table::GetCacheBytes ( ) [inline]

Definition at line 134 of file BombayTable.hpp.

References _cache_bytes.

{ return _cache_bytes; }
CAT_INLINE u32 cat::bombay::Table::GetRecordBytes ( ) [inline]

Definition at line 135 of file BombayTable.hpp.

References _record_bytes.

{ return _record_bytes; }
bool cat::bombay::Table::Initialize ( )
u64 cat::bombay::Table::Insert ( void *  data)
void cat::bombay::Table::InsertNode ( u64  offset,
u32  key,
CacheNode hint,
CacheNode node 
) [protected]
u8* cat::bombay::Table::InsertOffset ( u64  offset) [protected]
TableIndex* cat::bombay::Table::MakeIndex ( const char *  index_file_path,
IHash hash_function,
bool  unique 
) [private]

Referenced by MakeIndex().

template<class THashFunc >
CAT_INLINE TableIndex* cat::bombay::Table::MakeIndex ( const char *  index_file_path,
bool  unique 
) [inline]

Definition at line 126 of file BombayTable.hpp.

References MakeIndex().

    {
        return MakeIndex(index_file_path, new THashFunc, unique);
    }
void cat::bombay::Table::OnIndexingDone ( ) [protected]
virtual bool cat::bombay::Table::OnIndexingRead ( ThreadPoolLocalStorage tls,
int  error,
AsyncBuffer buffer,
u32  bytes 
) [protected, virtual]
virtual bool cat::bombay::Table::OnQueryRead ( ThreadPoolLocalStorage tls,
int  error,
AsyncBuffer buffer,
u32  bytes 
) [protected, virtual]
virtual bool cat::bombay::Table::OnRemoveRead ( ThreadPoolLocalStorage tls,
int  error,
AsyncBuffer buffer,
u32  bytes 
) [protected, virtual]
u8* cat::bombay::Table::PeekOffset ( u64  offset) [protected]
bool cat::bombay::Table::Query ( u64  offset,
AsyncBuffer buffer 
)
bool cat::bombay::Table::Remove ( u64  offset)
bool cat::bombay::Table::RemoveOffset ( u64  offset) [protected]
bool cat::bombay::Table::RequestIndexRebuild ( TableIndex index)
u8* cat::bombay::Table::SetOffset ( u64  offset) [protected]
bool cat::bombay::Table::StartIndexing ( ) [protected]
bool cat::bombay::Table::StartIndexingRead ( ) [protected]
u64 cat::bombay::Table::UniqueIndexLookup ( const void *  data) [private]
void cat::bombay::Table::UnlinkNode ( CacheNode node) [protected]
bool cat::bombay::Table::Update ( void *  data,
u64  offset 
)

Member Data Documentation

Definition at line 93 of file BombayTable.hpp.

Definition at line 94 of file BombayTable.hpp.

Referenced by GetCacheBytes().

Definition at line 96 of file BombayTable.hpp.

Definition at line 91 of file BombayTable.hpp.

Definition at line 90 of file BombayTable.hpp.

Definition at line 98 of file BombayTable.hpp.

Definition at line 98 of file BombayTable.hpp.

Definition at line 99 of file BombayTable.hpp.

Definition at line 99 of file BombayTable.hpp.

Definition at line 81 of file BombayTable.hpp.

Definition at line 81 of file BombayTable.hpp.

Definition at line 81 of file BombayTable.hpp.

Definition at line 82 of file BombayTable.hpp.

Definition at line 79 of file BombayTable.hpp.

Definition at line 95 of file BombayTable.hpp.

Definition at line 76 of file BombayTable.hpp.

Definition at line 75 of file BombayTable.hpp.

Referenced by GetRecordBytes().

Definition at line 74 of file BombayTable.hpp.

const u32 cat::bombay::Table::MAX_INDEX_READ_SIZE = 32768 [static, protected]

Definition at line 83 of file BombayTable.hpp.

const u32 cat::bombay::Table::MIN_TABLE_SIZE = 2048 [static, protected]

Definition at line 88 of file BombayTable.hpp.

const int cat::bombay::Table::NUM_PARALLEL_INDEX_READS = 3 [static, protected]

Definition at line 84 of file BombayTable.hpp.

const u32 cat::bombay::Table::TARGET_TREE_SIZE = 16 [static, protected]

Definition at line 87 of file BombayTable.hpp.


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

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net