|
| static void | set_shutdown_flag (bool clean) |
| | Cause the storage manager's shutting down do be done cleanly or to simulate a crash. More...
|
| |
| static void | set_shutdown_filthy (bool filthy) |
| | Cause the storage manager's shutting down to simulate a filthy crash, which worse than the dirty shutdown, because it truncates the log in order to make the log to represent an even dirtier state than the dirty shutdown. More...
|
| |
| static rc_t | log_file_was_archived (const char *logfile) |
| | Notify storage manager when a log file was archived by a LOG_WARN_CALLBACK_FUNC. More...
|
| |
| static rc_t | begin_xct (int timeout=timeout_t::WAIT_SPECIFIED_BY_THREAD) |
| | Begin a transaction. More...
|
| |
| static rc_t | begin_xct (sm_stats_t *stats, int timeout=timeout_t::WAIT_SPECIFIED_BY_THREAD) |
| | Begin an instrumented transaction. More...
|
| |
| static rc_t | begin_xct (tid_t &tid, int timeout=timeout_t::WAIT_SPECIFIED_BY_THREAD) |
| | Begin a transaction and return the transaction id. More...
|
| |
| static rc_t | begin_sys_xct (bool single_log_sys_xct=false, sm_stats_t *stats=nullptr, int timeout=timeout_t::WAIT_SPECIFIED_BY_THREAD) |
| | Being a new system transaction which might be a nested transaction. More...
|
| |
| static rc_t | commit_xct (bool lazy=false, lsn_t *plastlsn=nullptr) |
| | Commit a transaction. More...
|
| |
| static rc_t | commit_xct (sm_stats_t *&stats, bool lazy=false, lsn_t *plastlsn=nullptr) |
| | Commit an instrumented transaction and get its statistics. More...
|
| |
| static rc_t | commit_sys_xct () |
| | Commit a system transaction, which doesn't cause log sync. More...
|
| |
| static rc_t | chain_xct (sm_stats_t *&stats, bool lazy=false) |
| | Commit an instrumented transaction and start a new one. More...
|
| |
| static rc_t | chain_xct (bool lazy=false) |
| | Commit a transaction and start a new one, inheriting locks. More...
|
| |
| static rc_t | commit_xct_group (xct_t *list[], int listlen) |
| | Commit a group of transactions. More...
|
| |
| static rc_t | abort_xct (sm_stats_t *&stats) |
| | Abort an instrumented transaction and get its statistics. More...
|
| |
| static rc_t | abort_xct () |
| | Abort a transaction. More...
|
| |
| static rc_t | save_work (sm_save_point_t &sp) |
| | Populate a save point. More...
|
| |
| static rc_t | rollback_work (const sm_save_point_t &sp) |
| | Roll back to a savepoint. More...
|
| |
| static uint32_t | num_active_xcts () |
| | Return the number of transactions in active state. More...
|
| |
| static void | attach_xct (xct_t *x) |
| | Attach the given transaction to the currently-running smthread_t. More...
|
| |
| static void | detach_xct () |
| | Detach any attached from the currently-running smthread_t. More...
|
| |
| static xct_t * | tid_to_xct (const tid_t &tid) |
| | Get the transaction structure for a given a transaction id. More...
|
| |
| static tid_t | xct_to_tid (const xct_t *x) |
| | Get the transaction ID for a given a transaction structure. More...
|
| |
| static rc_t | dump_xcts (ostream &o) |
| | Print transaction information to an output stream. More...
|
| |
| static xct_state_t | state_xct (const xct_t *x) |
| | Get the transaction state for a given transaction (structure). More...
|
| |
| static off_t | xct_log_space_needed () |
| | Return the amount of log this transaction would consume if it rolled back.If a transaction aborts with eOUTOFLOGSPACE this function can be used in conjunction with xct_reserve_log_space to pre-allocate the needed amount of log space before retrying. More...
|
| |
| static rc_t | xct_reserve_log_space (off_t amt) |
| | Require the specified amount of log space to be available for this transaction before continuing.If a transaction risks running out of log space it can pre-request some or all of the needed amount before starting in order to improve its chances of success. Other new transactions will be unable to acquire log space before this request is granted (existing ones will be able to commit, unless they also run out of space, because that tends to free up log space and avoids wasting work). More...
|
| |
| static rc_t | checkpoint () |
| | Take a checkpoint. More...
|
| |
| static rc_t | force_volume () |
| | Force the buffer pool to flush to disk all pages for the given volume. More...
|
| |
| static rc_t | gather_xct_stats (sm_stats_t &stats, bool reset=false) |
| | Get a copy of the statistics from an attached instrumented transaction. More...
|
| |
| static rc_t | gather_stats (sm_stats_t &stats) |
| | Get a copy of the global statistics. More...
|
| |
| static rc_t | config_info (sm_config_info_t &info) |
| | Get a copy of configuration-dependent information. More...
|
| |
| static rc_t | set_disk_delay (u_int milli_sec) |
| | Set sleep time before I/O operations. More...
|
| |
| static rc_t | sync_log (bool block=true) |
| | Forces a log flush. More...
|
| |
| static rc_t | flush_until (lsn_t &anlsn, bool block=true) |
| | Forces a log flush until the given lsn. More...
|
| |
| static rc_t | get_curr_lsn (lsn_t &anlsn) |
| | Allowing to access info about the current lsn. More...
|
| |
| static rc_t | get_durable_lsn (lsn_t &anlsn) |
| | Allowing to access info about the durable lsn. More...
|
| |
| static void | dump_page_lsn_chain (std::ostream &o, const PageID &pid, const lsn_t &max_lsn) |
| | Pretty-prints the content of log file to the given stream in a way we can easily debug single-page recovery. More...
|
| |
| static void | dump_page_lsn_chain (std::ostream &o, const PageID &pid) |
| | Pretty-prints the content of log file to the given stream in a way we can easily debug single-page recovery. More...
|
| |
| static void | dump_page_lsn_chain (std::ostream &o) |
| | Pretty-prints the content of log file to the given stream in a way we can easily debug single-page recovery. More...
|
| |
| static rc_t | verify_volume (int hash_bits, verify_volume_result &result) |
| | Verifies consistency of all BTree indexes in the volume. More...
|
| |
| static rc_t | create_index (StoreID &stid) |
| | Create a B+-Tree index. More...
|
| |
| static rc_t | destroy_index (const StoreID &iid) |
| | Destroy a B+-Tree index. More...
|
| |
| static rc_t | touch_index (StoreID stid, uint64_t &page_count) |
| | Touches all pages in the B-tree index to load them into bufferpool. More...
|
| |
| static rc_t | create_assoc (StoreID stid, const w_keystr_t &key, const vec_t &el) |
| | Create an entry in a B+-Tree index. More...
|
| |
| static rc_t | create_assoc (StoreID stid, const vec_t &key, const vec_t &el) |
| |
| static rc_t | update_assoc (StoreID stid, const w_keystr_t &key, const vec_t &el) |
| | Update record data of an entry in a B+-Tree index. More...
|
| |
| static rc_t | put_assoc (StoreID stid, const w_keystr_t &key, const vec_t &el) |
| | Put record data of an entry in a B+-Tree index. More...
|
| |
| static rc_t | overwrite_assoc (StoreID stid, const w_keystr_t &key, const char *el, smsize_t offset, smsize_t elen) |
| | This function finds the given key, updates the specific part of element if found. More...
|
| |
| static rc_t | destroy_assoc (StoreID stid, const w_keystr_t &key) |
| | Remove an entry from a B+-Tree index. More...
|
| |
| static rc_t | find_assoc (StoreID stid, const w_keystr_t &key, void *el, smsize_t &elen, bool &found) |
| | Find an entry associated with a key in a B+-Tree index. More...
|
| |
| static rc_t | defrag_index_page (btree_page_h &page) |
| | Defrags the given page to remove holes and ghost records in the page. More...
|
| |
| static rc_t | verify_index (StoreID stid, int hash_bits, bool &consistent) |
| | Verifies the integrity of B-Tree index using the fence-key bitmap technique. More...
|
| |
| static rc_t | open_store (StoreID stid, PageID &root_pid, bool for_update=false) |
| |
| static rc_t | open_store_nolock (StoreID stid, PageID &root_pid) |
| |
| static lil_global_table * | get_lil_global_table () |
| |
| static rc_t | lock (const lockid_t &n, const okvl_mode &m, bool check_only=false, int timeout=timeout_t::WAIT_SPECIFIED_BY_XCT) |
| | Acquire a lock. More...
|
| |
| static rc_t | activate_archiver () |
| |
| static const sm_options & | get_options () |
| |
This is the SHORE Storage Manager API.
Most of the API for using the storage manager is through this interface class.
Initialize the storage manager.
- Parameters
-
| [in] | options | Start-up parameters. |
When an ss_m object is created, the storage manager initializes itself and, if the sthreads package has not already been initialized by virtue of an sthread_t running, the sthreads package is initialized now.
The log is read and recovery is performed (MHLPS), and control returns to the caller, after which time storage manager threads (instances of smthread_t) may be constructed and storage manager may be used.
The storage manager is used by invoking its static methods. You may use them as follows:
W_DO(UNIQ->mount_vol(...))
W_DO(ss_m::mount_vol(...))
).
Only one ss_m object may be extant at any time. If you try to create another while the one exists, a fatal error will occur (your program will choke with a message about your mistake).
The callback argument given to the storage manager constructor is called when the storage manager determines that it is in danger of running out of log space. Heuristics are used to guess when this is the case.
If the function warn archives and removes log files, the function get must be provided to restore those log files when the storage manager needs them.
For details and examples, see smlevel_0::LOG_WARN_CALLBACK_FUNC, smlevel_0::LOG_ARCHIVED_CALLBACK_FUNC, and SSMLOG.