|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55342 - sandbox/libs/mapreduce/examples/wordcount
From: cdm.henderson_at_[hidden]
Date: 2009-08-01 09:45:16
Author: chenderson
Date: 2009-08-01 09:45:15 EDT (Sat, 01 Aug 2009)
New Revision: 55342
URL: http://svn.boost.org/trac/boost/changeset/55342
Log:
Small optimisation for Combining results at the end of the Map Task
Text files modified:
sandbox/libs/mapreduce/examples/wordcount/wordcount.cpp | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
Modified: sandbox/libs/mapreduce/examples/wordcount/wordcount.cpp
==============================================================================
--- sandbox/libs/mapreduce/examples/wordcount/wordcount.cpp (original)
+++ sandbox/libs/mapreduce/examples/wordcount/wordcount.cpp 2009-08-01 09:45:15 EDT (Sat, 01 Aug 2009)
@@ -91,6 +91,13 @@
class combiner
{
public:
+ template<typename IntermediateStore>
+ static void run(IntermediateStore &intermediate_store)
+ {
+ combiner instance;
+ intermediate_store.combine(instance);
+ }
+
void start(map_task::intermediate_key_type const &)
{
total_ = 0;
@@ -107,6 +114,9 @@
{
total_ += value;
}
+
+ private:
+ combiner() { }
private:
unsigned total_;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk