changeset 70:a9f8ff5da6e8

Add MR parameter for reduce output files
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 06 Feb 2016 18:37:00 +0000
parents ddd39d8ba118
children 2a58864abf08
files src/parameters.rs
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/parameters.rs	Sat Feb 06 17:08:16 2016 +0000
+++ b/src/parameters.rs	Sat Feb 06 18:37:00 2016 +0000
@@ -13,6 +13,8 @@
     pub reduce_group_prealloc_size: usize,
     pub reduce_group_insensitive: bool,
 
+    pub reduce_output_shard_prefix: String,
+
     // Internal parameters
     pub shard_id: usize,
 }
@@ -26,6 +28,7 @@
             map_partition_size: 100 * 1024 * 1024,
             reduce_group_prealloc_size: 1,
             reduce_group_insensitive: false,
+            reduce_output_shard_prefix: String::from("output_"),
             shard_id: 0,
         }
     }
@@ -78,6 +81,13 @@
         self
     }
 
+    /// Prefix for output files produced by the reduce phase.
+    /// Default: output_ (the id of the reduce shard will be appended to that string)
+    pub fn set_out_name(mut self, prefix: String) -> MRParameters {
+        self.reduce_output_shard_prefix = prefix;
+        self
+    }
+
     /// For internal use: Sets the ID of the executing data chunk (for file naming etc.)
     ///
     pub fn set_shard_id(mut self, n: usize) -> MRParameters {