Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java 
(original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAEventGeneration.java 
Sun Sep  8 02:47:39 2013
@@ -17,10 +17,12 @@
  */
 package org.apache.oozie.sla;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
@@ -28,13 +30,16 @@ import org.apache.oozie.AppType;
 import org.apache.oozie.CoordinatorActionBean;
 import org.apache.oozie.CoordinatorJobBean;
 import org.apache.oozie.ErrorCode;
+import org.apache.oozie.WorkflowActionBean;
 import org.apache.oozie.WorkflowJobBean;
 import org.apache.oozie.client.CoordinatorAction;
 import org.apache.oozie.client.CoordinatorJob;
 import org.apache.oozie.client.OozieClient;
+import org.apache.oozie.client.WorkflowAction;
 import org.apache.oozie.client.WorkflowJob;
 import org.apache.oozie.client.event.Event;
 import org.apache.oozie.client.event.JobEvent;
+import org.apache.oozie.client.event.SLAEvent;
 import org.apache.oozie.client.event.SLAEvent.SLAStatus;
 import org.apache.oozie.client.event.SLAEvent.EventStatus;
 import org.apache.oozie.client.rest.RestConstants;
@@ -50,15 +55,22 @@ import org.apache.oozie.command.wf.Start
 import org.apache.oozie.command.wf.SubmitXCommand;
 import org.apache.oozie.event.CoordinatorActionEvent;
 import org.apache.oozie.event.listener.JobEventListener;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor.UpdateEntry;
 import org.apache.oozie.executor.jpa.CoordActionGetJPAExecutor;
-import org.apache.oozie.executor.jpa.CoordActionUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.CoordActionQueryExecutor;
+import org.apache.oozie.executor.jpa.CoordActionQueryExecutor.CoordActionQuery;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor;
+import 
org.apache.oozie.executor.jpa.WorkflowActionQueryExecutor.WorkflowActionQuery;
+import org.apache.oozie.executor.jpa.WorkflowActionsGetForJobJPAExecutor;
 import org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor;
 import org.apache.oozie.executor.jpa.WorkflowJobInsertJPAExecutor;
-import org.apache.oozie.executor.jpa.WorkflowJobUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor.WorkflowJobQuery;
 import org.apache.oozie.executor.jpa.sla.SLASummaryGetJPAExecutor;
 import org.apache.oozie.service.EventHandlerService;
 import org.apache.oozie.service.JPAService;
 import org.apache.oozie.service.Services;
+import org.apache.oozie.service.EventHandlerService.EventWorker;
 import org.apache.oozie.sla.listener.SLAJobEventListener;
 import org.apache.oozie.sla.service.SLAService;
 import org.apache.oozie.test.XDataTestCase;
@@ -189,7 +201,7 @@ public class TestSLAEventGeneration exte
         WorkflowJobBean wfBean = jpaService.execute(new 
WorkflowJobGetJPAExecutor(jobId));
         // set job status to succeeded, so rerun doesn't fail
         wfBean.setStatus(WorkflowJob.Status.SUCCEEDED);
-        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfBean));
+        
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_STATUS_MODTIME,
 wfBean);
 
         // change conf for rerun
         cal.setTime(new Date());
@@ -267,7 +279,7 @@ public class TestSLAEventGeneration exte
         WorkflowJobBean wfBean = jpaService.execute(new 
WorkflowJobGetJPAExecutor(jobId));
         // set job status to succeeded, so rerun doesn't fail
         wfBean.setStatus(WorkflowJob.Status.SUCCEEDED);
-        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfBean));
+        
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_STATUS_MODTIME,
 wfBean);
 
         // change conf for rerun
         cal.setTime(new Date());
@@ -395,8 +407,7 @@ public class TestSLAEventGeneration exte
 
         // test that sla processes the Job Event from Start command
         action.setStatus(CoordinatorAction.Status.SUBMITTED);
-        final CoordActionUpdateJPAExecutor writeCmd = new 
CoordActionUpdateJPAExecutor(action);
-        jpa.execute(writeCmd);
+        
CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION_STATUS_PENDING_TIME,
 action);
         new CoordActionStartXCommand(actionId, getTestUser(), appName, 
jobId).call();
         slaEvent = slas.getSLACalculator().get(actionId);
         slaEvent.setEventProcessed(0); //resetting for testing sla event
