> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/main/java/org/apache/oozie/event/MemoryEventQueue.java, line 
> > 50
> > <https://reviews.apache.org/r/9602/diff/5/?file=275649#file275649line50>
> >
> >     both currentsize() and eventQueue.add() are atomic operations, but the 
> > combined operation is not.
> >     I dont think there is any better way other than synchronize the 
> > combined operation of checking the overflow of queue and adding to queue.

Added a reentrant lock for the poll() method. Not required in add() as 1 or 2 
elements inserted above maxSize when this corner case race condition occurs 
between threads, can be tolerated


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/main/java/org/apache/oozie/event/MemoryEventQueue.java, line 
> > 69
> > <https://reviews.apache.org/r/9602/diff/5/?file=275649#file275649line69>
> >
> >     instead of having this method return set of events, its better to have 
> > it return only event as a usual method of queue would do.
> >     Have the logic of draining elements in batch in event handler service

better to keep these details in the lower level (event queue) instead of higher 
up in the service. Added another method pollBatch() to allow both options as 
needed


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/main/java/org/apache/oozie/event/MemoryEventQueue.java, line 
> > 71
> > <https://reviews.apache.org/r/9602/diff/5/?file=275649#file275649line71>
> >
> >     Same comment as earlier. The combined operations are not thread safe.

see comment above


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/main/java/org/apache/oozie/service/EventHandlerService.java, 
> > line 82
> > <https://reviews.apache.org/r/9602/diff/5/?file=275654#file275654line82>
> >
> >     every configuration variable should have a default value
> >     For e.g if listenerClass is null here, we should add the existing 
> > listeners.

you will have to add this as part of your patch on top of mine, as 
org.apache.oozie.jms.JMSJobEventListener does not exist in my code


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/main/java/org/apache/oozie/service/EventHandlerService.java, 
> > line 119
> > <https://reviews.apache.org/r/9602/diff/5/?file=275654#file275654line119>
> >
> >     create the runnable passing the batch size in constructor.
> >     Make the poll() method of eventqueue return only event.

if size passed through constructor, would need an if-else clause in the run() 
method to choose between poll single (since it should return only event and not 
event-set with size 1) and poll batch. Resorted to calling pollBatch() method 
from the runnable. poll() also exists as an available option


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/test/java/org/apache/oozie/event/TestEventQueue.java, line 42
> > <https://reviews.apache.org/r/9602/diff/5/?file=275657#file275657line42>
> >
> >     More coverage of test cases required
> >     like having multiple threads adding, removing from queue etc.

thanks. will do


> On March 28, 2013, 5:58 p.m., Virag Kothari wrote:
> > trunk/core/src/test/java/org/apache/oozie/service/TestEventHandlerService.java,
> >  line 51
> > <https://reviews.apache.org/r/9602/diff/5/?file=275658#file275658line51>
> >
> >     we should have test cases for the all commands which are generating 
> > events.

thanks will do


- Mona


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


On March 29, 2013, 3:35 a.m., Mona Chitnis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9602/
> -----------------------------------------------------------
> 
> (Updated March 29, 2013, 3:35 a.m.)
> 
> 
> Review request for oozie.
> 
> 
> Description
> -------
> 
> https://issues.apache.org/jira/browse/OOZIE-1209
> WIP patch
> 
> 
> This addresses bug OOZIE-1209.
>     https://issues.apache.org/jira/browse/OOZIE-1209
> 
> 
> Diffs
> -----
> 
>   trunk/client/src/main/java/org/apache/oozie/client/SLAEvent.java 1461403 
>   trunk/client/src/main/java/org/apache/oozie/client/event/Event.java 
> PRE-CREATION 
>   trunk/client/src/main/java/org/apache/oozie/client/event/JobEvent.java 
> PRE-CREATION 
>   trunk/client/src/main/java/org/apache/oozie/client/event/SLAEvent.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java 1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionCheckXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionReadyXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionTimeOutXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionUpdateXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordKillXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordRerunXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordinatorXCommand.java
>  1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/command/wf/ActionCheckXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/KillXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/ResumeXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/SignalXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/WorkflowXCommand.java 
> 1461403 
>   trunk/core/src/main/java/org/apache/oozie/event/BundleJobEvent.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/CoordinatorActionEvent.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/CoordinatorJobEvent.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/EventQueue.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/MemoryEventQueue.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/PersistentEventQueue.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/WorkflowActionEvent.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/event/WorkflowJobEvent.java 
> PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/event/listener/JobEventListener.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordinatorJobGetForUserAppnameJPAExecutor.java
>  PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/service/EventHandlerService.java 
> PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/service/RecoveryService.java 
> 1461403 
>   
> trunk/core/src/main/java/org/apache/oozie/sla/event/listener/SLAEventListener.java
>  PRE-CREATION 
>   trunk/core/src/main/resources/oozie-default.xml 1461403 
>   
> trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionStartXCommand.java
>  1461403 
>   trunk/core/src/test/java/org/apache/oozie/event/TestEventQueue.java 
> PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/service/TestEventHandlerService.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/9602/diff/
> 
> 
> Testing
> -------
> 
> More unit tests to be added
> 
> 
> Thanks,
> 
> Mona Chitnis
> 
>

Reply via email to