[ 
https://issues.apache.org/jira/browse/FLUME-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13218347#comment-13218347
 ] 

[email protected] commented on FLUME-978:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/3968/
-----------------------------------------------------------

(Updated 2012-02-28 16:49:24.308965)


Review request for Flume.


Changes
-------

Updated patch due to trunk commits.


Summary
-------

1) Changing backing structure of Context from object to String
2) Add getBoolean, getInteger, getLong to Context
3) Remove get(key, clazz)
4) Add javadoc to public methods of Context
5) Change backing map of Context to synchronized map since it seems this class 
could be accessed by multiple threads.


This addresses bug FLUME-978.
    https://issues.apache.org/jira/browse/FLUME-978


Diffs (updated)
-----

  
flume-ng-channels/flume-jdbc-channel/src/main/java/org/apache/flume/channel/jdbc/impl/JdbcChannelProviderImpl.java
 1cf1c0c 
  flume-ng-core/src/main/java/org/apache/flume/Context.java f1c8f85 
  
flume-ng-core/src/main/java/org/apache/flume/channel/ChannelSelectorFactory.java
 a7d5f94 
  flume-ng-core/src/main/java/org/apache/flume/channel/MemoryChannel.java 
e79490e 
  
flume-ng-core/src/main/java/org/apache/flume/channel/MultiplexingChannelSelector.java
 c63d0a1 
  
flume-ng-core/src/main/java/org/apache/flume/channel/PseudoTxnMemoryChannel.java
 1df580e 
  flume-ng-core/src/main/java/org/apache/flume/sink/AvroSink.java 5440631 
  flume-ng-core/src/main/java/org/apache/flume/sink/RollingFileSink.java 
45c031d 
  flume-ng-core/src/main/java/org/apache/flume/sink/SinkGroup.java 1adc5ff 
  flume-ng-core/src/main/java/org/apache/flume/sink/SinkProcessorFactory.java 
859f4fd 
  flume-ng-core/src/main/java/org/apache/flume/source/AvroSource.java 7b079f9 
  flume-ng-core/src/main/java/org/apache/flume/source/ExecSource.java a96016c 
  flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java d205bbc 
  flume-ng-core/src/test/java/org/apache/flume/TestContext.java a5e6aa8 
  flume-ng-core/src/test/java/org/apache/flume/channel/TestMemoryChannel.java 
3392dff 
  
flume-ng-core/src/test/java/org/apache/flume/sink/TestFailoverSinkProcessor.java
 93ad3bf 
  
flume-ng-legacy-sources/flume-avro-source/src/main/java/org/apache/flume/source/avroLegacy/AvroLegacySource.java
 b1e67f7 
  
flume-ng-legacy-sources/flume-thrift-source/src/main/java/org/apache/flume/source/thriftLegacy/ThriftLegacySource.java
 5fe270a 
  
flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSEventSink.java
 3da90a5 
  
flume-ng-sinks/flume-irc-sink/src/main/java/org/apache/flume/sink/irc/IRCSink.java
 0a5498f 

Diff: https://reviews.apache.org/r/3968/diff


Testing
-------

Unit tests added for all new methods and some exiting methods.

All unit tests pass.


Thanks,

Brock


                
> 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 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

        

Reply via email to