@@ -438,7 +449,7 @@ public class TestSLAEventGeneration exte
                 "coord-action-sla1.xml", 0);
         // reset dummy externalId set by above test method
         action.setExternalId(null);
-        jpa.execute(new CoordActionUpdateJPAExecutor(action));
+        
CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION,
 action);
         services.get(SLAService.class).addRegistrationEvent(
                 TestSLAService._createSLARegistration(action.getId(), 
AppType.COORDINATOR_ACTION));
 
@@ -560,8 +571,8 @@ public class TestSLAEventGeneration exte
         // job must already be killed (test xml) so set some status for KillX 
to work
         JPAService jpaService = Services.get().get(JPAService.class);
         WorkflowJobBean wf = jpaService.execute(new 
WorkflowJobGetJPAExecutor(jobId));
-        wf.setStatus(WorkflowJob.Status.FAILED);
-        jpaService.execute(new WorkflowJobUpdateJPAExecutor(wf));
+        wf.setStatus(WorkflowJob.Status.RUNNING);
+        
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_STATUS_MODTIME,
 wf);
         new KillXCommand(jobId).call();
         waitForEventGeneration(1000); //wait for wf-action kill event to 
generate
         Thread.sleep(200); //wait for wf job kill event to generate
@@ -573,7 +584,7 @@ public class TestSLAEventGeneration exte
         assertNotNull(slaEvent.getActualEnd());
         assertEquals(EventStatus.END_MISS, slaEvent.getEventStatus());
         assertEquals(SLAStatus.MISS, slaEvent.getSLAStatus());
-        assertEquals(WorkflowJob.Status.FAILED.name(), 
slaEvent.getJobStatus());
+        assertEquals(WorkflowJob.Status.KILLED.name(), 
slaEvent.getJobStatus());
     }
 
 }

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetJPAExecutor.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetJPAExecutor.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetJPAExecutor.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetJPAExecutor.java
 Sun Sep  8 02:47:39 2013
@@ -23,8 +23,8 @@ import java.util.List;
 
 import org.apache.oozie.AppType;
 import org.apache.oozie.client.rest.JsonBean;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor;
 import org.apache.oozie.executor.jpa.JPAExecutorException;
-import org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor;
 import org.apache.oozie.executor.jpa.sla.SLARegistrationGetJPAExecutor;
 import org.apache.oozie.service.JPAService;
 import org.apache.oozie.service.Services;
@@ -80,8 +80,7 @@ public class TestSLARegistrationGetJPAEx
             assertNotNull(jpaService);
             List<JsonBean> insert = new ArrayList<JsonBean>();
             insert.add(reg);
