chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r802574 - in /hadoop/chukwa/trunk/src: java/org/apache/hadoop/chukwa/ChunkImpl.java test/org/apache/hadoop/chukwa/util/TestFilter.java
Date Sun, 09 Aug 2009 19:23:15 GMT
Author: asrabkin
Date: Sun Aug  9 19:23:14 2009
New Revision: 802574

URL: http://svn.apache.org/viewvc?rev=802574&view=rev
Log:
CHUKWA-366. Revised regex. (contributed by Eric Yang)

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/ChunkImpl.java
    hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/util/TestFilter.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/ChunkImpl.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/ChunkImpl.java?rev=802574&r1=802573&r2=802574&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/ChunkImpl.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/ChunkImpl.java Sun Aug  9 19:23:14
2009
@@ -192,7 +192,7 @@
    * @see org.apache.hadoop.chukwa.Chunk#getTag(java.lang.String)
    */
   public String getTag(String tagName) {
-    Pattern tagPattern = Pattern.compile(".*"+tagName+"=\"(.*)\".*");
+    Pattern tagPattern = Pattern.compile(".*"+tagName+"=\"(.*?)\".*");
     if (tags != null) {
       Matcher matcher = tagPattern.matcher(tags);
       if (matcher.matches()) {

Modified: hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/util/TestFilter.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/util/TestFilter.java?rev=802574&r1=802573&r2=802574&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/util/TestFilter.java (original)
+++ hadoop/chukwa/trunk/src/test/org/apache/hadoop/chukwa/util/TestFilter.java Sun Aug  9
19:23:14 2009
@@ -64,6 +64,8 @@
     assertFalse(rule.matches(chunk1));
     chunk1.addTag("foo=\"bar\"");
     assertTrue(rule.matches(chunk1));
+    chunk1.addTag("baz=\"quux\"");
+    assertTrue(rule.matches(chunk1));
   }
   
 }



Mime
View raw message