Alernately, instead of objects they could be a value that encodes a type -- someting like (int 1234), (string "foo"), etc.. This will allow for flexibility with configuration/context values.
On Thu, Aug 25, 2011 at 4:42 PM, <[email protected]> wrote: > Author: esammer > Date: Thu Aug 25 23:42:24 2011 > New Revision: 1161800 > > URL: http://svn.apache.org/viewvc?rev=1161800&view=rev > Log: > - Updated configuration logic to treat config values as strings. > > Modified: > > > incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java > > Modified: > incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java > URL: > http://svn.apache.org/viewvc/incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java?rev=1161800&r1=1161799&r2=1161800&view=diff > > ============================================================================== > --- > incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java > (original) > +++ > incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java > Thu Aug 25 23:42:24 2011 > @@ -44,13 +44,13 @@ public class NetcatSource extends Abstra > @Override > public void configure(Context context) { > String nodeName = context.get("logicalNode.name", String.class); > - Integer port = context.get("source.port", Integer.class); > + String port = context.get("source.port", String.class); > > Preconditions.checkArgument(nodeName != null, "Node name may not be > null"); > Preconditions.checkArgument(port != null, "Source port may not be > null"); > > this.nodeName = nodeName; > - this.port = port; > + this.port = Integer.parseInt(port); > } > > @Override > > > -- // Jonathan Hsieh (shay) // Software Engineer, Cloudera // [email protected]