-            SLACalculationInsertUpdateJPAExecutor slaInsertCmd = new 
SLACalculationInsertUpdateJPAExecutor(insert, null);
-            jpaService.execute(slaInsertCmd);
+            
BatchQueryExecutor.getInstance().executeBatchInsertUpdateDelete(insert, null, 
null);
         }
         catch (JPAExecutorException je) {
             fail("Unable to insert the test sla registration record to table");

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetRecordsOnRestartJPAExecutor.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetRecordsOnRestartJPAExecutor.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetRecordsOnRestartJPAExecutor.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLARegistrationGetRecordsOnRestartJPAExecutor.java
 Sun Sep  8 02:47:39 2013
@@ -22,7 +22,7 @@ import java.util.Date;
 import java.util.List;
 
 import org.apache.oozie.client.rest.JsonBean;
-import org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor;
 import 
org.apache.oozie.executor.jpa.sla.SLARegistrationGetOnRestartJPAExecutor;
 import org.apache.oozie.service.JPAService;
 import org.apache.oozie.service.Services;
@@ -59,8 +59,7 @@ public class TestSLARegistrationGetRecor
         JPAService jpaService = Services.get().get(JPAService.class);
         List<JsonBean> insert = new ArrayList<JsonBean>();
         insert.add(reg);
-        SLACalculationInsertUpdateJPAExecutor slaInsertCmd = new 
SLACalculationInsertUpdateJPAExecutor(insert, null);
-        jpaService.execute(slaInsertCmd);
+        
BatchQueryExecutor.getInstance().executeBatchInsertUpdateDelete(insert, null, 
null);
         assertNotNull(jpaService);
         SLARegistrationGetOnRestartJPAExecutor readCmd = new 
SLARegistrationGetOnRestartJPAExecutor(jobId);
         SLARegistrationBean bean = jpaService.execute(readCmd);

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAService.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAService.java 
(original)
+++ oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLAService.java Sun 
Sep  8 02:47:39 2013
@@ -31,7 +31,8 @@ import org.apache.oozie.client.event.SLA
 import org.apache.oozie.client.event.SLAEvent.SLAStatus;
 import org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor;
 import org.apache.oozie.executor.jpa.WorkflowJobInsertJPAExecutor;
-import org.apache.oozie.executor.jpa.WorkflowJobUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor.WorkflowJobQuery;
 import org.apache.oozie.executor.jpa.sla.SLARegistrationGetJPAExecutor;
 import org.apache.oozie.executor.jpa.sla.SLASummaryGetJPAExecutor;
 import org.apache.oozie.service.EventHandlerService;
@@ -180,7 +181,8 @@ public class TestSLAService extends XDat
         WorkflowJobBean job2 = 
addRecordToWfJobTable(WorkflowJob.Status.SUCCEEDED, 
WorkflowInstance.Status.SUCCEEDED);
         job2.setEndTime(new Date(System.currentTimeMillis() - 1 * 1800 * 
1000));
         job2.setStartTime(new Date(System.currentTimeMillis() - 1 * 2000 * 
1000));
-        jpaService.execute(new WorkflowJobUpdateJPAExecutor(job2));
+        job2.setLastModifiedTime(new Date());
+        
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_STATUS_INSTANCE_MOD_START_END,
 job2);
         sla = _createSLARegistration(job2.getId(), AppType.WORKFLOW_JOB);
         sla.setExpectedEnd(new Date(System.currentTimeMillis() - 1 * 1500 * 
1000)); // in past but > actual end
         sla.setExpectedDuration(100); //unreasonable to cause MISS

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLASummaryGetOnRestartJPAExecutor.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLASummaryGetOnRestartJPAExecutor.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLASummaryGetOnRestartJPAExecutor.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/sla/TestSLASummaryGetOnRestartJPAExecutor.java
 Sun Sep  8 02:47:39 2013
@@ -24,8 +24,8 @@ import java.util.List;
 
 import org.apache.oozie.AppType;
 import org.apache.oozie.client.rest.JsonBean;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor;
 import org.apache.oozie.executor.jpa.JPAExecutorException;
-import org.apache.oozie.executor.jpa.sla.SLACalculationInsertUpdateJPAExecutor;
 import org.apache.oozie.executor.jpa.sla.SLARegistrationGetJPAExecutor;
 import org.apache.oozie.executor.jpa.sla.SLASummaryGetJPAExecutor;
 import 
org.apache.oozie.executor.jpa.sla.SLASummaryGetRecordsOnRestartJPAExecutor;
@@ -72,8 +72,7 @@ public class TestSLASummaryGetOnRestartJ
         List<JsonBean> insert = new ArrayList<JsonBean>();
         insert.add(sla1);
         insert.add(sla2);
-        SLACalculationInsertUpdateJPAExecutor slaInsertCmd = new 
SLACalculationInsertUpdateJPAExecutor(insert, null);
-        jpaService.execute(slaInsertCmd);
+        
BatchQueryExecutor.getInstance().executeBatchInsertUpdateDelete(insert, null, 
null);
         // get all records modified in last 7 days
         SLASummaryGetRecordsOnRestartJPAExecutor slaGetOnRestart = new 
SLASummaryGetRecordsOnRestartJPAExecutor(7);
         List<SLASummaryBean> beans = jpaService.execute(slaGetOnRestart);

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/test/XDataTestCase.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/test/XDataTestCase.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- oozie/trunk/core/src/test/java/org/apache/oozie/test/XDataTestCase.java 
(original)
+++ oozie/trunk/core/src/test/java/org/apache/oozie/test/XDataTestCase.java Sun 
Sep  8 02:47:39 2013
@@ -32,6 +32,7 @@ import java.util.regex.Matcher;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.oozie.AppType;
 import org.apache.oozie.BundleActionBean;
 import org.apache.oozie.BundleJobBean;
 import org.apache.oozie.CoordinatorActionBean;
