> On Aug. 28, 2013, 11:14 p.m., Robert Kanter wrote:
> > trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionQueryExecutor.java,
> >  line 22
> > <https://reviews.apache.org/r/13612/diff/4/?file=344969#file344969line22>
> >
> >     If I understand correctly, you have to have an enum to match each of 
> > the @namedQuery's for the switch statement to set the parameters.  This 
> > seems like the kind of thing that could easily get out of sync as we make 
> > changes later or we forget to update one of them but not the other.  Is 
> > there some way to not require both or to at least put them next to each 
> > other so its easier to keep them in sync?  Same with the other 
> > *QueryExecutors and *Beans.
> 
> Ryota Egashira wrote:
>     >Is there some way to not require both or to at least put them next to 
> each other so its easier to keep them in sync?
>     we also have the same concern,  I explored open jpa source a bit, trying 
> to find way to get list of named query (defined in bean) pogrammatically, but 
> no luck so far.
>     probably "put them next to each other" in the bean might be the best we 
> can do now.

Currently we are using the named query name strings in the jpa executors. We 
created the enums so that we don't use strings directly. It is better than what 
it was before. If we can have the enum or constant in the annotation itself it 
would be good, but it is not possible.


- Rohini


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


On Aug. 26, 2013, 11:10 p.m., Ryota Egashira wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/13612/
> -----------------------------------------------------------
> 
> (Updated Aug. 26, 2013, 11:10 p.m.)
> 
> 
> Review request for oozie.
> 
> 
> Bugs: OOZIE-1499
>     https://issues.apache.org/jira/browse/OOZIE-1499
> 
> 
> Repository: oozie
> 
> 
> Description
> -------
> 
> https://issues.apache.org/jira/browse/OOZIE-1499
> 
> this is *WIP*, still rough,  just uploading for early review on design.
> 
> 
> too many file changes in this patch,  to help review, describing a bit on 
> design.
> main part is query executor. 
> 
> QueryExecutor>
>    -provides basic API to run query (update query-->executeUpdate(), select 
> query --> get() or getList())
>    -each table (wrk job/action, coord job/action, bundle job/action, sla...) 
> has it's own implementation of query executor. also there is 
> BatchQueryExecutor which allow mutiple queries to run in one transaction.
>    -construct query based on namedQuery name (defined in each Bean), and does 
> cache for performance enhancement
> 
> How to run query>
> currently we instantiate corresponding JPA executor every time, but instead 
> it's changed to access QueryExecutor and pass namedQuery as argument .
> for example, 
> -        jpaService.execute(new 
> CoordActionUpdateForInputCheckJPAExecutor(action));
> +        
> CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION_FOR_INPUTCHECK,
>  action);
> 
> 
> Diffs
> -----
> 
>   trunk/core/src/main/java/org/apache/oozie/BundleActionBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/CoordinatorActionBean.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/CoordinatorJobBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/WorkflowActionBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/WorkflowJobBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/TransitionXCommand.java 
> 1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleJobChangeXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleJobResumeXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleJobSuspendXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleKillXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundlePauseXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleRerunXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleStartXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleStatusUpdateXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleSubmitXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/bundle/BundleUnpauseXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionCheckXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionInputCheckXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionMaterializeCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionReadyXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionStartXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionTimeOutXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordActionUpdateXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordChangeXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordKillXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordMaterializeTransitionXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordPauseXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordPushDependencyCheckXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordRerunXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordResumeXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSubmitXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordSuspendXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/coord/CoordUnpauseXCommand.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/wf/ActionCheckXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/ActionEndXCommand.java 
> 1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/wf/ActionKillXCommand.java 
> 1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/command/wf/ActionStartXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/KillXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/ReRunXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/ResumeXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/SignalXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/SubmitXCommand.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/command/wf/SuspendXCommand.java 
> 1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BatchQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkUpdateDeleteJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkUpdateInsertForCoordActionStartJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkUpdateInsertForCoordActionStatusJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkUpdateInsertJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BundleActionQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BundleActionUpdateJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/BundleJobUpdateJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionUpdateForInputCheckJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionUpdateForModifiedTimeJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionUpdatePushInputCheckJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordActionUpdateStatusJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/CoordJobQueryExecutor.java
>  PRE-CREATION 
>   trunk/core/src/main/java/org/apache/oozie/executor/jpa/QueryExecutor.java 
> PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/SLAEventQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/SLARegistrationQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/SLASummaryQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionGetJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionSubsetGetJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionsGetForJobJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowActionsRunningGetJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobGetActionsJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/WorkflowJobQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/main/java/org/apache/oozie/executor/jpa/sla/SLASummaryUpdateForSLAStatusActualTimesJPAExecutor.java
>  1513182 
>   
> trunk/core/src/main/java/org/apache/oozie/service/CoordMaterializeTriggerService.java
>  1513182 
>   trunk/core/src/main/java/org/apache/oozie/service/JPAService.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/service/StatusTransitService.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/sla/SLACalculatorMemory.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/sla/SLARegistrationBean.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/sla/SLASummaryBean.java 1513182 
>   trunk/core/src/main/java/org/apache/oozie/store/CoordinatorStore.java 
> 1513182 
>   trunk/core/src/main/java/org/apache/oozie/store/WorkflowStore.java 1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/command/coord/TestCoordActionInputCheckXCommand.java
>  1513182 
>   trunk/core/src/test/java/org/apache/oozie/command/wf/TestActionErrors.java 
> 1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/command/wf/TestActionStartXCommand.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBatchQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBulkUpdateDeleteJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBulkUpdateInsertForCoordActionStartJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBulkUpdateInsertForCoordActionStatusJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestBulkUpdateInsertJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionUpdateForInputCheckJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionUpdateForModifiedTimeJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordActionUpdateStatusJPAExecutor.java
>  1513182 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestCoordJobQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestSLARegistrationQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestSLASummaryQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowActionQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/executor/jpa/TestWorkflowJobQueryExecutor.java
>  PRE-CREATION 
>   
> trunk/core/src/test/java/org/apache/oozie/service/TestPauseTransitService.java
>  1513182 
>   trunk/core/src/test/java/org/apache/oozie/servlet/TestV2SLAServlet.java 
> 1513182 
>   trunk/core/src/test/java/org/apache/oozie/test/XDataTestCase.java 1513182 
> 
> Diff: https://reviews.apache.org/r/13612/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ryota Egashira
> 
>

Reply via email to