incubator-s4-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Morel (Commented) (JIRA)" <>
Subject [jira] [Commented] (S4-12) Dynamic Method Dispatching
Date Wed, 19 Oct 2011 16:13:10 GMT


Matthieu Morel commented on S4-12:

Indeed, I hadn't considered the trigger evaluation...

In the current implementation, triggers depend on the type of incoming events, and are configured
during the initialization of the application.

I added a method that checks whether incoming events have corresponding triggers, based on
the runtime type of the event. If there is no match, then no dispatch to trigger methods will
be performed (an inactive trigger is added to the corresponding map structure)

If there is a match, i.e. the incoming event has a configured event trigger, then it is evaluated,
and if evaluated to true, dispatched to the relevant onTrigger method.

I added a pull request

I wonder about the usefulness of parameterizable onTrigger methods? Is it really worth providing
that or couldn't we just have a single onTrigger() method?
> Dynamic Method Dispatching
> --------------------------
>                 Key: S4-12
>                 URL:
>             Project: Apache S4
>          Issue Type: Bug
>         Environment: Matthieu, in ProcessingElement, I think you need to make the trigger
map key dynamic, no? The trigger object is stored using the Event class as key which means
that for CounterEvent, the key should be CounterEvent.class.
> private boolean isTrigger(Event event) {
>         /* Check if there is a trigger for this event type. */
>         Trigger trigger = triggers.get(Event.class); // TODO: modify for dynamic
>                                                      // dispatch.
>         if (trigger == null)
>             return false;
>         /*
>          * Check if it is time to activate the trigger for this event type.
>          */
>         return trigger.checkAndUpdate();
>     }
>            Reporter: Leo Neumeyer
>            Assignee: Matthieu Morel

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message