forked from arenadata/diskquota
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivetable.h
54 lines (45 loc) · 1.11 KB
/
activetable.h
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
52
53
54
#ifndef ACTIVE_TABLE_H
#define ACTIVE_TABLE_H
#include "diskquota.h"
/* Type of status of returned active table objects*/
typedef enum
{
TABLE_COMMIT_CHANGE = 0,
TABLE_COMMIT_CREATE = 1,
TABLE_COMMIT_DELETE = 2,
TABLE_IN_TRANSX_CHANGE = 3,
TABLE_IN_TRANSX_CREATE = 4,
TABLE_IN_TRANSX_DELETE = 5,
TABLE_NOT_FOUND = 6,
TABLE_UNKNOWN = 99,
} ATStatus;
typedef enum
{
AT_CREATE = 1,
AT_EXTEND = 2,
AT_TRUNCATE = 3,
AT_UNLINK = 4,
} ActiveType;
/* Cache to detect the active table list */
typedef struct DiskQuotaActiveTableFileEntry
{
RelFileNode node;
Oid inXnamespace;
Oid inXowner;
ATStatus tablestatus;
bool ispushedback;
} DiskQuotaActiveTableFileEntry;
typedef struct DiskQuotaActiveTableEntry
{
RelFileNode node;
int64 tablesize;
Oid namespace;
Oid owner;
ActiveType type;
} DiskQuotaActiveTableEntry;
extern HTAB* pg_fetch_active_tables(bool);
extern void init_active_table_hook(void);
extern void init_shm_worker_active_tables(void);
extern void init_lock_active_tables(void);
extern HTAB *active_tables_map;
#endif