You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/01/23 20:51:53 UTC

svn commit: r1234951 - /incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java

Author: vines
Date: Mon Jan 23 19:51:53 2012
New Revision: 1234951

URL: http://svn.apache.org/viewvc?rev=1234951&view=rev
Log:
ACCUMULO-319 - convenience method added


Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java?rev=1234951&r1=1234950&r2=1234951&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java Mon Jan 23 19:51:53 2012
@@ -21,6 +21,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.NoSuchElementException;
 
+import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
@@ -215,6 +216,19 @@ public abstract class TypedValueCombiner
   }
 
   /**
+   * A convenience method to set the "lossy" option on a TypedValueCombiner. If true, the combiner will ignore any values which fail to decode. Otherwise, the
+   * combiner will throw an error which will interrupt the action (and prevent potential data loss). False is the default behavior.
+   * 
+   * @param is
+   *          iterator settings object to configure
+   * @param lossy
+   *          if true the combiner will ignored values which fail to decode; otherwise error.
+   */
+  public static void setLossyness(IteratorSetting is, boolean lossy) {
+    is.addOption(LOSSY, Boolean.toString(lossy));
+  }
+  
+  /**
    * Reduces a list of V into a single V.
    * 
    * @param key