chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1039601 - /incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java
Date Sat, 27 Nov 2010 02:43:49 GMT
Author: eyang
Date: Sat Nov 27 02:43:48 2010
New Revision: 1039601

URL: http://svn.apache.org/viewvc?rev=1039601&view=rev
Log:
CHUKWA-553. Retain file filter argument for DirTailingAdaptor. (Deepak Deshpande via Eric
Yang)

Modified:
    incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java

Modified: incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java
URL: http://svn.apache.org/viewvc/incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java?rev=1039601&r1=1039600&r2=1039601&view=diff
==============================================================================
--- incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java
(original)
+++ incubator/chukwa/trunk/src/java/org/apache/hadoop/chukwa/datacollection/adaptor/DirTailingAdaptor.java
Sat Nov 27 02:43:48 2010
@@ -55,6 +55,7 @@ public class DirTailingAdaptor extends A
 	protected String adaptorName; // name of adaptors to start
 
   IOFileFilter fileFilter;
+  String wildCharacter;
 
   @Override
   public void start(long offset) throws AdaptorException {
@@ -116,7 +117,8 @@ public class DirTailingAdaptor extends A
 
   @Override
   public String getCurrentStatus() {
-    return type + " " + baseDirName + " " + adaptorName;
+    return this.wildCharacter == null ? (type + " " + baseDirName + " " + adaptorName)
+    		:(type + " " + baseDirName + " " + this.wildCharacter + " " + adaptorName);
   }
 
   @Override
@@ -130,14 +132,15 @@ public class DirTailingAdaptor extends A
      adaptorName = args[1];
     }else if(args.length == 3){
      baseDir = new File(args[0]);
-     fileFilter = new WildcardFileFilter(args[1]);
+     this.wildCharacter = args[ 1 ];
+     fileFilter = new WildcardFileFilter( this.wildCharacter );
      adaptorName = args[2]; 
     }else{
      log.warn("bad syntax in DirTailingAdaptor args");
      return null;
     }
     
-    return (args.length == 2)? baseDir + " " + adaptorName : baseDir + " " + fileFilter +
" " + adaptorName;  //both params mandatory
+    return (args.length == 2)? baseDir + " " + adaptorName : baseDir + " " + this.wildCharacter
+ " " + adaptorName;  //both params mandatory
   }
 
   @Override



Mime
View raw message