You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by Jonathan Hsieh <jo...@cloudera.com> on 2011/08/26 07:50:00 UTC

Not sure this is a good decision. [Re: svn commit: r1161795 - /incubator/flume/branches/flume-728/flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java]

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, <es...@apache.org> 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
// jon@cloudera.com