Zero  0.1.0
shore_env.h
Go to the documentation of this file.
1 /* -*- mode:C++; c-basic-offset:4 -*-
2  Shore-kits -- Benchmark implementations for Shore-MT
3 
4  Copyright (c) 2007-2009
5  Data Intensive Applications and Systems Labaratory (DIAS)
6  Ecole Polytechnique Federale de Lausanne
7 
8  All Rights Reserved.
9 
10  Permission to use, copy, modify and distribute this software and
11  its documentation is hereby granted, provided that both the
12  copyright notice and this permission notice appear in all copies of
13  the software, derivative works or modified versions, and any
14  portions thereof, and that both notices appear in supporting
15  documentation.
16 
17  This code is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS
20  DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
21  RESULTING FROM THE USE OF THIS SOFTWARE.
22 */
23 
31 #ifndef __SHORE_ENV_H
32 #define __SHORE_ENV_H
33 
34 // #include "k_defines.h"
35 #include "sm_vas.h"
36 #include "log_core.h"
37 
38 #include <map>
39 
40 #include "skewer.h"
41 #include "reqs.h"
42 #include "table_desc.h"
43 #include <boost/program_options.hpp>
44 #include "restart.h"
45 
46 using std::map;
47 
48 namespace po = boost::program_options;
49 
50 /******** Constants ********/
51 
52 const int SHORE_NUM_OF_RETRIES = 3;
53 
54 #define SHORE_TABLE_DATA_DIR "databases"
55 
56 
57 /******************************************************************
58  *
59  * MACROS used in _env, _schema, _xct files
60  *
61  ******************************************************************/
62 
63 #define DECLARE_TRX(trxlid) \
64  w_rc_t run_##trxlid(Request* prequest, trxlid##_input_t& in); \
65  w_rc_t run_##trxlid(Request* prequest); \
66  w_rc_t xct_##trxlid(const int xct_id, trxlid##_input_t& in); \
67  void _inc_##trxlid##_att(); \
68  void _inc_##trxlid##_failed(); \
69  void _inc_##trxlid##_dld()
70 
71 #define DECLARE_TABLE(table, manimpl, abbrv) \
72  guard<manimpl> _p##abbrv##_man; \
73  inline manimpl* abbrv##_man() { return (_p##abbrv##_man); } \
74  guard<table> _p##abbrv##_desc; \
75  inline table* abbrv##_desc() { return (_p##abbrv##_desc.get()); }
76 
77 
78 
79 // There may be multiple implementations of the same transaction on the
80 // same enviroment. For example, we have the conventional TPC-H queries
81 // and the QPipe ones. On the other hand, to run a transaction we need
82 // to know the name of the implementation the user selected to run, and
83 // the name of the transaction whose input will be generated and statistics
84 // will be updated.
85 //
86 // In order to achieve this discrimination, the "trxlid" identifies
87 // logically that transaction (for example TPC-H Q1), and the "trximpl"
88 // identifies the implementation which is going to be used.
89 
90 #ifdef CFG_FLUSHER // ***** Mainstream FLUSHER ***** //
91 // Commits lazily
92 
93 #define DEFINE_RUN_WITH_INPUT_TRX_WRAPPER(cname,trxlid,trximpl) \
94  w_rc_t cname::run_##trximpl(Request* prequest, trxlid##_input_t& in) { \
95  int xct_id = prequest->xct_id(); \
96  TRACE( TRACE_TRX_FLOW, "%d. %s ...\n", xct_id, #trximpl); \
97  _inc_##trxlid##_att(); \
98  w_rc_t e = xct_##trximpl(xct_id, in); \
99  if (!e.is_error()) { \
100  lsn_t xctLastLsn; \
101  e = _pssm->commit_xct(true,&xctLastLsn); \
102  prequest->set_last_lsn(xctLastLsn); } \
103  if (e.is_error()) { \
104  if (e.err_num() != smlevel_0::eDEADLOCK) \
105  _inc_##trxlid##_failed(); \
106  else _inc_##trxlid##_dld(); \
107  /*TRACE( TRACE_TRX_FLOW, "Xct (%d) aborted [0x%x]\n", xct_id, e.err_num());*/ \
108  w_rc_t e2 = _pssm->abort_xct(); \
109  if(e2.is_error()) TRACE( TRACE_ALWAYS, "Xct (%d) abort failed [0x%x]\n", xct_id, e2.err_num()); \
110  prequest->notify_client(); \
111  _request_pool.destroy(prequest); \
112  if ((*&_measure)!=MST_MEASURE) return (e); \
113  _env_stats.inc_trx_att(); \
114  return (e); } \
115  TRACE( TRACE_TRX_FLOW, "Xct (%d) (%d) to flush\n", xct_id, prequest->tid().get_lo()); \
116  to_base_flusher(prequest); \
117  return (RCOK); }
118 
119 #else // ***** NO FLUSHER ***** //
120 
121 #define DEFINE_RUN_WITH_INPUT_TRX_WRAPPER(cname, trxlid, trximpl) \
122  w_rc_t cname::run_##trximpl(Request* prequest, trxlid##_input_t& in) { \
123  int xct_id = prequest->xct_id(); \
124  /* TRACE( TRACE_TRX_FLOW, "%d. %s ...\n", xct_id, #trximpl); */ \
125  _inc_##trxlid##_att(); \
126  w_rc_t e = xct_##trximpl(xct_id, in); \
127  if (!e.is_error()) { \
128  if (isAsynchCommit()) e = _pssm->commit_xct(true); \
129  else e = _pssm->commit_xct(); } \
130  if (e.is_error()) { \
131  if (e.err_num() != eDEADLOCK) \
132  _inc_##trxlid##_failed(); \
133  else _inc_##trxlid##_dld(); \
134  /*TRACE( TRACE_TRX_FLOW, "Xct (%d) aborted [0x%x]\n", xct_id, e.err_num());*/ \
135  w_rc_t e2 = _pssm->abort_xct(); \
136  if(e2.is_error()) TRACE( TRACE_ALWAYS, "Xct (%d) abort failed [0x%x]\n", xct_id, e2.err_num()); \
137  prequest->notify_client(); \
138  if ((*&_measure)!=MST_MEASURE) return (e); \
139  _env_stats.inc_trx_att(); \
140  return (e); } \
141  /* TRACE( TRACE_TRX_FLOW, "Xct (%d) completed\n", xct_id); */ \
142  prequest->notify_client(); \
143  if ((*&_measure)!=MST_MEASURE) return (RCOK); \
144  _env_stats.inc_trx_com(); \
145  return (RCOK); }
146 
147 #endif // ***** EOF: CFG_FLUSHER ***** //
148 
149 #define DEFINE_RUN_WITHOUT_INPUT_TRX_WRAPPER(cname, trxlid, trximpl) \
150  w_rc_t cname::run_##trximpl(Request* prequest) { \
151  trxlid##_input_t in = create_##trxlid##_input(_queried_factor, \
152  prequest->selectedID(), prequest->tspread()); \
153  return (run_##trximpl(prequest, in)); }
154 
155 #define DEFINE_TRX_STATS(cname, trxlid) \
156  void cname::_inc_##trxlid##_att() { ++my_stats.attempted.trxlid; } \
157  void cname::_inc_##trxlid##_failed() { ++my_stats.failed.trxlid; } \
158  void cname::_inc_##trxlid##_dld() { ++my_stats.deadlocked.trxlid; }
159 
160 
161 // In the common case, there is a single implementation per transaction
162 #define DEFINE_TRX(cname, trx) \
163  DEFINE_RUN_WITHOUT_INPUT_TRX_WRAPPER(cname,trx,trx); \
164  DEFINE_RUN_WITH_INPUT_TRX_WRAPPER(cname,trx,trx); \
165  DEFINE_TRX_STATS(cname,trx)
166 
167 #define CHECK_XCT_RETURN(rc, retry, ENV) \
168  if (rc.is_error()) { \
169  TRACE( TRACE_ALWAYS, "Error %x\n", rc.err_num()); \
170  W_COERCE(ENV->db()->abort_xct()); \
171  switch(rc.err_num()) { \
172  case eDEADLOCK: \
173  goto retry; \
174  default: \
175  stringstream os; os << rc << ends; \
176  string str = os.str(); \
177  TRACE( TRACE_ALWAYS, \
178  "Eek! Unable to populate db due to: \n%s\n", \
179  str.c_str()); \
180  W_FATAL(rc.err_num()); \
181  } \
182  }
183 
184 /******************************************************************
185  *
186  * @struct: env_stats_t
187  *
188  * @brief: Environment statistics - total trxs attempted/committed
189  *
190  ******************************************************************/
191 
192 struct env_stats_t {
193  unsigned _ntrx_att;
194 
195  unsigned _ntrx_com;
196 
198  : _ntrx_att(0),
199  _ntrx_com(0) {}
200 
202 
203  void print_env_stats() const;
204 
205  inline unsigned inc_trx_att() {
206  return lintel::unsafe::atomic_fetch_add(&_ntrx_att, 1);
207  }
208 
209  inline unsigned inc_trx_com() {
210  lintel::unsafe::atomic_fetch_add(&_ntrx_att, 1);
211  return lintel::unsafe::atomic_fetch_add(&_ntrx_com, 1);
212  }
213 }; // EOF env_stats_t
214 
215 
216 
217 /********************************************************************
218  *
219  * @enum: eDBControl
220  *
221  * @brief: States of a controlled DB
222  *
223  ********************************************************************/
224 
226  DBC_UNDEF = 0x1,
227  DBC_PAUSED = 0x2,
228  DBC_ACTIVE = 0x4,
230 };
231 
232 /*********************************************************************
233  *
234  * @abstract class: db_iface
235  *
236  * @brief: Interface of basic shell commands for dbs
237  *
238  * @usage: - Inherit from this class
239  * - Implement the process_{START/STOP/PAUSE/RESUME} fuctions
240  *
241  *********************************************************************/
242 
243 class db_iface {
244 public:
245  typedef map<string, string> envVarMap;
246 
247  typedef envVarMap::iterator envVarIt;
248 
249  typedef envVarMap::const_iterator envVarConstIt;
250 
251 private:
252  volatile unsigned int _dbc;
253 
254 public:
255 
257  : _dbc(DBC_UNDEF) {}
258 
259  virtual ~db_iface() {}
260 
261  // Access methods
262 
264  return (eDBControl(*&_dbc));
265  }
266 
267  void set_dbc(const eDBControl adbc) {
268  assert (adbc != DBC_UNDEF);
269  // CS TODO: does this have to be atomic??
270  // unsigned int tmp = adbc;
271  // atomic_swap_uint(&_dbc, tmp);
272  _dbc = adbc;
273  }
274 
275 
276  // DB INTERFACE
277 
278  virtual int conf() = 0;
279 
280  virtual int set(envVarMap* vars) = 0;
281 
282  virtual w_rc_t load_schema() = 0;
283 
284  virtual int init() = 0;
285 
286  virtual int open() = 0;
287 
288  virtual int close() = 0;
289 
290  virtual int start() = 0;
291 
292  virtual int stop() = 0;
293 
294  virtual int restart() = 0;
295 
296  virtual int pause() = 0;
297 
298  virtual int resume() = 0;
299 
300  virtual w_rc_t newrun() = 0;
301 
302  virtual int statistics() = 0;
303 
304  virtual int dump() = 0;
305 
306  virtual int info() const = 0;
307 }; // EOF: db_iface
308 
309 
310 
311 // Forward decl
312 class base_worker_t;
313 class trx_worker_t;
314 class ShoreEnv;
315 
316 /******** Exported variables ********/
317 
318 extern ShoreEnv* _g_shore_env;
319 
320 // extern procmonitor_t* _g_mon;
321 
322 extern int ssm_max_small_rec;
323 
324 /********************************************************************
325  *
326  * @enum MeasurementState
327  *
328  * @brief Possible states of a measurement in the Shore Enviroment
329  *
330  ********************************************************************/
331 
333  MST_UNDEF = 0x0,
334  MST_WARMUP = 0x1,
335  MST_MEASURE = 0x2,
336  MST_DONE = 0x4,
337  MST_PAUSE = 0x8
338 };
339 
340 /********************************************************************
341  *
342  * ShoreEnv
343  *
344  * Shore database abstraction. Among others it configures, starts
345  * and closes the Shore database
346  *
347  ********************************************************************/
348 
349 class ShoreEnv : public db_iface {
350 public:
351  typedef std::map<string, string> ParamMap;
352 
354 
356 
358 
360 
361  typedef std::vector<WorkerPtr> WorkerPool;
362 
363  typedef std::vector<WorkerPtr>::iterator WorkerIt;
364 
365  class fid_loader_t;
366 
367 protected:
368 
369  ss_m* _pssm; // database handle
370 
371  bool _clobber;
372 
373  // Status variables
375 
376  pthread_mutex_t _init_mutex;
377 
378  bool _loaded;
379 
380  pthread_mutex_t _load_mutex;
381 
382  pthread_mutex_t _statmap_mutex;
383 
384  pthread_mutex_t _last_stats_mutex;
385 
386  // Device and volume. There is a single volume per device.
387  // The whole environment resides in a single volume.
388  StoreID _root_iid; // root id of the volume
389  pthread_mutex_t _vol_mutex; // volume mutex
390 
391  // Configuration variables
393 
394  // List of worker threads
395  WorkerPool _workers;
396 
398 
399  // Scaling factors
400  //
401  // @note: The scaling factors of any environment is an integer value
402  // So we are putting them on shore_env
403  //
404  // In various environments:
405  //
406  // TM1: SF=1 --> 15B (10K Subscribers)
407  // TPCB: SF=1 --> 20MB (1 Branch)
408  // TPCC: SF=1 --> 130MB (1 Warehouse)
409  // TPCE: SF=1 --> 6.5GB (1K Customers)
410  // TPCH: SF=1 --> 250MB (1 Warehouse)
411  //
413 
414  pthread_mutex_t _scaling_mutex;
415 
417 
418  pthread_mutex_t _queried_mutex;
419 
421 
422  // Logger
423  // kits_logger_t* _logger;
424 
425  // Stats
427 
429 
430  // Measurement state
431  volatile uint _measure;
432 
433  // system name
434  string _sysname;
435 
436  // Helper functions
437  void readconfig();
438 
439  // The insert/delete/probe/update frequencies for microbenchmarks
441 
443 
445 
447 
448  // Frequency at which checkpoits are taken (period in seconds)
450 
451  // Flags to activate log archiver and asynchronous merger
453 
455 
456  // little trick to enable archiver daemons to start later during the exp.
457  // see: chekpointer_t in shore_helper_loader.cpp
459 
460  // Time to wait (secs) before simulating a crash (0 to turn off)
462 
463  // Storage manager access functions
464  int configure_sm();
465 
466  int start_sm();
467 
468  int close_sm();
469 
470  // load balancing settings
471 
472 
473 
474  volatile bool _bAlarmSet;
475 
477 
479 
481 
482  std::atomic<bool> stop_benchmark;
483 
484  po::variables_map optionValues;
485 
486 public:
487 
488  ShoreEnv(po::variables_map& vm);
489 
490  virtual ~ShoreEnv();
491 
493  return _popts;
494  }
495 
496  po::variables_map& get_optionValues() {
497  return optionValues;
498  };
499  // DB INTERFACE
500 
501  virtual int conf();
502 
503  virtual int set(envVarMap* /* vars */) {
504  return (0); /* do nothing */ };
505 
506  virtual int init();
507 
508  virtual int post_init() {
509  return (0); /* do nothing */ }; // Should return >0 on error
510  virtual int open() {
511  return (0); /* do nothing */ };
512 
513  virtual int close();
514 
515  virtual int start();
516 
517  virtual int stop();
518 
519  virtual int restart();
520 
521  virtual int pause() {
522  return (0); /* do nothing */ };
523 
524  virtual int resume() {
525  return (0); /* do nothing */ };
526 
527  virtual w_rc_t newrun() = 0;
528 
529  virtual int statistics();
530 
531  virtual int dump();
532 
533  virtual int info() const = 0;
534 
535  // Loads the database schema after the config file is read, and before the storage
536  // manager is started.
537  virtual w_rc_t load_schema() = 0;
538 
539  virtual w_rc_t load_data() = 0;
540 
541  virtual w_rc_t create_tables() = 0;
542 
543  virtual w_rc_t warmup() = 0;
544 
545  virtual w_rc_t check_consistency() = 0;
546 
547  // loads the store ids for each table and index at kits side
548  // needed when an already populated database is being used
549  virtual w_rc_t load_and_register_fids() = 0;
550 
551  // inline access methods
552  inline ss_m* db() {
553  return (_pssm);
554  }
555 
556  bool is_initialized();
557 
558  bool is_loaded();
559 
560  w_rc_t load();
561 
562  void set_measure(const MeasurementState aMeasurementState) {
563  //assert (aMeasurementState != MST_UNDEF);
564  // CS TODO -- atomic necessary?
565  // unsigned int tmp = aMeasurementState;
566  // atomic_swap_uint(&_measure, tmp);
567  _measure = aMeasurementState;
568  }
569 
571  return (MeasurementState(*&_measure));
572  }
573 
575  return stop_benchmark;
576  }
577 
578  void set_stop_benchmark(bool v) {
579  stop_benchmark = v;
580  }
581 
582  pthread_mutex_t* get_init_mutex() {
583  return (&_init_mutex);
584  }
585 
586  pthread_mutex_t* get_vol_mutex() {
587  return (&_vol_mutex);
588  }
589 
590  pthread_mutex_t* get_load_mutex() {
591  return (&_load_mutex);
592  }
593 
594  bool get_init_no_cs() {
595  return (_initialized);
596  }
597 
599  return (_loaded);
600  }
601 
602  void set_init_no_cs(const bool b_is_init) {
603  _initialized = b_is_init;
604  }
605 
606  void set_loaded_no_cs(const bool b_is_loaded) {
607  _loaded = b_is_loaded;
608  }
609 
610  void set_clobber(bool c) {
611  _clobber = c;
612  }
613 
614  void set_loaders(int l) {
615  _loaders_to_use = l;
616  }
617 
618  // --- scaling and querying factor --- //
619  void set_qf(const double aQF);
620 
621  double get_qf() const;
622 
623  void set_sf(const double aSF);
624 
625  double get_sf() const;
626 
627  void print_sf() const;
628 
629  // kits logging
630  // void log_insert(kits_logger_t::logrec_kind_t);
631 
633  return (RCOK);
634  }
635 
636  // -- insert/delete/probe frequencies for microbenchmarks -- //
637  void set_freqs(int insert_freq = 0, int delete_freq = 0, int probe_freq = 0, int update_freq = 0);
638 
639  // checkpoint frequency
640  void set_chkpt_freq(int);
641 
643  return _chkpt_freq;
644  }
645 
646  void set_archiver_opts(bool, bool);
647 
649  return _enable_archiver;
650  }
651 
653  return _enable_merger;
654  }
655 
656  void set_activation_delay(int d) {
657  _activation_delay = d;
658  }
659 
661  return _activation_delay;
662  }
663 
664  // crash delay
665  void set_crash_delay(int);
666 
668  return _crash_delay;
669  }
670 
671  //shutdown filthy
672  void set_sm_shudown_filthy(bool);
673 
674  // load imbalance related
675  virtual void set_skew(int area, int load, int start_imbalance, int skew_type,
676  bool shifting = false);
677 
678  virtual void reset_skew();
679 
680  virtual void start_load_imbalance();
681 
682  // print the current db to files
683  // virtual void db_print_init(int num_lines);
684  // virtual w_rc_t db_print(int num_lines) { return(RCOK); }
685 
686  // fetch the current db to buffer pool
687  // virtual void db_fetch_init();
688  virtual w_rc_t db_fetch() {
689  return (RCOK);
690  }
691 
692  // Environment workers
693  uint upd_worker_cnt();
694 
695  trx_worker_t* worker(const uint idx);
696 
697  // Request atomic trash stack
698  RequestStack _request_pool;
699 
700  // For thread-local stats
701  virtual void env_thread_init() = 0;
702 
703  virtual void env_thread_fini() = 0;
704 
705  // Fake io delay interface
706  int disable_fake_disk_latency();
707 
708  int enable_fake_disk_latency(const int adelay);
709 
710  // Collects and print statistics from the SM
711  void gatherstats_sm(ostream&);
712 
713  // Takes a checkpoint (forces dirty pages)
714  int checkpoint();
715 
716  void activate_archiver();
717 
718  void wait_for_warmup();
719 
720  string sysname() {
721  return (_sysname);
722  }
723 
725  return (&_env_stats);
726  }
727 
728  // restart recovery status
729  size_t get_total_pages_to_recover();
730 
731  size_t get_dirty_page_count();
732 
733  bool has_log_analysis_finished();
734 
735  size_t get_total_pages_to_restore();
736 
737  size_t get_num_restored_pages();
738 
739  // For temp throughput calculation
740  unsigned get_trx_att() const;
741 
742  unsigned get_trx_com() const;
743 
744  inline void inc_trx_att() {
745  _env_stats.inc_trx_att();
746  }
747 
748  inline void inc_trx_com() {
749  _env_stats.inc_trx_com();
750  }
751 
752  // Throughput printing
753  virtual void print_throughput(const double iQueriedSF,
754  const int iSpread,
755  const int iNumOfThreads,
756  const double delay) = 0;
757 
758  virtual void reset_stats() = 0;
759 
760  // Run one transaction
761  virtual w_rc_t run_one_xct(Request* prequest) = 0;
762 
763  // Control whether asynchronous commit will be used
764  inline bool isAsynchCommit() const {
765  return (_asynch_commit);
766  }
767 
768  void setAsynchCommit(const bool bAsynch);
769 
770 
771  // SLI
772 public:
773  bool isSLIEnabled() const {
774  return (_bUseSLI);
775  }
776 
777  void setSLIEnabled(const bool bUseSLI) {
778  _bUseSLI = bUseSLI;
779  }
780 
781 protected:
782  bool _bUseSLI;
783 
784 
785  // ELR
786 public:
787  bool isELREnabled() const {
788  return (_bUseELR);
789  }
790 
791  void setELREnabled(const bool bUseELR) {
792  _bUseELR = bUseELR;
793  }
794 
795 protected:
796  bool _bUseELR;
797 
798 
799  // FLUSHER
800 public:
801  bool isFlusherEnabled() const {
802  return (_bUseFlusher);
803  }
804 
805  void setFlusherEnabled(const bool bUseFlusher) {
806  _bUseFlusher = bUseFlusher;
807  }
808 
809 protected:
811 
812  // guard<flusher_t> _base_flusher;
813  // virtual int _start_flusher();
814  // virtual int _stop_flusher();
815  void to_base_flusher(Request* ar);
816 
817 protected:
818 
819  // returns 0 on success
820  int _set_sys_params();
821 
823 }; // EOF ShoreEnv
824 
825 
826 
827 #endif // __SHORE_ENV_H
bool is_archiver_enabled()
Definition: shore_env.h:648
bool isAsynchCommit() const
Definition: shore_env.h:764
void inc_trx_com()
Definition: shore_env.h:748
std::vector< WorkerPtr >::iterator WorkerIt
Definition: shore_env.h:363
int _crash_delay
Definition: shore_env.h:461
pthread_mutex_t _queried_mutex
Definition: shore_env.h:418
const w_rc_t RCOK
Definition: w_rc.h:239
blob_pool RequestStack
Definition: shore_env.h:355
int _delete_freq
Definition: shore_env.h:442
Definition: shore_env.h:333
void set_measure(const MeasurementState aMeasurementState)
Definition: shore_env.h:562
int _chkpt_freq
Definition: shore_env.h:449
int ssm_max_small_rec
Definition: shore_env.cpp:710
Definition: trx_worker.h:596
envVarMap::iterator envVarIt
Definition: shore_env.h:247
pthread_mutex_t _statmap_mutex
Definition: shore_env.h:382
sm_options _popts
Definition: shore_env.h:392
pthread_mutex_t _scaling_mutex
Definition: shore_env.h:414
bool _asynch_commit
Definition: shore_env.h:822
virtual int post_init()
Definition: shore_env.h:508
eDBControl dbc()
Definition: shore_env.h:263
bool _bUseSLI
Definition: shore_env.h:782
void set_activation_delay(int d)
Definition: shore_env.h:656
void setFlusherEnabled(const bool bUseFlusher)
Definition: shore_env.h:805
pthread_mutex_t _load_mutex
Definition: shore_env.h:380
double _queried_factor
Definition: shore_env.h:416
po::variables_map optionValues
Definition: shore_env.h:484
virtual ~db_iface()
Definition: shore_env.h:259
uint32_t StoreID
Definition: basics.h:47
RequestStack _request_pool
Definition: shore_env.h:698
Definition: reqs.h:278
unsigned inc_trx_att()
Definition: shore_env.h:205
Definition: shore_env.h:336
std::map< string, string > ParamMap
Definition: shore_env.h:351
bool get_loaded_no_cs()
Definition: shore_env.h:598
Start-up parameters for the storage engine. See OPTIONS.
Definition: sm_options.h:24
int _insert_freq
Definition: shore_env.h:440
pthread_mutex_t _last_stats_mutex
Definition: shore_env.h:384
int get_crash_delay()
Definition: shore_env.h:667
virtual w_rc_t update_partitioning()
Definition: shore_env.h:632
WorkerPool _workers
Definition: shore_env.h:395
string _sysname
Definition: shore_env.h:434
int _update_freq
Definition: shore_env.h:446
MeasurementState get_measure()
Definition: shore_env.h:570
bool _enable_archiver
Definition: shore_env.h:452
Definition: shore_env.h:335
env_stats_t * get_env_stats()
Definition: shore_env.h:724
: Base class for tables stored in Shore
string sysname()
Definition: shore_env.h:720
bool _bUseELR
Definition: shore_env.h:796
bool _enable_merger
Definition: shore_env.h:454
Definition: shore_env.h:227
This is the SHORE Storage Manager API.
Definition: sm.h:405
void setELREnabled(const bool bUseELR)
Definition: shore_env.h:791
pthread_mutex_t * get_load_mutex()
Definition: shore_env.h:590
void set_loaded_no_cs(const bool b_is_loaded)
Definition: shore_env.h:606
envVarMap::const_iterator envVarConstIt
Definition: shore_env.h:249
sm_options & get_opts()
Definition: shore_env.h:492
ShoreEnv * _g_shore_env
Definition: shore_env.cpp:52
unsigned _ntrx_att
Definition: shore_env.h:193
T atomic_fetch_add(T *object, C operand)
Definition: AtomicCounter.hpp:406
: Structures that represent user requests
skew_type_t _skew_type
Definition: shore_env.h:480
Definition: shore_env.h:226
sm_stats_t _last_sm_stats
Definition: shore_env.h:428
tatas_lock _alarm_lock
Definition: shore_env.h:476
std::array< long, enum_to_base(sm_stat_id::stat_max)> sm_stats_t
Definition: smstats.h:205
Return code for most functions and methods.
Definition: w_rc.h:87
volatile uint _measure
Definition: shore_env.h:431
trx_worker_t * WorkerPtr
Definition: shore_env.h:359
virtual w_rc_t db_fetch()
Definition: shore_env.h:688
trx_worker_t Worker
Definition: shore_env.h:357
unsigned _ntrx_com
Definition: shore_env.h:195
env_stats_t _env_stats
Definition: shore_env.h:426
void set_loaders(int l)
Definition: shore_env.h:614
map< string, string > envVarMap
Definition: shore_env.h:245
void set_stop_benchmark(bool v)
Definition: shore_env.h:578
pthread_mutex_t _init_mutex
Definition: shore_env.h:376
bool _bUseFlusher
Definition: shore_env.h:810
pthread_mutex_t * get_vol_mutex()
Definition: shore_env.h:586
bool isFlusherEnabled() const
Definition: shore_env.h:801
const int SHORE_NUM_OF_RETRIES
Definition: shore_env.h:52
Definition: shore_env.h:229
bool _initialized
Definition: shore_env.h:374
virtual int open()
Definition: shore_env.h:510
A test-and-test-and-set spinlock.
Definition: tatas.h:25
db_iface()
Definition: shore_env.h:256
bool get_init_no_cs()
Definition: shore_env.h:594
volatile unsigned int _dbc
Definition: shore_env.h:252
Definition: shore_env.h:243
int _probe_freq
Definition: shore_env.h:444
int get_activation_delay()
Definition: shore_env.h:660
void setSLIEnabled(const bool bUseSLI)
Definition: shore_env.h:777
Definition for the class skewer.
void inc_trx_att()
Definition: shore_env.h:744
Definition: shore_env.h:337
eDBControl
Definition: shore_env.h:225
bool is_merger_enabled()
Definition: shore_env.h:652
pthread_mutex_t * get_init_mutex()
Definition: shore_env.h:582
~env_stats_t()
Definition: shore_env.h:201
int _start_imbalance
Definition: shore_env.h:478
Definition: shore_env.h:228
trx_request_t Request
Definition: shore_env.h:353
bool _clobber
Definition: shore_env.h:371
bool should_stop_benchmark()
Definition: shore_env.h:574
env_stats_t()
Definition: shore_env.h:197
unsigned inc_trx_com()
Definition: shore_env.h:209
StoreID _root_iid
Definition: shore_env.h:388
ss_m * db()
Definition: shore_env.h:552
ss_m * _pssm
Definition: shore_env.h:365
virtual int pause()
Definition: shore_env.h:521
bool _loaded
Definition: shore_env.h:378
void print_env_stats() const
Definition: shore_env.cpp:70
volatile bool _bAlarmSet
Definition: shore_env.h:474
void set_clobber(bool c)
Definition: shore_env.h:610
Definition: shore_env.h:349
Definition: shore_env.h:334
Definition: shore_env.h:192
void set_init_no_cs(const bool b_is_init)
Definition: shore_env.h:602
MeasurementState
Definition: shore_env.h:332
skew_type_t
Definition: skewer.h:49
bool isSLIEnabled() const
Definition: shore_env.h:773
void set_dbc(const eDBControl adbc)
Definition: shore_env.h:267
Definition: trx_worker.h:154
int get_chkpt_freq()
Definition: shore_env.h:642
uint _worker_cnt
Definition: shore_env.h:397
bool isELREnabled() const
Definition: shore_env.h:787
std::vector< WorkerPtr > WorkerPool
Definition: shore_env.h:361
virtual int resume()
Definition: shore_env.h:524
po::variables_map & get_optionValues()
Definition: shore_env.h:496
int _loaders_to_use
Definition: shore_env.h:420
int _activation_delay
Definition: shore_env.h:458
pthread_mutex_t _vol_mutex
Definition: shore_env.h:389
std::atomic< bool > stop_benchmark
Definition: shore_env.h:482
double _scaling_factor
Definition: shore_env.h:412