sm_base.h File Reference


Detailed Description

Definition in file sm_base.h.

Go to the source code of this file.

Defines

#define SM_EXTENTSIZE   8
#define SM_LOG_PARTITIONS   8

Typedefs

typedef w_rc_t rc_t
typedef w_rc_t(*) LOG_WARN_CALLBACK_FUNC (xct_i *iter, xct_t *&victim, fileoff_t curr, fileoff_t thresh, const char *logfile)
 Log space warning callback function type.
typedef w_base_t::uint4_t partition_number_t
 Callback function type for restoring an archived log file.
typedef w_rc_t(*) LOG_ARCHIVED_CALLBACK_FUNC (const char *fname, partition_number_t num)

Enumerations

enum  cmp_t
 Comparison types used in scan_index_i

Shorthand for CompareOp.

enum  escalation_options
enum  store_t { , t_index, t_file, t_lgrec }
 Types of stores. More...
enum  ndx_t
 Index types.
enum  concurrency_t
 Lock granularities. More...
enum  pg_policy_t
 File-compaction policy for creating records. More...


Typedef Documentation

typedef w_rc_t(*) LOG_WARN_CALLBACK_FUNC(xct_i *iter, xct_t *&victim, fileoff_t curr, fileoff_t thresh, const char *logfile)

Log space warning callback function type.

For more details of how this is used, see the constructor ss_m::ss_m().

Storage manager methods check the available log space. If the log is in danger of filling to the point that it will be impossible to abort a transaction, a callback is made to the server. The callback function is of this type. The danger point is a threshold determined by the option sm_log_warn.

The callback function is meant to choose a victim xct and tell if the xct should be aborted by returning RC(eUSERABORT).

Any other RC value is returned to the server through the call stack.

The arguments:

Parameters:
[in] iter Pointer to an iterator over all xcts.
[out] victim Victim will be returned here. This is an in/out paramter and is initially populated with the transaction that is attached to the running thread.
[in] curr Bytes of log consumed by active transactions.
[in] thresh Threshhold just exceeded.
[in] logfile Character string name of oldest file to archive.
This function must be careful not to return the same victim more than once, even though the callback may be called many times before the victim is completely aborted.

When this function has archived the given log file, it needs to notify the storage manager of that fact by calling ss_m::log_file_was_archived(logfile)

Definition at line 264 of file sm_base.h.

typedef w_base_t::uint4_t partition_number_t

Callback function type for restoring an archived log file.

Parameters:
[in] fname Original file name (with path).
[in] needed Partition number of the file needed.
An alternative to aborting a transaction (when the log fills) is to archive log files. The server can use the log directory name to locate these files, and may use the iterator and the static methods of xct_t to determine which log file(s) to archive.

Archiving and removing the older log files will work only if the server also provides a LOG_ARCHIVED_CALLBACK_FUNCTION to restore the archived log files when the storage manager needs them for rollback. This is the function type used for that purpose.

The function must locate the archived log file containing for the partition number num, which was a suffix of the original log file's name. The log file must be restored with its original name.

Examples:
log_exceed.cpp.

Definition at line 294 of file sm_base.h.


Enumeration Type Documentation

enum store_t

Types of stores.

Enumerator:
t_index  a b-tree or r-tree index
t_file  a file of records
t_lgrec  t_lgrec is used for storing large record pages and is always associated with some t_file store

Definition at line 325 of file sm_base.h.

enum concurrency_t

Lock granularities.

Definition at line 361 of file sm_base.h.

enum pg_policy_t

File-compaction policy for creating records.

These are masks - the following combinations are sensible:

Definition at line 392 of file sm_base.h.


Generated on Mon Jan 2 15:13:57 2012 for Shore Storage Manager by  doxygen 1.4.7