incubator-s4-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Morel (JIRA)" <>
Subject [jira] [Commented] (S4-104) Current Stream pass the same event object to different targetPEs
Date Tue, 23 Oct 2012 09:53:12 GMT


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

View raw message