Multi-core Hash Joins
Main-memory hash join implementations for multi-core CPUs
types.h
Go to the documentation of this file.
1
11#ifndef TYPES_H
12#define TYPES_H
13
14#include <stdint.h>
15#ifdef __cplusplus
16#include <span>
17#endif // __cplusplus
18
19#ifdef __cplusplus
20namespace eth_hashjoin {
21#endif // __cplusplus
22
23
30#ifdef KEY_8B /* 64-bit key/value, 16B tuples */
31typedef int64_t intkey_t;
32typedef int64_t value_t;
33#else /* 32-bit key/value, 8B tuples */
34typedef int32_t intkey_t;
35typedef int32_t value_t;
36#endif
37
38typedef struct tuple_t tuple_t;
39typedef struct relation_t relation_t;
40
41typedef struct result_t result_t;
42typedef struct threadresult_t threadresult_t;
43
45struct tuple_t {
46 intkey_t key;
47 value_t payload;
48};
49
54struct relation_t {
55 tuple_t * tuples;
56 uint64_t num_tuples;
57
58#ifdef __cplusplus
59 relation_t() : relation_t(nullptr, 0) {}
60 relation_t(tuple_t * tuples, uint64_t num_tuples) : tuples(tuples), num_tuples(num_tuples) {}
61 relation_t(const std::span<tuple_t>& span) : tuples(span.data()), num_tuples(span.size()) {}
62 operator std::span<tuple_t>() { return {tuples, num_tuples}; }
63#endif // __cplusplus
64};
65
68 int64_t nresults;
69 void * results;
70 uint32_t threadid;
71};
72
74struct result_t {
75 int64_t totalresults;
76 threadresult_t * resultlist;
77 int nthreads;
78};
79
82#ifdef __cplusplus
83} // namespace eth_hashjoin
84#endif // __cplusplus
85#endif /* TYPES_H */
A wrapper file ensuring 64bit key size.
Definition: generator64.hpp:10
Definition: types.h:74
Definition: types.h:45