|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55331 - sandbox/boost/mapreduce/intermediates
From: cdm.henderson_at_[hidden]
Date: 2009-07-31 19:36:44
Author: chenderson
Date: 2009-07-31 19:36:43 EDT (Fri, 31 Jul 2009)
New Revision: 55331
URL: http://svn.boost.org/trac/boost/changeset/55331
Log:
Fixed a bug in the use of vector<> as the partition container
Text files modified:
sandbox/boost/mapreduce/intermediates/in_memory.hpp | 22 ++++------------------
1 files changed, 4 insertions(+), 18 deletions(-)
Modified: sandbox/boost/mapreduce/intermediates/in_memory.hpp
==============================================================================
--- sandbox/boost/mapreduce/intermediates/in_memory.hpp (original)
+++ sandbox/boost/mapreduce/intermediates/in_memory.hpp 2009-07-31 19:36:43 EDT (Fri, 31 Jul 2009)
@@ -73,9 +73,6 @@
void merge_from(unsigned partition, in_memory &other)
{
- BOOST_ASSERT(intermediates_.find(partition) != intermediates_.end());
- BOOST_ASSERT(other.intermediates_.find(partition) != other.intermediates_.end());
-
typedef typename intermediates_t::value_type map_type;
map_type &map = intermediates_[partition];
@@ -115,22 +112,11 @@
return true;
}
-//!!!
- //bool const replace(typename map_task_type::intermediate_key_type const &key,
- // typename map_task_type::intermediate_value_type const &value)
- //{
- // intermediates_t::iterator it = intermediates_.find(key);
- // if (it == intermediates_.end())
- // return false;
- // it->second.clear();
- // it->second.push_back(value);
- // return true;
- //}
-
template<typename FnObj>
void combine(FnObj &fn_obj)
{
intermediates_t intermediates;
+ intermediates.resize(num_partitions_);
std::swap(intermediates_, intermediates);
for (typename intermediates_t::const_iterator it=intermediates.begin(); it!=intermediates.end(); ++it)
@@ -146,9 +132,9 @@
fn_obj.finish(it1->first, *this);
}
}
-
- if (intermediates_.size() == 0)
- std::swap(intermediates_, intermediates);
+//!!!null_combiner
+ //if (intermediates_.size() == 0)
+ // std::swap(intermediates_, intermediates);
}
private:
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