Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Flume >> mail # dev >> Review Request: FLUME-1490: Option to limit number of events sent in Stress source


+
Patrick Wendell 2012-08-17, 04:01
+
Denny Ye 2012-08-17, 06:58
+
Will McQueen 2012-08-17, 09:37
+
Patrick Wendell 2012-08-17, 15:40
+
Will McQueen 2012-08-17, 09:24
Copy link to this message
-
Re: Review Request: FLUME-1490: Option to limit number of events sent in Stress source


> On Aug. 17, 2012, 9:24 a.m., Will McQueen wrote:
> > flume-ng-core/src/main/java/org/apache/flume/source/StressSource.java, line 48
> > <https://reviews.apache.org/r/6673/diff/1/?file=142206#file142206line48>
> >
> >     1 nit:
> >    
> >     Rather than increase visibility of a field only for testing purposes, I think Powermock+Mockito should be able to allow access to the private 'event' field. Or FESTRefect too (http://docs.codehaus.org/display/FEST/Reflection+Module). Taking a page from Effective Java (2nd ed) item #14, we should strive to minimize the accessibility of classes and members.

Thanks for the tip, I use reflection in the new patch. Seems like the trade-off here is that you won't get compiler errors if the field is incorrectly named or of the wrong type.
- Patrick
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/6673/#review10456
-----------------------------------------------------------
On Aug. 17, 2012, 3:39 p.m., Patrick Wendell wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/6673/
> -----------------------------------------------------------
>
> (Updated Aug. 17, 2012, 3:39 p.m.)
>
>
> Review request for Flume.
>
>
> Description
> -------
>
> This patch implements a count limit, both for overall (successful + failed) events and for successful events. Seems like both could be useful in testing.
>
>
> This addresses bug FLUME-1490.
>     https://issues.apache.org/jira/browse/FLUME-1490
>
>
> Diffs
> -----
>
>   flume-ng-core/pom.xml 8708953
>   flume-ng-core/src/main/java/org/apache/flume/source/StressSource.java 4f7b255
>   flume-ng-core/src/test/java/org/apache/flume/source/TestSequenceGeneratorSource.java 579b257
>   flume-ng-core/src/test/java/org/apache/flume/source/TestStressSource.java PRE-CREATION
>
> Diff: https://reviews.apache.org/r/6673/diff/
>
>
> Testing
> -------
>
> Includes unit test and a bit of code clean-up.
>
>
> Thanks,
>
> Patrick Wendell
>
>

+
Patrick Wendell 2012-08-17, 15:39
+
Will McQueen 2012-08-17, 20:22