@@ -45,6 +46,8 @@ import org.apache.oozie.client.Coordinat
 import org.apache.oozie.client.CoordinatorJob;
 import org.apache.oozie.client.CoordinatorJob.Execution;
 import org.apache.oozie.client.CoordinatorJob.Timeunit;
+import org.apache.oozie.client.event.SLAEvent.EventStatus;
+import org.apache.oozie.client.event.SLAEvent.SLAStatus;
 import org.apache.oozie.client.Job;
 import org.apache.oozie.client.OozieClient;
 import org.apache.oozie.client.SLAEvent;
@@ -54,16 +57,21 @@ import org.apache.oozie.executor.jpa.Bun
 import org.apache.oozie.executor.jpa.BundleJobInsertJPAExecutor;
 import org.apache.oozie.executor.jpa.CoordActionGetJPAExecutor;
 import org.apache.oozie.executor.jpa.CoordActionInsertJPAExecutor;
-import org.apache.oozie.executor.jpa.CoordActionUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.CoordActionQueryExecutor;
+import org.apache.oozie.executor.jpa.CoordActionQueryExecutor.CoordActionQuery;
 import org.apache.oozie.executor.jpa.CoordJobGetJPAExecutor;
 import org.apache.oozie.executor.jpa.CoordJobInsertJPAExecutor;
-import org.apache.oozie.executor.jpa.CoordJobUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.CoordJobQueryExecutor;
+import org.apache.oozie.executor.jpa.CoordJobQueryExecutor.CoordJobQuery;
 import org.apache.oozie.executor.jpa.JPAExecutorException;
 import org.apache.oozie.executor.jpa.SLAEventInsertJPAExecutor;
+import org.apache.oozie.executor.jpa.SLARegistrationQueryExecutor;
+import org.apache.oozie.executor.jpa.SLASummaryQueryExecutor;
 import org.apache.oozie.executor.jpa.WorkflowActionInsertJPAExecutor;
 import org.apache.oozie.executor.jpa.WorkflowJobGetJPAExecutor;
 import org.apache.oozie.executor.jpa.WorkflowJobInsertJPAExecutor;
-import org.apache.oozie.executor.jpa.WorkflowJobUpdateJPAExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor.WorkflowJobQuery;
 import org.apache.oozie.service.JPAService;
 import org.apache.oozie.service.LiteWorkflowStoreService;
 import org.apache.oozie.service.Services;
@@ -71,6 +79,8 @@ import org.apache.oozie.service.UUIDServ
 import org.apache.oozie.service.UUIDService.ApplicationType;
 import org.apache.oozie.service.WorkflowAppService;
 import org.apache.oozie.service.WorkflowStoreService;
+import org.apache.oozie.sla.SLARegistrationBean;
+import org.apache.oozie.sla.SLASummaryBean;
 import org.apache.oozie.util.DateUtils;
 import org.apache.oozie.util.IOUtils;
 import org.apache.oozie.util.XConfiguration;
