[Assorted-commits] SF.net SVN: assorted: [344] hash-join/trunk/src/hashjoin.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-09 19:37:20
|
Revision: 344 http://assorted.svn.sourceforge.net/assorted/?rev=344&view=rev Author: yangzhang Date: 2008-02-09 11:37:26 -0800 (Sat, 09 Feb 2008) Log Message: ----------- fixed some protection/docs Modified Paths: -------------- hash-join/trunk/src/hashjoin.cc Modified: hash-join/trunk/src/hashjoin.cc =================================================================== --- hash-join/trunk/src/hashjoin.cc 2008-02-09 19:37:17 UTC (rev 343) +++ hash-join/trunk/src/hashjoin.cc 2008-02-09 19:37:26 UTC (rev 344) @@ -55,8 +55,6 @@ /** * Search in p for the nth instance of c and return the character past it. - * TODO figure out if there's a way to merge this and the above rather than - * maintaining two versions. (Related to Linus Torvalds' post on const?) */ inline char * strchrrep(char *p, char c, int n) @@ -223,12 +221,10 @@ { public: db(const char *path) : buf(load_file(path, buflen, ncpus)) {} - const bucket **partition(); /** - * This routine runs on each processor to hash-partition the data into local - * buckets. + * Run hash-partitioning phase on all processors. */ - virtual void partition1(unsigned int pid, bucket* bucket) = 0; + const bucket **partition(); virtual ~db() { delete [] buf; } /** * Push a tuple into one of the buckets. Which bucket is determined by the @@ -243,6 +239,11 @@ unsigned int push_bucket(char **heads, bucket *bs, const char *s, const char *p, size_t nbytes); protected: + /** + * This routine runs on each processor to hash-partition the data into local + * buckets. + */ + virtual void partition1(unsigned int pid, bucket* bucket) = 0; char *buf; size_t buflen; }; @@ -259,6 +260,7 @@ * Build the hash map in parallel. */ const hmap *build(const bucket **movbucs); +protected: /** * Each node runs this routine to construct its local hash map. */ @@ -278,6 +280,7 @@ * Probe the hash maps with tuples from the actor buckets. */ void probe(const hmap *hs, const bucket **actbucs, bool show_progress); +protected: /** * Each node runs this routine to probe into its local hash map using tuples * from actor buckets destined for that node. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |