2 #ifndef _JOINALGO_NPJ_MULTITHREADHASHTABLE_H_
3 #define _JOINALGO_NPJ_MULTITHREADHASHTABLE_H_
7 #include <condition_variable>
20 typedef std::shared_ptr<MtBucket> MtBucketPtr;
35 MtBucketPtr next =
nullptr;
45 while (!m_mut.try_lock());
81 vector<MtBucket> buckets;
111 typedef std::shared_ptr<MultiThreadHashTable> MultiThreadHashTablePtr;
The multithread-supported bucket.
Definition: MultiThreadHashTable.h:30
size_t probeTuple(TuplePtr tp)
probe one tuple, just on the bucket
void duplicatedInsert(TuplePtr tp)
Insert a tuple, allowing key duplication.
void lock()
lock this bucket
Definition: MultiThreadHashTable.h:44
void unlock()
unlock this bucket
Definition: MultiThreadHashTable.h:50
The multithread-supported hash table, holding buckets.
Definition: MultiThreadHashTable.h:75
size_t probeTuple(TuplePtr tp)
probe one tuple
void buildTable(TuplePtrQueue tps)
build the hashtable from tuple queue
void buildTable(TuplePtr *tps, size_t len)
build the hashtable from tuple memory aray
MultiThreadHashTable(size_t bks)
pre-init with several buckets
std::shared_ptr< class Tuple > TuplePtr
The class to describe a shared pointer to Tuple.
Definition: Types.h:150
std::shared_ptr< INTELLI::SPSCQueue< INTELLI::TuplePtr > > TuplePtrQueue
To describe a queue of TuplePtr under SPSCQueue.
Definition: Types.h:228
Definition: DatasetTool.h:10