flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From esam...@apache.org
Subject svn commit: r1161795 - /incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java
Date Thu, 25 Aug 2011 23:16:49 GMT
Author: esammer
Date: Thu Aug 25 23:16:49 2011
New Revision: 1161795

URL: http://svn.apache.org/viewvc?rev=1161795&view=rev
Log:
- Change the contract on Configurables - all context values are strings. We
  leave it to the Configurable to know what values are what types.

Modified:
    incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java

Modified: incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java
URL: http://svn.apache.org/viewvc/incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java?rev=1161795&r1=1161794&r2=1161795&view=diff
==============================================================================
--- incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java
(original)
+++ incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java
Thu Aug 25 23:16:49 2011
@@ -50,17 +50,18 @@ public class RollingFileSink extends Abs
 
   @Override
   public void configure(Context context) {
-    File directory = context.get("sink.directory", File.class);
-    Long rollInterval = context.get("sink.rollInterval", Long.class);
+    String directory = context.get("sink.directory", String.class);
+    String rollInterval = context.get("sink.rollInterval", String.class);
 
     Preconditions.checkArgument(directory != null, "Directory may not be null");
 
     if (rollInterval == null) {
-      rollInterval = defaultRollInterval;
+      this.rollInterval = defaultRollInterval;
+    } else {
+      this.rollInterval = Long.parseLong(rollInterval);
     }
 
-    this.rollInterval = rollInterval;
-    this.directory = directory;
+    this.directory = new File(directory);
   }
 
   @Override



Mime
View raw message