incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1210634 - in /incubator/accumulo/trunk: ./ src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
Date Mon, 05 Dec 2011 21:08:23 GMT
Author: billie
Date: Mon Dec  5 21:08:23 2011
New Revision: 1210634

URL: http://svn.apache.org/viewvc?rev=1210634&view=rev
Log:
ACCUMULO-189 merged to trunk

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec  5 21:08:23 2011
@@ -1,2 +1,2 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1210571
-/incubator/accumulo/branches/1.4:1201902-1209288,1209528,1209531,1209535,1209546
+/incubator/accumulo/branches/1.4:1201902-1209288,1209528,1209531,1209535,1209546,1210628

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java?rev=1210634&r1=1210633&r2=1210634&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
Mon Dec  5 21:08:23 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/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java?rev=1210634&r1=1210633&r2=1210634&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
(original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java
Mon Dec  5 21:08:23 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