@@ -546,7 +556,7 @@ public abstract class XDataTestCase exte
             if (wfId != null) {
                 WorkflowJobBean wfJob = jpaService.execute(new 
WorkflowJobGetJPAExecutor(wfId));
                 wfJob.setParentId(action.getId());
-                jpaService.execute(new WorkflowJobUpdateJPAExecutor(wfJob));
+                
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_PARENT_MODIFIED,
 wfJob);
             }
         }
         catch (JPAExecutorException je) {
@@ -623,7 +633,7 @@ public abstract class XDataTestCase exte
         try {
             JPAService jpaService = Services.get().get(JPAService.class);
             assertNotNull(jpaService);
-            jpaService.execute(new WorkflowJobUpdateJPAExecutor(subwfBean));
+            
WorkflowJobQueryExecutor.getInstance().executeUpdate(WorkflowJobQuery.UPDATE_WORKFLOW_PARENT_MODIFIED,
 subwfBean);
         }
         catch (JPAExecutorException je) {
             je.printStackTrace();
@@ -768,6 +778,80 @@ public abstract class XDataTestCase exte
     }
 
     /**
+     * Insert sla summary for test
+     * @param appName application name
+     * @param status  sla status
+     * @return
+     * @throws Exception
+     */
+    protected SLASummaryBean addRecordToSLASummaryTable(String appName, 
SLAStatus status)
+            throws Exception {
+        SLASummaryBean sla = new SLASummaryBean();
+        Date today = new Date();
+        
sla.setId(Services.get().get(UUIDService.class).generateId(ApplicationType.COORDINATOR));
+        sla.setAppName(appName);
+        sla.setAppType(AppType.COORDINATOR_JOB);
+        sla.setNominalTime(today);
+        sla.setExpectedStart(today);
+        sla.setExpectedEnd(today);
+        sla.setExpectedDuration(100);
+        sla.setJobStatus("RUNNING");
+        sla.setSLAStatus(status);
+        sla.setEventStatus(EventStatus.START_MET);
+        sla.setLastModifiedTime(today);
+        sla.setUser("oozie");
+        
sla.setParentId(Services.get().get(UUIDService.class).generateId(ApplicationType.BUNDLE));
+        sla.setEventProcessed(1);
+        sla.setActualStart(today);
+        sla.setActualEnd(today);
+        sla.setActualDuration(100);
+        try {
+            SLASummaryQueryExecutor.getInstance().insert(sla);
+        }
+        catch (JPAExecutorException je) {
+            je.printStackTrace();
+            fail("Unable to insert the test sla event record to table");
+            throw je;
+        }
+        return sla;
+    }
+
+    /**
+     * Insert sla registration for test
+     * @param appName application name
+     * @param status  sla status
+     * @return
+     * @throws Exception
+     */
+    protected SLARegistrationBean addRecordToSLARegistrationTable(String 
appName, SLAStatus status)
+            throws Exception {
+        SLARegistrationBean sla = new SLARegistrationBean();
+        Date today = new Date();
+        
sla.setId(Services.get().get(UUIDService.class).generateId(ApplicationType.COORDINATOR));
+        sla.setAppName(appName);
+        sla.setAppType(AppType.COORDINATOR_JOB);
+        sla.setExpectedDuration(100);
+        sla.setExpectedEnd(today);
+        sla.setExpectedStart(today);
+        sla.setJobData("test-job-data");
+        sla.setNominalTime(today);
+        sla.setNotificationMsg("test-sla-notification-msg");
+        
sla.setParentId(Services.get().get(UUIDService.class).generateId(ApplicationType.BUNDLE));
+        sla.setSlaConfig("alert-events");
+        sla.setUpstreamApps("test-upstream-apps");
+        sla.setUser("oozie");
+        try {
+            SLARegistrationQueryExecutor.getInstance().insert(sla);
+        }
+        catch (JPAExecutorException je) {
+            je.printStackTrace();
+            fail("Unable to insert the test sla registration record to table");
+            throw je;
+        }
+        return sla;
+    }
+
+    /**
      * Insert bundle job for testing.
      *
      * @param jobStatus job status
@@ -866,7 +950,7 @@ public abstract class XDataTestCase exte
 
             CoordinatorJobBean coordJob = jpaService.execute(new 
CoordJobGetJPAExecutor(coordId));
             coordJob.setBundleId(jobId);
-            jpaService.execute(new CoordJobUpdateJPAExecutor(coordJob));
+            
CoordJobQueryExecutor.getInstance().executeUpdate(CoordJobQuery.UPDATE_COORD_JOB_BUNDLEID,
 coordJob);
         }
         catch (JPAExecutorException ex) {
             ex.printStackTrace();
@@ -1454,14 +1538,14 @@ public abstract class XDataTestCase exte
         JPAService jpaService = Services.get().get(JPAService.class);
         CoordinatorActionBean action = jpaService.execute(new 
CoordActionGetJPAExecutor(actionId));
         action.setCreatedTime(new Date(actionCreationTime));
-        jpaService.execute(new CoordActionUpdateJPAExecutor(action));
+        
CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION,
 action);
     }
 
     protected void setMissingDependencies(String actionId, String 
missingDependencies) throws Exception {
         JPAService jpaService = Services.get().get(JPAService.class);
         CoordinatorActionBean action = jpaService.execute(new 
CoordActionGetJPAExecutor(actionId));
         action.setMissingDependencies(missingDependencies);
-        jpaService.execute(new CoordActionUpdateJPAExecutor(action));
+        
CoordActionQueryExecutor.getInstance().executeUpdate(CoordActionQuery.UPDATE_COORD_ACTION,
 action);
     }
 
     protected void modifyCoordForRunning(CoordinatorJobBean coord) throws 
Exception {
@@ -1469,7 +1553,7 @@ public abstract class XDataTestCase exte
         writeToFile(wfXml, getFsTestCaseDir(), "workflow.xml");
         String coordXml = coord.getJobXml();
         coord.setJobXml(coordXml.replace("hdfs:///tmp/workflows/", 
getFsTestCaseDir() + "/workflow.xml"));
-        Services.get().get(JPAService.class).execute(new 
CoordJobUpdateJPAExecutor(coord));
+        
CoordJobQueryExecutor.getInstance().executeUpdate(CoordJobQuery.UPDATE_COORD_JOB,
 coord);
     }
 
 }

Modified: oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java 
(original)
+++ oozie/trunk/core/src/test/java/org/apache/oozie/test/XTestCase.java Sun Sep 
 8 02:47:39 2013
@@ -58,6 +58,15 @@ import org.apache.oozie.WorkflowActionBe
 import org.apache.oozie.WorkflowJobBean;
 import org.apache.oozie.dependency.FSURIHandler;
 import org.apache.oozie.dependency.HCatURIHandler;
+import org.apache.oozie.executor.jpa.BatchQueryExecutor;
+import org.apache.oozie.executor.jpa.BundleActionQueryExecutor;
+import org.apache.oozie.executor.jpa.BundleJobQueryExecutor;
+import org.apache.oozie.executor.jpa.CoordActionQueryExecutor;
+import org.apache.oozie.executor.jpa.CoordJobQueryExecutor;
+import org.apache.oozie.executor.jpa.SLARegistrationQueryExecutor;
+import org.apache.oozie.executor.jpa.SLASummaryQueryExecutor;
+import org.apache.oozie.executor.jpa.WorkflowActionQueryExecutor;
+import org.apache.oozie.executor.jpa.WorkflowJobQueryExecutor;
 import org.apache.oozie.service.ConfigurationService;
 import org.apache.oozie.service.HCatAccessorService;
 import org.apache.oozie.service.HadoopAccessorService;
@@ -358,6 +367,19 @@ public abstract class XTestCase extends 
         super.tearDown();
         RUNNING_TESTCASES.decrementAndGet();
         LAST_TESTCASE_FINISHED.set(System.currentTimeMillis());
+        resetQueryExecutor();
+    }
+
+    private void resetQueryExecutor(){
+        BatchQueryExecutor.destroy();
+        WorkflowJobQueryExecutor.destroy();
+        WorkflowActionQueryExecutor.destroy();
+        CoordJobQueryExecutor.destroy();
+        CoordActionQueryExecutor.destroy();
+        BundleJobQueryExecutor.destroy();
+        BundleActionQueryExecutor.destroy();
+        SLARegistrationQueryExecutor.destroy();
+        SLASummaryQueryExecutor.destroy();
     }
 
     /**

Modified: oozie/trunk/release-log.txt
URL: 
http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1520829&r1=1520828&r2=1520829&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Sun Sep  8 02:47:39 2013
@@ -1,5 +1,6 @@
 -- Oozie 4.1.0 release (trunk - unreleased)
 
+OOZIE-1499 Update only necessary columns and consolidate JPA Executors (ryota)
 OOZIE-1522 SignalX may try to insert transition for a forked node twice (virag)
 OOZIE-1461 provide an option to auto-deploy launcher jar onto HDFS system 
libpath (ryota,virag via virag)
 OOZIE-1520 Sequencefile Reader fails to use doas for reading action data file 
(rohini,mona via mona)


Reply via email to