I think it should be objects or byte[]. Making it strings will lock in of translation for all time. It also make it difficult to have composite structures or arguments that have sub arguments (like file formats that have compression as arguments, roll policies with multiple variables [size + time] etc)
Jon. On Thu, Aug 25, 2011 at 4:16 PM, <[email protected]> wrote: > 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 > > > -- // Jonathan Hsieh (shay) // Software Engineer, Cloudera // [email protected]
