[
https://issues.apache.org/jira/browse/FLUME-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218376#comment-13218376
]
Hari Shreedharan edited comment on FLUME-978 at 2/28/12 5:29 PM:
-----------------------------------------------------------------
This will be very useful for the configuration refactoring I am working on.
Will be great to see this checked in asap. Thanks Brock!
was (Author: hshreedharan):
This will be very useful for the configuration refactoring I am working on.
Will be great to see this checked in asap. Thanks!
> Context interface is too basic requiring boilerplate user code
> --------------------------------------------------------------
>
> Key: FLUME-978
> URL: https://issues.apache.org/jira/browse/FLUME-978
> Project: Flume
> Issue Type: Improvement
> Affects Versions: v1.0.0
> Reporter: Brock Noland
> Assignee: Brock Noland
> Attachments: FLUME-978-0.patch, FLUME-978-1.patch
>
>
> Flume is filled with examples like so:
> batchSize = Integer.parseInt(context.get("batch-size", String.class));
> if (batchSize == null) {
> batchSize = defaultBatchSize;
> }
> from AvroSink. The Context object should provide at a minimum:
> * getBoolean(key)
> * getBoolean(key, default)
> * getInteger(key)
> * getInteger(key, default)
> * getLong(key)
> * getLong(key, default)
> Additionally, the Context object outside of tests, is populated via
> FlumeConfiguration which in the end is a properties file. In this common
> case, all the values in the Context object will be Strings. In this case, if
> we do the obvious and simply provide wrappers for getBoolean, we end up
> executing:
> return Boolean.class.cast(String);
> Users of the Context object should not care where the values come from, only
> that they will be returned the correct object type.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira