[ 
https://issues.apache.org/jira/browse/MAPREDUCE-3995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Loughran updated MAPREDUCE-3995:
--------------------------------------

    Status: Patch Available  (was: Open)

Patch with test. I'm submitting to see what Jenkins says, but I've realised 
that adding the listeners to {{AbstractService}} isn't the right place to add a 
list of static listeners.

It would be better to move the code to the {{ServiceOperations}} class of 
MAPREDUCE-3970, and then invoke it from {{AbstractService}}. Any implementation 
of {{Service}} that did not extend that base class would still have the ability 
to invoke the event list.

Other enhancements
# clone the list before making the notifications to make the iterator robust 
against concurrency problems.
# add a package-scoped {{resetGlobalListeners()}} method for testing, to ensure 
the list is empty after each test run. 

Such a patch will have to wait for MAPREDUCE-3970, so I'll mark this as a 
dependency.
                
> Add support for  static service lifecycle listeners .
> -----------------------------------------------------
>
>                 Key: MAPREDUCE-3995
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-3995
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: mrv2
>    Affects Versions: 0.23.1, 0.24.0
>            Reporter: Steve Loughran
>            Assignee: Steve Loughran
>            Priority: Minor
>         Attachments: MAPREDUCE-3995.patch, MAPREDUCE-3995.patch, 
> MAPREDUCE-3995.patch, MAPREDUCE-3995.patch
>
>
> Add support to {{AbstractService}} that allow callers to register listeners 
> for all instances. The existing listener interface could be used. This allows 
> management tools to hook into the events.
> The static listeners would be invoked for all state changes except creation 
> (base class shouldn't be handing out references to itself at this point).
> These static events could all be async, pushed through a shared 
> {{ConcurrentLinkedQueue}}; failures logged at warn and the rest of the 
> listeners invoked.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to