accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1210628 - in /incubator/accumulo/branches/1.4/src/core/src: main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
Date Mon, 05 Dec 2011 21:02:11 GMT
Author: billie
Date: Mon Dec  5 21:02:10 2011
New Revision: 1210628

URL: http://svn.apache.org/viewvc?rev=1210628&view=rev
Log:
ACCUMULO-189 applied patch

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
    incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java?rev=1210628&r1=1210627&r2=1210628&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
(original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
Mon Dec  5 21:02:10 2011
@@ -39,10 +39,10 @@ public class RegExFilter extends Filter 
   public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
     RegExFilter result = new RegExFilter();
     result.setSource(getSource().deepCopy(env));
-    result.rowMatcher = rowMatcher.pattern().matcher("");
-    result.colfMatcher = colfMatcher.pattern().matcher("");
-    result.colqMatcher = colqMatcher.pattern().matcher("");
-    result.valueMatcher = valueMatcher.pattern().matcher("");
+    result.rowMatcher = copyMatcher(rowMatcher);
+    result.colfMatcher = copyMatcher(colfMatcher);
+    result.colqMatcher = copyMatcher(colqMatcher);
+    result.valueMatcher = copyMatcher(valueMatcher);
     result.orFields = orFields;
     return result;
   }
@@ -61,6 +61,14 @@ public class RegExFilter extends Filter 
   
   private ByteArrayBackedCharSequence babcs = new ByteArrayBackedCharSequence();
   
+  private Matcher copyMatcher(Matcher m)
+  {
+	  if(m == null)
+		  return m;
+	  else
+		  return m.pattern().matcher("");
+  }
+  
   private boolean matches(Matcher matcher, ByteSequence bs) {
     if (matcher != null) {
       babcs.set(bs);

Modified: incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java?rev=1210628&r1=1210627&r2=1210628&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
(original)
+++ incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
Mon Dec  5 21:02:10 2011
@@ -192,5 +192,12 @@ public class RegExFilterTest extends Tes
     assertTrue(rei.getTopKey().equals(k2));
     rei.next();
     assertFalse(rei.hasTop());
+    
+    is.clearOptions();
+    
+    RegExFilter.setRegexs(is, null, "ya.*", "hamster", null, true);
+    rei.init(new SortedMapIterator(tm), is.getProperties(), new DefaultIteratorEnvironment());
+    rei.seek(new Range(), EMPTY_COL_FAMS, false);
+    rei.deepCopy(new DefaultIteratorEnvironment());
   }
 }



Mime
View raw message