Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55691 - in sandbox/boost: . mapreduce
From: cdm.henderson_at_[hidden]
Date: 2009-08-20 16:55:10


Author: chenderson
Date: 2009-08-20 16:55:09 EDT (Thu, 20 Aug 2009)
New Revision: 55691
URL: http://svn.boost.org/trac/boost/changeset/55691

Log:
Improved error handling
Text files modified:
   sandbox/boost/mapreduce.hpp | 7 +++++--
   sandbox/boost/mapreduce/job.hpp | 12 +++++++++---
   2 files changed, 14 insertions(+), 5 deletions(-)

Modified: sandbox/boost/mapreduce.hpp
==============================================================================
--- sandbox/boost/mapreduce.hpp (original)
+++ sandbox/boost/mapreduce.hpp 2009-08-20 16:55:09 EDT (Thu, 20 Aug 2009)
@@ -15,7 +15,10 @@
 
 #ifdef BOOST_MSVC
 # if !defined(__SGI_STL_PORT)
-# pragma message("warning: using STLPort is recommended to avoid STL container locking in MSVC supplied libraries.")
+# pragma message("warning: using STLPort is recommended to avoid STL container performance problems in MSVC supplied libraries.")
+# endif
+# if _SECURE_SCL
+# pragma message("warning: using MSVC with _SECURE_SCL=1 defined can cause serious runtime performance degradation.")
 # endif
 #endif
 
@@ -41,7 +44,7 @@
     specification()
       : map_tasks(0),
         reduce_tasks(1),
- max_file_segment_size(1048576L), // default 1Gb
+ max_file_segment_size(1048576L), // default 1Mb
         output_filespec("mapreduce_")
     {
     }

Modified: sandbox/boost/mapreduce/job.hpp
==============================================================================
--- sandbox/boost/mapreduce/job.hpp (original)
+++ sandbox/boost/mapreduce/job.hpp 2009-08-20 16:55:09 EDT (Thu, 20 Aug 2009)
@@ -190,6 +190,8 @@
         bool success = true;
         try
         {
+ ++result.counters.map_keys_executed;
+
             std::auto_ptr<typename map_task_type::key_type>
                 map_key_ptr(
                     reinterpret_cast<
@@ -200,9 +202,10 @@
             // get the data
             typename map_task_type::value_type value;
             if (!datasource_.get_data(map_key, value))
+ {
+ ++result.counters.map_key_errors;
                 return false;
-
- ++result.counters.map_keys_executed;
+ }
 
             // Map Task
             if (map_key == typename map_task_type::key_type()
@@ -246,6 +249,8 @@
 
     bool const run_reduce_task(unsigned const partition, results &result)
     {
+ bool success = true;
+
         using namespace boost::posix_time;
         ptime start_time(microsec_clock::universal_time());
         try
@@ -262,11 +267,12 @@
         {
             std::cerr << "\nError: " << e.what() << "\n";
             ++result.counters.reduce_key_errors;
+ success = false;
         }
         
         result.reduce_times.push_back(microsec_clock::universal_time()-start_time);
 
- return true;
+ return success;
     }
 
   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