> On Oct. 12, 2012, 12:38 a.m., Mike Percy wrote:
> > I think EventBuilder should throw if an event with a null body is passed 
> > in. Null body is an invalid event IMO; it requires special handling 
> > everywhere, especially when trying to serialize it.

Changing the behavior of EventBuilder now would break backward compatibility. 
Since this was *never* documented anywhere, it is not reasonable to expect 
custom sources to actually never insert null body/never insert a body at all.  
I know it is not expected that an event would ever have a null body, but there 
is no requirement anywhere in our documentation or javadocs that stated this - 
hence, we cannot make that change at this point. 

And really, I don't understand why adding add a check for null is a problem at 
all - it is not really changing the behavior of the channel in any real way.

If there is anyway to guarantee that this was in the event interface contract 
(that way older custom components will not break), then I am ok with this not 
being committed, but if it was not - then I don't think we can enforce a "no 
null rule" on the event body.


- Hari


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


On Oct. 8, 2012, 9:11 p.m., Hari Shreedharan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7463/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2012, 9:11 p.m.)
> 
> 
> Review request for Flume.
> 
> 
> Description
> -------
> 
> Memory channel causes NPE for events with no body.
> 
> 
> This addresses bug FLUME-1622.
>     https://issues.apache.org/jira/browse/FLUME-1622
> 
> 
> Diffs
> -----
> 
>   flume-ng-core/src/main/java/org/apache/flume/channel/MemoryChannel.java 
> fc3a1e2 
>   flume-ng-core/src/test/java/org/apache/flume/channel/TestMemoryChannel.java 
> 4af4a40 
> 
> Diff: https://reviews.apache.org/r/7463/diff/
> 
> 
> Testing
> -------
> 
> Added a unit test.
> 
> 
> Thanks,
> 
> Hari Shreedharan
> 
>

Reply via email to