10#ifndef _SWATDB_PARALLELHASHJOIN_H_
11#define _SWATDB_PARALLELHASHJOIN_H_
22#include <condition_variable>
101 std::uint32_t result_num;
116 std::condition_variable
cv;
Definition blockheapfilescanner.h:35
BufferManager * buf_mgr
Definition hashjoin.h:94
FileManager * file_mgr
Definition hashjoin.h:99
std::string temp_path
Holds the path to which the temp files should be saved. "/local/" is recommended for performance.
Definition hashjoin.h:127
std::uint32_t num_buckets
Definition hashjoin.h:116
Definition heapfilescanner.h:39
std::vector< FieldId > inner_fields
Definition join.h:83
std::vector< FieldId > outer_fields
Definition join.h:78
Definition parallelHashJoin.h:43
void _secondHash(std::uint32_t tid, std::uint32_t n_threads)
Performs the second hashing of each relation for the second step of hash join.
std::uint32_t tcount
Definition parallelHashJoin.h:121
std::exception_ptr thd_exc_ptr
Definition parallelHashJoin.h:127
ParallelHashJoin(FileId outer_id, FileId inner_id, FileId result_id, std::vector< FieldId > outer_fields, std::vector< FieldId > inner_fields, std::uint32_t num_buckets, std::uint32_t num_threads, std::string temp_path, Catalog *catalog, BufferManager *buf_mgr, FileManager *file_mgr)
Constructor for the join operater using a hash join algorithm. Sets up the state for a single join op...
void _barrier(std::uint32_t n_threads)
Helper function for _parallelRun which has threads wait until all threads have called this function.
RecordId _parallelPart1(Record *record, bool is_outer, BlockHeapFileScanner *scanner)
Performs the main looping functionality for first hash.
void _firstHash(std::uint32_t tid, bool is_outer)
Performs the initial hashing of each relation for the first step of hash join.
std::uint32_t num_threads
Definition parallelHashJoin.h:98
std::mutex * mtx_table
Definition parallelHashJoin.h:106
void runOperation()
Performs the join operation using the hash join alogrithm.
std::mutex mtx
Definition parallelHashJoin.h:111
std::vector< std::thread > threads
Definition parallelHashJoin.h:138
std::mutex exc_mtx
Definition parallelHashJoin.h:133
~ParallelHashJoin()
Destructor for hashjoin class.
std::condition_variable cv
Definition parallelHashJoin.h:116
void _parallelRun(std::uint32_t tid)
Performs the parallel functionality of parallel run, to be called by all threads.
Definition relationfile.h:32
Definition swatdb_types.h:70
std::uint32_t FileId
Definition swatdb_types.h:33