SwatDB
|
#include <cstdint>
#include <string>
Go to the source code of this file.
Classes | |
struct | PageId |
struct | RecordId |
struct | FieldEntry |
struct | SelectConjunct |
Typedefs | |
typedef std::uint32_t | FileId |
typedef std::uint32_t | PageNum |
typedef std::uint32_t | FrameId |
Index of each frame in the bufferpool of BufferManager. | |
typedef std::uint32_t | SlotId |
typedef std::uint32_t | FieldId |
typedef std::uint16_t | FieldOffset |
typedef std::uint32_t | Level |
typedef std::uint32_t | HashVal |
Enumerations | |
enum | FieldType { IntFieldT , FloatFieldT , StringFieldT , InvalidFieldT } |
enum | CatType { INVALID_CAT_TYPE , HeapFileT , SortedFileT , BPlusTreeT , HashIndexT } |
enum | Comp { INVALID_TYPE , LESS , GREATER , EQUAL , NOT_EQUAL , LESS_EQUAL , GREATER_EQUAL } |
enum | RepType { INVALID_REP_TYPE , ClockT , RandomT , MruT , ClockRandomT , LruT , MAXREPTYPES } |
enum | SelectType { INVALID_SELECT_TYPE , FileScanT , IndexT } |
enum | JoinType { INVALID_JOIN_TYPE , TupleNLJT , IndexNLJT , BlockNLJT , SeqHashJoinT , ParHashJoinT } |
Variables | |
const int | BM_MAX_REP_STR_LEN = (48) |
const char | bm_rep_strs [MAXREPTYPES][BM_MAX_REP_STR_LEN] |
const std::uint32_t | FILE_MAX_CAPACITY = 100000000 |
const std::uint32_t | MAX_FILE_NUM = 1000 |
const std::uint32_t | PAGE_SIZE = 1024 |
const std::uint32_t | MAX_RECORD_SIZE = PAGE_SIZE - (8 * sizeof(std::uint32_t)) |
const std::uint32_t | MAX_PAGE_NUM |
const std::uint32_t | MAX_FILE_NAME_LEN = 511 |
const std::uint32_t | BUF_SIZE = 1024 |
const std::uint32_t | MAX_FIELD_NAME = 32 |
const std::uint32_t | INVALID_PAGE_NUM = MAX_PAGE_NUM+1 |
const std::uint32_t | HEADER_PAGE_NUM = 0 |
const std::uint32_t | INVALID_FILE_ID = MAX_FILE_NUM+1 |
const PageId | INVALID_PAGE_ID = {INVALID_FILE_ID, INVALID_PAGE_NUM} |
const std::uint32_t | INVALID_SLOT_OFFSET = PAGE_SIZE+1 |
const SlotId | INVALID_SLOT_ID = INVALID_SLOT_OFFSET |
const RecordId | INVALID_RECORD_ID = {INVALID_PAGE_NUM, INVALID_SLOT_ID} |
const float | MAX_HEAP_PAGE_LOAD = 0.9 |
const float | MAX_HASH_BUCKET_LOAD = 0.9 |
const SlotId | MAX_HASH_DIRSLOT = PAGE_SIZE/sizeof(PageNum) |
typedef std::uint32_t FieldId |
Unique identifer of each field in a record
typedef std::uint16_t FieldOffset |
Offset of the field within a record/key per variable length implementation
typedef std::uint32_t FileId |
SwatDB Types and Configuration. Definition of commonly used data types and constants used throughout the system Types defined by specific layers may be defined in interface .h files. Runtime unique identifer of each file. Reset everytime the system is rebooted.
typedef std::uint32_t HashVal |
Hash value of a key/field
typedef std::uint32_t Level |
Level of HashIndex
typedef std::uint32_t PageNum |
Unique identifer of each page in a single Unix file.
enum CatType |
Catalog entry types: one for each type of file or index in the system IMPORTANT: since the type is encoded in saved meta files on disk, you should ONLY APPEND to this list (don't remove a type, nor add a new one in the middle)
enum JoinType |
Defines the type of joins that can be run in the relops manager
enum RepType |
Buffer Manager Replacement Policy types: one for each type of replacement policy
enum SelectType |
Defines the type of selects that can be run in the relops manager
const int BM_MAX_REP_STR_LEN = (48) |
sets max size of string representation of replacment policies (used for print output)
const char bm_rep_strs[MAXREPTYPES][BM_MAX_REP_STR_LEN] |
String reprentations of Buffer Manager Replacement Policies add one for each RepType entry this is indexed by the RepType value, so be careful!
const std::uint32_t BUF_SIZE = 1024 |
Number of pages that can be held in the buffer pool.
const std::uint32_t FILE_MAX_CAPACITY = 100000000 |
SwatDB Constants Maximum capacity of each Unix file in bytes
const std::uint32_t HEADER_PAGE_NUM = 0 |
PageNum of header page. Is 0 by default per the current implementation, but may change in the future.
const std::uint32_t INVALID_FILE_ID = MAX_FILE_NUM+1 |
Default constant for PageNum that exceeds its maximum.
const PageId INVALID_PAGE_ID = {INVALID_FILE_ID, INVALID_PAGE_NUM} |
Used for initializing a PageId to a default value that is not used
const std::uint32_t INVALID_PAGE_NUM = MAX_PAGE_NUM+1 |
Default constant for FileId that exceeds its maximum.
const RecordId INVALID_RECORD_ID = {INVALID_PAGE_NUM, INVALID_SLOT_ID} |
Default value of RecordId.
const SlotId INVALID_SLOT_ID = INVALID_SLOT_OFFSET |
Default value of SlotId.
const std::uint32_t INVALID_SLOT_OFFSET = PAGE_SIZE+1 |
const std::uint32_t MAX_FIELD_NAME = 32 |
The maximum sizeof any field name
const std::uint32_t MAX_FILE_NAME_LEN = 511 |
Maximum length of a file name string in the system (not counting \0
)
const std::uint32_t MAX_FILE_NUM = 1000 |
Maximum number of Unix files that can be created during one run of SwatDB (a real long running system would have much larger value for this)
const float MAX_HASH_BUCKET_LOAD = 0.9 |
Maximum load factor (free space/total space) of hash bucket page. If the load factor of a hash bucket page exceeds this value, it is considered full.
The maximum number of entries that could fit on a hash directory page.
const float MAX_HEAP_PAGE_LOAD = 0.9 |
Maximum load factor (free space/total space) of heap page. If the load factor of a heappage exceeds this value, it is considered full.
const std::uint32_t MAX_PAGE_NUM |
Maximum number of pages that could fit in a single Unix file, excluding the file header metadata. If the size of the SerializedFileHeader struct is modified, this equation also has to be modified. This equation accounts for extra space occupied by 2 std::uint32_t (size and capacity) fields of the header metadata and space occupied by bitmap (1 bit per Page, but 8 is multiplied to prevent truncation due to int division). Finally, the MAX_PAGE_NUM is "rounded down" as the disk header information has to fit in units of PAGE_SIZE.
const std::uint32_t MAX_RECORD_SIZE = PAGE_SIZE - (8 * sizeof(std::uint32_t)) |
The maximum record size that can fit in a single page. It accounts for the minimum space taken by the metadata of HeapPage, so if metadata structures are modified, this value should also be modified.
const std::uint32_t PAGE_SIZE = 1024 |
The size of a page in bytes