-
Notifications
You must be signed in to change notification settings - Fork 2
/
Structs.h
160 lines (128 loc) · 2.66 KB
/
Structs.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#ifndef _STRUCTS_H_
#define _STRUCTS_H_
#include <stdint.h>
#include <float.h>
extern short QID;
// extern const char *DB;
// extern const char *QUERIES;
// extern const char *STAT_FILES;
extern char STAT_FILES[100];;
extern char QUERIES[100];
extern char DB[100];
extern int query_ndx;
extern char QUERY_FILE[100];
extern char RESULT_FILE[100];
extern char MACHINE_FILE[100];
extern char STAT_FILE_1[100];
extern char STAT_FILE_2[100];
extern int DESIRED_PLAN_NDX;
extern int SHOULD_GET_NETWORK_SPEED;
extern int SHOULD_LOAD_STATS;
extern long double networkSpeed;
typedef uint64_t ulong;
typedef struct result
{
short exists;
char *variable;
struct result *next;
} Result;
typedef struct condition
{
short id;
short isExclusive;
char *subj, *pred, *obj;
struct condition *next;
} Condition;
typedef struct node
{
short nid;
char *label;
struct neighbor *in_neighbors;
struct neighbor *out_neighbors;
struct neighbor *merged_ngbrs;
struct neighbor *nextRecipientNgbr;
struct node *next;
short in_degree;
short out_degree;
short isJoinNode;
short is_deleted;
short worker_rank;
struct subquery *subQ;
struct node **optimalCompactGraph;
} Node;
typedef struct neighbor
{
Node *node;
short isMerged;
struct neighbor *next;
} Neighbor;
typedef struct query
{
short id;
Result *results;
Condition *conditions;
char *filter;
short num_nodes;
short num_results;
short num_conditions;
short num_join_nodes;
short num_merged_nodes;
long estimateCost;
Node **optimalPlan;
Node **compactGraph;
Node *graph;
} Query;
typedef struct chosenresult
{
Result *result_p;
char *variable;
struct chosenresult *next;
} ChosenResult;
typedef struct chosencondition
{
Condition *condition_p;
struct chosencondition *next;
} ChosenCondition;
typedef struct subquery
{
ChosenResult *results;
ChosenCondition *shareds;
ChosenCondition *superset;
ChosenCondition *conditions;
ChosenCondition *optimalset;
ChosenCondition *exclusives;
char *hashkey;
char *filter;
char qstring[2000];
short num_results;
short num_conditions;
short num_exclusives;
short num_shareds;
// ulong resultSize; /* cost of the optimal set */
// ulong scanSize;
// ulong hashJoinCost;
// ulong commCost;
// ulong scanCost;
// ulong cummCost;
long double resultSize; /* cost of the optimal set */
long double scanSize;
long double hashJoinCost;
long double commCost;
long double scanCost;
long double cummCost;
struct subquery *next;
} SubQuery;
typedef struct subq_info
{
char *subQ;
int w_rank;
} SubQInfo;
typedef struct result_info
{
char **ngbr_result_set;
void * NGBRS_COMM;
int ngbr_rank;
int *msg_len;
int my_rank;
} ResultInfo;
#endif