-
Notifications
You must be signed in to change notification settings - Fork 15
/
spock_output_plugin.h
88 lines (77 loc) · 2.4 KB
/
spock_output_plugin.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*-------------------------------------------------------------------------
*
* spock_output_plugin.h
* spock output plugin
*
* Copyright (c) 2022-2023, pgEdge, Inc.
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, The Regents of the University of California
*
*-------------------------------------------------------------------------
*/
#ifndef SPOCK_OUTPUT_PLUGIN_H
#define SPOCK_OUTPUT_PLUGIN_H
#include "nodes/pg_list.h"
#include "nodes/primnodes.h"
#include "storage/lock.h"
/* summon cross-PG-version compatibility voodoo */
#include "spock_compat.h"
/* typedef appears in spock_output_plugin.h */
typedef struct SpockOutputData
{
MemoryContext context;
struct SpockProtoAPI *api;
/* Cached node id */
Oid local_node_id;
/* protocol */
bool allow_internal_basetypes;
bool allow_binary_basetypes;
bool forward_changeset_origins;
int field_datum_encoding;
/*
* client info
*
* Lots of this should move to a separate shorter-lived struct used only
* during parameter reading, since it contains what the client asked for.
* Once we've processed this during startup we don't refer to it again.
*/
uint32 client_pg_version;
uint32 client_max_proto_version;
uint32 client_min_proto_version;
const char *client_expected_encoding;
const char *client_protocol_format;
uint32 client_binary_basetypes_major_version;
bool client_want_internal_basetypes_set;
bool client_want_internal_basetypes;
bool client_want_binary_basetypes_set;
bool client_want_binary_basetypes;
bool client_binary_bigendian_set;
bool client_binary_bigendian;
uint32 client_binary_sizeofdatum;
uint32 client_binary_sizeofint;
uint32 client_binary_sizeoflong;
bool client_binary_float4byval_set;
bool client_binary_float4byval;
bool client_binary_float8byval_set;
bool client_binary_float8byval;
bool client_binary_intdatetimes_set;
bool client_binary_intdatetimes;
bool client_no_txinfo;
/* List of origin names */
List *forward_origins;
/* List of SpockRepSet */
List *replication_sets;
RangeVar *replicate_only_table;
} SpockOutputData;
/*
* Shared memory information per slot-group
*/
typedef struct SpockOutputSlotGroup
{
NameData name;
LWLock *lock;
int nattached;
XLogRecPtr last_lsn;
} SpockOutputSlotGroup;
extern void spock_output_plugin_shmem_init(void);
#endif /* SPOCK_OUTPUT_PLUGIN_H */