127 bool construct_cache =
true)
128 : _ptable(aTableDesc) {
130 if (construct_cache) {
132 _pts =
new blob_pool(_ptable->maxsize());
189 assert (_ptable && _ptable->primary_idx());
190 return (
index_probe(db, _ptable->primary_idx(), ptuple, lock_mode, root));
195 const char* idx_name,
200 return (
index_probe(db, pindex, ptuple, lock_mode, root));
205 const char* idx_name,
215 const char* idx_name,
230 const PageID& primary_root = 0);
233 const char* idx_name,
236 const PageID& primary_root = 0);
241 const PageID& primary_root = 0);
244 const char* idx_name,
247 const PageID& primary_root = 0);
300 unsigned int num_lines = 0,
bool need_tuple =
false);
340 return (_pcache->borrow());
344 _pcache->giveback(ptt);
348 #define DEFINE_ROW_CACHE_TLS(bench, table) \ 349 DECLARE_TLS(row_cache_t<bench::table##_t>, bench##_##table##_cache); \ 350 template<> row_cache_t<bench::table##_t>* \ 351 table_man_t<bench::table##_t>::pcache_link::tls_get() \ 352 { return bench##_##table##_cache; } 354 #if 0 // CS: disabled for now -- should be moved to other file anyway 364 class table_printer_t :
public thread_t 373 table_printer_t(
ShoreEnv* _env,
int lines);
393 class table_fetcher_t :
public thread_t 408 #endif // __TABLE_MAN_H
blob_pool * ts()
Definition: table_man.h:151
w_rc_t add_index_entry(ss_m *db, const char *idx_name, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::X, const PageID &primary_root=0)
Definition: table_man.cpp:223
virtual w_rc_t print_table(ostream &os, unsigned int num_lines=0)
Definition: table_man.cpp:469
const w_rc_t RCOK
Definition: w_rc.h:239
T * table()
Definition: table_man.h:140
Definition: row_cache.h:41
static row_cache_t< T > * tls_get()
virtual w_rc_t fetch_table(ss_m *db, lock_mode_t alm=okvl_mode::S)
Definition: table_man.cpp:550
w_rc_t add_tuple(ss_m *db, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::X, const PageID &primary_root=0)
Definition: table_man.cpp:166
T * _ptable
Definition: table_man.h:120
: Description of an index.
w_rc_t index_probe_by_name(ss_m *db, const char *idx_name, table_row_t *ptuple, lock_mode_t lock_mode=okvl_mode::S, const PageID &root=0)
Definition: table_man.h:194
Definition: kits_thread.h:134
w_rc_t update_tuple(ss_m *db, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::X)
Definition: table_man.cpp:381
element_lock_mode
Lock mode for one OKVL component (key, partition, or gap).
Definition: w_okvl.h:107
: Base class for tables stored in Shore
pcache_link _pcache
Definition: table_man.h:330
table_row_t * get_tuple()
Definition: table_man.h:339
: Cache for tuples (row_impl<>) used in Shore
uint32_t PageID
Definition: basics.h:45
#define w_assert0(x)
Default assert/debug level is 0.
Definition: w_base.h:175
This is the SHORE Storage Manager API.
Definition: sm.h:405
void give_tuple(table_row_t *ptt)
Definition: table_man.h:343
w_rc_t index_probe_forupdate(ss_m *db, index_desc_t *pidx, table_row_t *ptuple, const PageID &root=0)
Definition: table_man.h:169
virtual w_rc_t populate(ss_m *, bool &)
Definition: table_man.h:285
static TableDesc *& ptable()
Definition: row_cache.h:46
w_rc_t load_and_register_fid(ss_m *db)
Definition: table_man.cpp:49
Return code for most functions and methods.
Definition: w_rc.h:87
Definition: index_desc.h:60
w_rc_t index_probe_forupdate_by_name(ss_m *db, const char *idx_name, table_row_t *ptuple, const PageID &root=0)
Definition: table_man.h:204
w_rc_t index_probe_primary(ss_m *db, table_row_t *ptuple, lock_mode_t lock_mode=okvl_mode::S, const PageID &root=0)
Definition: table_man.h:185
guard< blob_pool > _pts
Definition: table_man.h:122
virtual w_rc_t print_index(unsigned i, ostream &os, unsigned int num_lines=0, bool need_tuple=false)
Definition: table_man.cpp:500
int key_size(index_desc_t *pindex) const
w_rc_t delete_index_entry(ss_m *db, const char *idx_name, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::X, const PageID &primary_root=0)
Definition: table_man.cpp:330
table_man_t(T *aTableDesc, bool construct_cache=true)
Definition: table_man.h:126
w_rc_t index_probe_nl_by_name(ss_m *db, const char *idx_name, table_row_t *ptuple, const PageID &root=0)
Definition: table_man.h:214
: Description and current value of a field (column)
: Base class for records (rows) of tables in Shore
w_rc_t delete_tuple(ss_m *db, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::X, const PageID &primary_root=0)
Definition: table_man.cpp:275
virtual ~table_man_t()
Definition: table_man.h:138
w_rc_t index_probe(ss_m *db, index_desc_t *pidx, table_row_t *ptuple, const lock_mode_t lock_mode=okvl_mode::S, const PageID &root=0)
Definition: table_man.cpp:71
Definition: shore_env.h:349
Definition: table_man.h:318
int min_key(index_desc_t *pindex, table_row_t *ptuple, rep_row_t &arep)
w_rc_t index_probe_nl(ss_m *db, index_desc_t *pidx, table_row_t *ptuple, const PageID &root=0)
Definition: table_man.h:177
#define T
Definition: w_okvl_inl.h:45
Definition: table_man.h:117
row_cache_t< T > * get_cache()
Definition: table_man.h:334
int max_key(index_desc_t *pindex, table_row_t *ptuple, rep_row_t &arep)
row_cache_t< T > * operator->()
Definition: table_man.h:325