-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate_shards.h
50 lines (36 loc) · 1.26 KB
/
create_shards.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
/*-------------------------------------------------------------------------
*
* create_shards.h
*
* Declarations for public functions and types related to shard creation
* functionality.
*
* Copyright (c) 2014, Citus Data, Inc.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_SHARD_CREATE_SHARDS_H
#define PG_SHARD_CREATE_SHARDS_H
#include "postgres.h"
#include "c.h"
#include "fmgr.h"
#include "nodes/pg_list.h"
/* name for the file containing worker node and port information */
#define WORKER_LIST_FILENAME "pg_worker_list.conf"
/* transaction related commands used in talking to the worker nodes */
#define BEGIN_COMMAND "BEGIN"
#define COMMIT_COMMAND "COMMIT"
#define ROLLBACK_COMMAND "ROLLBACK"
/* in-memory representation of a worker node */
typedef struct WorkerNode
{
uint32 nodePort;
char *nodeName;
} WorkerNode;
/* utility function declaration shared within this module */
extern List * SortList(List *pointerList,
int (*ComparisonFunction)(const void *, const void *));
/* function declarations for initializing a distributed table */
extern Datum master_create_distributed_table(PG_FUNCTION_ARGS);
extern Datum master_create_worker_shards(PG_FUNCTION_ARGS);
#endif /* PG_SHARD_CREATE_SHARDS_H */