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

Matthieu Morel commented on S4-104:
-----------------------------------

The problem is that you should not be modifying Event instances after they are 
created. For preventing that, Event instances should be immutable.
And we could provide a copy constructor for the default Event type.

I'm not exactly sure how to ensure immutability here, considering the Event 
class can be subclassed by users. Maybe we could try something with the Builder 
pattern and some runtime validations, but it sounds like a best effort solution 
only.




                
> Current Stream pass the same event object to different targetPEs
> ----------------------------------------------------------------
>
>                 Key: S4-104
>                 URL: https://issues.apache.org/jira/browse/S4-104
>             Project: Apache S4
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Aimee Cheng
>
> In Stream class:
> for (ProcessingElement pe : pes) {
>    pe.handleInputEvent(event);
> }
> It seems will cause problem if different PE share a same event object. 
> Sometimes we only need change a attribute of the event and then sent it 
> again. But in current version, if one PE changed the attribute of event, it 
> will have impact on other PEs.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to