OoOJoin  0.0.1
The next generation of out-of-order join operator
The no partition hash join (NPJ)
Collaboration diagram for The no partition hash join (NPJ):

Classes

class  OoOJoin::NPJ_thread
 The thread used by NPJ. More...
 
class  OoOJoin::NPJ
 The top class package of NPJ, providing a "join function". More...
 
class  OoOJoin::NPJSingle
 The top class package of single threadNPJ, providing a "join function". More...
 

Functions

void OoOJoin::NPJ_thread::inlineMain ()
 The 'main' function of NPJ thread. More...
 
void OoOJoin::NPJ_thread::syncTimeStruct (struct timeval tv)
 Synchronize the time structure with outside setting. More...
 
void OoOJoin::NPJ_thread::init (NPJTuplePtr *_ts, NPJTuplePtr *_tr, size_t _sLen, size_t _rLen, int _cpu, MultiThreadHashTablePtr _table, BarrierPtr bar)
 THe init function. More...
 
size_t OoOJoin::NPJ_thread::getResult ()
 
void OoOJoin::NPJ_thread::waitBuildBar (void)
 
virtual size_t OoOJoin::NPJ::join (C20Buffer< OoOJoin::TrackTuplePtr > windS, C20Buffer< OoOJoin::TrackTuplePtr > windR, int threads=1)
 The function to execute join,. More...
 
virtual size_t OoOJoin::NPJSingle::join (C20Buffer< OoOJoin::TrackTuplePtr > windS, C20Buffer< OoOJoin::TrackTuplePtr > windR, int threads=1)
 The function to execute join,. More...
 
typedef std::shared_ptr< NPJOoOJoin::NPJPtr
 The class to describe a shared pointer to NPJ. More...
 
typedef std::shared_ptr< NPJSingleOoOJoin::NPJSinglePtr
 The class to describe a shared pointer to NPJSingle.
 
#define newNPJ   std::make_shared<NPJ>
 (Macro) To creat a new NPJ under shared pointer. More...
 
#define newNPJSingle   std::make_shared<NPJSingle>
 (Macro) To creat a new NPJSingle under shared pointer.
 
typedef std::shared_ptr< MtBucketOoOJoin::MtBucketPtr
 
typedef TrackTuplePtr OoOJoin::NPJTuplePtr
 
typedef std::shared_ptr< MultiThreadHashTableOoOJoin::MultiThreadHashTablePtr
 
#define BUCKET_SIZE   4
 

Detailed Description

NPJ is a parallel version of the canonical hash join algorithm. Both input relations are divided into equisized portions to be assigned to a number of threads. In the build phase, all threads populate a shared hash table with all tuples of R. After synchronization via a barrier, all threads enter the probe phase, and concurrently find matching join tuples in their assigned portions of S.

Macro Definition Documentation

◆ BUCKET_SIZE

#define BUCKET_SIZE   4

()

The hashtable achieves thread-safe by std::mutex. Instead of locking the whole table, only the bucketed to be inserted will be locked, which reduces waiting

◆ newNPJ

#define newNPJ   std::make_shared<NPJ>

(Macro) To creat a new NPJ under shared pointer.

[newNPJ]

Typedef Documentation

◆ NPJPtr

typedef std::shared_ptr<NPJ> OoOJoin::NPJPtr

The class to describe a shared pointer to NPJ.

[NPJPtr]

Function Documentation

◆ init()

void OoOJoin::NPJ_thread::init ( NPJTuplePtr *  _ts,
NPJTuplePtr *  _tr,
size_t  _sLen,
size_t  _rLen,
int  _cpu,
MultiThreadHashTablePtr  _table,
BarrierPtr  bar 
)
inline

THe init function.

Parameters
_tsMemory pointer of S
_trMemory pointer of S
_sLenLength of S
_rLenLength of R
_cpuCore to bind, -1 means let OS decide
_tableThe shared pointer of hash table
barTHe barrier used for build phase

◆ inlineMain()

void NPJ_thread::inlineMain ( )
protectedvirtual

The 'main' function of NPJ thread.

Note
This is a re-implementation of AbstractC20Thread

Reimplemented from INTELLI::AbstractC20Thread.

◆ join() [1/2]

size_t NPJ::join ( C20Buffer< OoOJoin::TrackTuplePtr windS,
C20Buffer< OoOJoin::TrackTuplePtr windR,
int  threads = 1 
)
virtual

The function to execute join,.

Parameters
windSThe window of S tuples
windRThe window of R tuples
threadsThe threads for executing this join
Returns
The joined tuples

Reimplemented from OoOJoin::AbstractJoinAlgo.

◆ join() [2/2]

size_t NPJSingle::join ( C20Buffer< OoOJoin::TrackTuplePtr windS,
C20Buffer< OoOJoin::TrackTuplePtr windR,
int  threads = 1 
)
virtual

The function to execute join,.

Parameters
windSThe window of S tuples
windRThe window of R tuples
threadsThe threads for executing this join
Returns
The joined tuples

Reimplemented from OoOJoin::AbstractJoinAlgo.

◆ syncTimeStruct()

void OoOJoin::NPJ_thread::syncTimeStruct ( struct timeval  tv)
inline

Synchronize the time structure with outside setting.

Parameters
tvThe outside time structure