-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
51 lines (43 loc) · 1.73 KB
/
Copy pathcommon.h
File metadata and controls
51 lines (43 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <cstdint>
#include <time.h>
#define ALWAYS_INLINE inline __attribute__((always_inline))
#define PAGE_SIZE 4096 // 16KB
extern int ComputeNodeCount;
extern uint64_t ATTEMPTED_NUM;
using region_id_t=int32_t;
using page_id_t = int32_t; // page id type
using frame_id_t = int32_t; // frame id type
using table_id_t = int32_t; // table id type
using column_id_t = int32_t; // column id type
using itemkey_t = uint64_t; // Data item key type, used in DB tables
using partition_id_t = int32_t; // partition id type
using lock_t = uint64_t; // Lock type
using node_id_t = int32_t; // Node id type
using batch_id_t = uint64_t; // batch id type
using lsn_t = uint64_t; // log sequence number, used for storage_node log storage
using tx_id_t = uint64_t; // Transaction id type
using t_id_t = uint32_t; // Thread id type
using coro_id_t = int; // Coroutine id type
using offset_t = int64_t; // Offset type.
using timestamp_t = uint64_t; // Timestamp type
#define MAX_DB_TABLE_NUM 16 // Max DB tables; enough for 4 TPC-C routed tables x 4 warehouse partitions
#define MAX_DB_PAGE_NUM 5000000 // Max pages per table
#define LOG_FILE_NAME "LOG_FILE"
#define kInvalidPageId -1
// YashanDB compatible methods
struct YashanConnInfo {
std::string ip_port;
std::string user;
std::string password;
};
// MySQL compatible methods. The fields are intentionally close to libmysqlclient
// so that --db-connection strings can be parsed without adding another config file.
struct MySQLConnInfo {
std::string host = "127.0.0.1";
unsigned int port = 3306;
std::string user = "root";
std::string password;
std::string database = "test";
std::string socket;
};