You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2013/05/15 03:13:31 UTC
svn commit: r1482652 - in /airavata/trunk/modules:
registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/
registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/
registry/airav...
Author: chathuri
Date: Wed May 15 01:13:30 2013
New Revision: 1482652
URL: http://svn.apache.org/r1482652
Log:
updating REST service with new API changes
Added:
airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java
- copied, changed from r1482104, airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ApplicationDescriptorResourceTest.java
Modified:
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExecutionErrorResource.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/GFacJobExecutionError.java
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java
airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java
airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/ResourceUtils.java Wed May 15 01:13:30 2013
@@ -60,6 +60,7 @@ public class ResourceUtils {
properties.put("openjpa.WriteLockLevel", "none");
properties.put("openjpa.LockTimeout", "30000");
properties.put("openjpa.LockManager", "none");
+ properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=60000");
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
}
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java Wed May 15 01:13:30 2013
@@ -2105,7 +2105,7 @@ public class AiravataJPARegistry extends
}
ExecutionErrorResource executionError = createNewExecutionErrorResource(error.getExperimentId(),error,ExecutionErrors.Source.EXPERIMENT);
executionError.save();
- return 0;
+ return executionError.getErrorID();
}
private ExecutionErrorResource createNewExecutionErrorResource(
@@ -2140,7 +2140,7 @@ public class AiravataJPARegistry extends
ExecutionErrorResource executionError = createNewExecutionErrorResource(error.getExperimentId(),error,ExecutionErrors.Source.WORKFLOW);
executionError.setWorkflowDataResource(jpa.getWorker().getExperiment(error.getExperimentId()).getData().getWorkflowInstance(error.getWorkflowInstanceId()));
executionError.save();
- return 0;
+ return executionError.getErrorID();
}
@Override
@@ -2153,7 +2153,7 @@ public class AiravataJPARegistry extends
executionError.setWorkflowDataResource(jpa.getWorker().getExperiment(error.getExperimentId()).getData().getWorkflowInstance(error.getWorkflowInstanceId()));
executionError.setNodeID(error.getNodeId());
executionError.save();
- return 0;
+ return executionError.getErrorID();
}
@Override
@@ -2167,7 +2167,7 @@ public class AiravataJPARegistry extends
executionError.setNodeID(error.getNodeId());
executionError.setGfacJobID(error.getGfacJobId());
executionError.save();
- return 0;
+ return executionError.getErrorID();
}
}
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExecutionErrorResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExecutionErrorResource.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExecutionErrorResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/ExecutionErrorResource.java Wed May 15 01:13:30 2013
@@ -65,16 +65,21 @@ public class ExecutionErrorResource exte
Experiment_Data experiment_data = em.find(Experiment_Data.class, experimentDataResource.getExperimentID());
execution_error.setExperiment_data(experiment_data);
Workflow_Data workflow_data = em.find(Workflow_Data.class, workflowDataResource.getWorkflowInstanceID());
+ execution_error.setExperiment_ID(experiment_data.getExperiment_ID());
execution_error.setWorkflow_Data(workflow_data);
+ execution_error.setWorkflow_instanceID(workflow_data.getWorkflow_instanceID());
execution_error.setError_code(errorCode);
execution_error.setError_date(errorTime);
execution_error.setError_des(errorDes);
execution_error.setError_msg(errorMsg);
execution_error.setSource_type(sourceType);
execution_error.setGfacJobID(gfacJobID);
-
+ em.persist(execution_error);
+ errorID = execution_error.getError_id();
+// System.out.println("Error ID : " + errorID);
em.getTransaction().commit();
em.close();
+
}
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/WorkflowDataResource.java Wed May 15 01:13:30 2013
@@ -39,7 +39,7 @@ public class WorkflowDataResource extend
private final static Logger logger = LoggerFactory.getLogger(WorkflowDataResource.class);
public static final String NODE_DATA = "Node_Data";
public static final String GRAM_DATA = "Gram_Data";
- public static final String NODE_ERROR = "Execution_Error";
+ public static final String EXECUTION_ERROR = "Execution_Error";
private String experimentID;
private String workflowInstanceID;
private String templateName;
@@ -108,6 +108,7 @@ public class WorkflowDataResource extend
case EXECUTION_ERROR:
ExecutionErrorResource executionErrorResource = new ExecutionErrorResource();
executionErrorResource.setWorkflowDataResource(this);
+ return executionErrorResource;
default:
logger.error("Unsupported resource type for workflow data resource.", new IllegalArgumentException());
throw new IllegalArgumentException("Unsupported resource type for workflow data resource.");
@@ -135,7 +136,7 @@ public class WorkflowDataResource extend
q.executeUpdate();
break;
case EXECUTION_ERROR:
- generator = new QueryGenerator(NODE_ERROR);
+ generator = new QueryGenerator(EXECUTION_ERROR);
generator.setParameter(ExecutionErrorConstants.ERROR_ID, name);
q = generator.deleteQuery(em);
q.executeUpdate();
@@ -175,7 +176,7 @@ public class WorkflowDataResource extend
em.close();
return gramDataResource;
case EXECUTION_ERROR:
- generator = new QueryGenerator(NODE_ERROR);
+ generator = new QueryGenerator(EXECUTION_ERROR);
generator.setParameter(ExecutionErrorConstants.ERROR_ID, name);
q = generator.selectQuery(em);
Execution_Error execution_error = (Execution_Error)q.getSingleResult();
@@ -229,7 +230,7 @@ public class WorkflowDataResource extend
}
break;
case EXECUTION_ERROR:
- generator = new QueryGenerator(NODE_ERROR);
+ generator = new QueryGenerator(EXECUTION_ERROR);
generator.setParameter(ExecutionErrorConstants.WORKFLOW_ID, workflowInstanceID);
q = generator.selectQuery(em);
results = q.getResultList();
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-derby.sql Wed May 15 01:13:30 2013
@@ -162,7 +162,7 @@ create table Workflow_Data
experiment_ID varchar(255),
workflow_instanceID varchar(255),
template_name varchar(255),
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(workflow_instanceID),
@@ -176,7 +176,7 @@ create table Node_Data
node_type varchar(255),
inputs BLOB,
outputs BLOB,
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_index int NOT NULL,
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/resources/data-mysql.sql Wed May 15 01:13:30 2013
@@ -160,7 +160,7 @@ create table Workflow_Data
experiment_ID varchar(255),
workflow_instanceID varchar(255),
template_name varchar(255),
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT now() on update now(),
PRIMARY KEY(workflow_instanceID),
@@ -174,7 +174,7 @@ create table Node_Data
node_type varchar(255),
inputs BLOB,
outputs BLOB,
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT now() on update now(),
execution_index int NOT NULL,
Copied: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java (from r1482104, airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ApplicationDescriptorResourceTest.java)
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java?p2=airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java&p1=airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ApplicationDescriptorResourceTest.java&r1=1482104&r2=1482652&rev=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ApplicationDescriptorResourceTest.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/ExecutionErrorResourceTest.java Wed May 15 01:13:30 2013
@@ -1,52 +1,96 @@
/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
package org.apache.airavata.persistance.registry.jpa;
-import org.apache.airavata.persistance.registry.jpa.resources.ApplicationDescriptorResource;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.junit.*;
+import org.apache.airavata.persistance.registry.jpa.resources.*;
+import org.junit.BeforeClass;
+import org.junit.Test;
-public class ApplicationDescriptorResourceTest extends AbstractResourceTest {
+import java.sql.Timestamp;
+import java.util.Calendar;
+
+public class ExecutionErrorResourceTest extends AbstractResourceTest {
private GatewayResource gatewayResource;
+ private ExperimentResource experimentResource;
+ private WorkerResource workerResource;
+ private ExperimentDataResource experimentDataResource;
+ private WorkflowDataResource workflowDataResource;
+ private NodeDataResource nodeDataResource;
@BeforeClass
public void setUp() throws Exception {
super.setUp();
gatewayResource = super.getGatewayResource();
+ workerResource = super.getWorkerResource();
+
+ experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+ experimentResource.setExpID("testExpID");
+ experimentResource.setWorker(workerResource);
+ experimentResource.setProject(new ProjectResource(workerResource, gatewayResource, "testProject"));
+ experimentResource.save();
+
+ experimentDataResource = (ExperimentDataResource) experimentResource.create(ResourceType.EXPERIMENT_DATA);
+ experimentDataResource.setExpName("testExp");
+ experimentDataResource.setUserName(workerResource.getUser());
+ experimentDataResource.save();
+
+ workflowDataResource = (WorkflowDataResource) experimentDataResource.create(ResourceType.WORKFLOW_DATA);
+ workflowDataResource.setWorkflowInstanceID("testWFInstance");
+ workflowDataResource.setTemplateName("testTemplate");
+ workflowDataResource.setExperimentID("testExpID");
+ Calendar calender = Calendar.getInstance();
+ java.util.Date d = calender.getTime();
+ Timestamp timestamp = new Timestamp(d.getTime());
+ workflowDataResource.setLastUpdatedTime(timestamp);
+ workflowDataResource.save();
+
+ nodeDataResource = workflowDataResource.createNodeData("testNodeID");
+ nodeDataResource.setWorkflowDataResource(workflowDataResource);
+ nodeDataResource.setInputs("testInput");
+ nodeDataResource.setOutputs("testOutput");
+ nodeDataResource.setStatus("testStatus");
+ nodeDataResource.save();
}
- @org.junit.Test
+ @Test
public void testSave() throws Exception {
- ApplicationDescriptorResource applicationDescriptorResouce = (ApplicationDescriptorResource) gatewayResource.create(ResourceType.APPLICATION_DESCRIPTOR);
- applicationDescriptorResouce.setHostDescName("testHostDesc");
- applicationDescriptorResouce.setServiceDescName("testServiceDesc");
- applicationDescriptorResouce.setName("testAppDesc");
- applicationDescriptorResouce.setContent("testContent");
- applicationDescriptorResouce.setUpdatedUser("admin");
- applicationDescriptorResouce.save();
+ ExecutionErrorResource executionErrorResource = (ExecutionErrorResource) workflowDataResource.create(ResourceType.EXECUTION_ERROR);
+ executionErrorResource.setErrorCode("testErrorCode");
+ executionErrorResource.setActionTaken("testAction");
+ executionErrorResource.setErrorLocation("testErrorLocation");
+ executionErrorResource.setErrorReference(0);
+ executionErrorResource.setWorkflowDataResource(workflowDataResource);
+
+ executionErrorResource.setExperimentDataResource(experimentDataResource);
+ executionErrorResource.setNodeID(nodeDataResource.getNodeID());
+ executionErrorResource.setGfacJobID("testGfacJobID");
+ executionErrorResource.setErrorDes("testDes");
+ executionErrorResource.setErrorMsg("errorMsg");
+ executionErrorResource.save();
+ System.out.println(executionErrorResource.getErrorID());
- assertTrue("application descriptor saved successfully", gatewayResource.isExists(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc"));
+ assertTrue("application descriptor saved successfully", workflowDataResource.isExists(ResourceType.EXECUTION_ERROR, executionErrorResource.getErrorID()));
- gatewayResource.remove(ResourceType.APPLICATION_DESCRIPTOR, "testAppDesc");
+ workflowDataResource.remove(ResourceType.EXECUTION_ERROR, executionErrorResource.getErrorID());
}
@Override
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/java/org/apache/airavata/persistance/registry/jpa/util/Initialize.java Wed May 15 01:13:30 2013
@@ -271,7 +271,7 @@ public class Initialize {
System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
server = new NetworkServerControl(InetAddress.getByName(Utils.getHost()),
20000,
- Utils.getJDBCUser(), Utils.getJDBCUser());
+ Utils.getJDBCUser(), Utils.getJDBCPassword());
java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
server.start(consoleWriter);
} catch (IOException e) {
Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql (original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/test/resources/data-derby.sql Wed May 15 01:13:30 2013
@@ -162,7 +162,7 @@ create table Workflow_Data
experiment_ID varchar(255),
workflow_instanceID varchar(255),
template_name varchar(255),
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(workflow_instanceID),
@@ -176,7 +176,7 @@ create table Node_Data
node_type varchar(255),
inputs BLOB,
outputs BLOB,
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_index int NOT NULL,
@@ -239,6 +239,14 @@ CREATE TABLE Execution_Error
FOREIGN KEY (experiment_ID) REFERENCES Experiment_Data(experiment_ID) ON DELETE CASCADE
);
+-- CREATE TABLE openjpa_sequence_table
+-- (
+-- id SMALLINT NOT NULL,
+-- sequence_value BIGINT,
+-- PRIMARY KEY (id)
+-- );
+
+
Modified: airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql (original)
+++ airavata/trunk/modules/registry/airavata-registry-test/src/test/resources/data-derby.sql Wed May 15 01:13:30 2013
@@ -162,7 +162,7 @@ create table Workflow_Data
experiment_ID varchar(255),
workflow_instanceID varchar(255),
template_name varchar(255),
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(workflow_instanceID),
@@ -176,7 +176,7 @@ create table Node_Data
node_type varchar(255),
inputs BLOB,
outputs BLOB,
- status varchar(100),
+ status varchar(255),
start_time TIMESTAMP DEFAULT '0000-00-00 00:00:00',
last_update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_index int NOT NULL,
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExecutionError.java Wed May 15 01:13:30 2013
@@ -25,6 +25,12 @@ import java.util.Date;
import org.apache.airavata.registry.api.ExecutionErrors;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
public abstract class ExecutionError {
public ExecutionErrors.Source source;
public Date errorTime;
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/ExperimentExecutionError.java Wed May 15 01:13:30 2013
@@ -21,6 +21,12 @@
package org.apache.airavata.registry.api.workflow;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
public class ExperimentExecutionError extends ExecutionError {
private String experimentId;
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/GFacJobExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/GFacJobExecutionError.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/GFacJobExecutionError.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/GFacJobExecutionError.java Wed May 15 01:13:30 2013
@@ -21,6 +21,12 @@
package org.apache.airavata.registry.api.workflow;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
public class GFacJobExecutionError extends ExecutionError {
private String experimentId;
private String workflowInstanceId;
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/NodeExecutionError.java Wed May 15 01:13:30 2013
@@ -21,6 +21,12 @@
package org.apache.airavata.registry.api.workflow;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
public class NodeExecutionError extends ExecutionError {
private String experimentId;
private String workflowInstanceId;
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowExecutionError.java Wed May 15 01:13:30 2013
@@ -21,6 +21,12 @@
package org.apache.airavata.registry.api.workflow;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
public class WorkflowExecutionError extends ExecutionError {
private String experimentId;
private String workflowInstanceId;
Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java (original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/workflow/WorkflowInstanceNode.java Wed May 15 01:13:30 2013
@@ -30,6 +30,8 @@ import javax.xml.bind.annotation.XmlRoot
public class WorkflowInstanceNode{
private WorkflowExecution workflowInstance;
private String nodeId;
+ private String originalNodeID;
+ private int executionIndex;
public WorkflowInstanceNode() {
}
@@ -55,4 +57,11 @@ public class WorkflowInstanceNode{
this.nodeId = nodeId;
}
+ public String getOriginalNodeID() {
+ return originalNodeID;
+ }
+
+ public int getExecutionIndex() {
+ return executionIndex;
+ }
}
Modified: airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java (original)
+++ airavata/trunk/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java Wed May 15 01:13:30 2013
@@ -141,6 +141,17 @@ public class ResourcePathConstants {
public static final String GET_EXPERIMENT_METAINFORMATION = "get/experiment/metainformation";
public static final String GET_ALL_EXPERIMENT_METAINFORMATION = "get/all/experiment/metainformation";
public static final String SEARCH_EXPERIMENTS = "search/experiments";
+
+ public static final String GET_EXPERIMENT_ERRORS = "experiment/errors";
+ public static final String GET_WORKFLOW_ERRORS = "workflow/errors";
+ public static final String GET_NODE_ERRORS = "node/errors";
+ public static final String GET_GFAC_ERRORS = "gfac/errors";
+ public static final String GET_ALL_GFAC_ERRORS = "gfac/all/errors";
+ public static final String GET_EXECUTION_ERRORS = "execution/errors";
+ public static final String ADD_EXPERIMENT_ERROR = "add/experiment/errors";
+ public static final String ADD_WORKFLOW_ERROR = "add/workflow/errors";
+ public static final String ADD_NODE_ERROR = "add/node/errors";
+ public static final String ADD_GFAC_ERROR = "add/gfac/errors";
}
public final class PublishedWFConstants {
Modified: airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java?rev=1482652&r1=1482651&r2=1482652&view=diff
==============================================================================
--- airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java (original)
+++ airavata/trunk/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java Wed May 15 01:13:30 2013
@@ -22,6 +22,7 @@
package org.apache.airavata.services.registry.rest.resources;
import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.ExecutionErrors;
import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl;
import org.apache.airavata.registry.api.workflow.*;
@@ -1341,5 +1342,265 @@ public class ProvenanceRegistryResource
}
+ /**
+ *
+ * @param experimentId experiment ID
+ * @return
+ */
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getExperimentExecutionErrors(@QueryParam("experimentId") String experimentId) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<ExperimentExecutionError> experimentExecutionErrors = airavataRegistry.getExperimentExecutionErrors(experimentId);
+ if (experimentExecutionErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(experimentExecutionErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+
+ }
+
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getWorkflowExecutionErrors(@QueryParam("experimentId") String experimentId,
+ @QueryParam("workflowInstanceId") String workflowInstanceId) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<WorkflowExecutionError> workflowExecutionErrors = airavataRegistry.getWorkflowExecutionErrors(experimentId, workflowInstanceId);
+ if (workflowExecutionErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(workflowExecutionErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+
+ }
+
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_NODE_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getNodeExecutionErrors(@QueryParam("experimentId") String experimentId,
+ @QueryParam("workflowInstanceId") String workflowInstanceId,
+ @QueryParam("nodeId") String nodeId ) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<NodeExecutionError> nodeExecutionErrors = airavataRegistry.getNodeExecutionErrors(experimentId, workflowInstanceId, nodeId);
+ if (nodeExecutionErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(nodeExecutionErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_NODE_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getGFacJobErrors(@QueryParam("experimentId") String experimentId,
+ @QueryParam("workflowInstanceId") String workflowInstanceId,
+ @QueryParam("nodeId") String nodeId,
+ @QueryParam("gfacJobId") String gfacJobId ) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<GFacJobExecutionError> gFacJobErrors = airavataRegistry.getGFacJobErrors(experimentId, workflowInstanceId, nodeId, gfacJobId);
+ if (gFacJobErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(gFacJobErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_GFAC_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getAllGFacJobErrors(@QueryParam("gfacJobId") String gfacJobId ) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<GFacJobExecutionError> gFacJobErrors = airavataRegistry.getGFacJobErrors(gfacJobId);
+ if (gFacJobErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(gFacJobErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_GFAC_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @GET
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXECUTION_ERRORS)
+ @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ public Response getExecutionErrors(@QueryParam("experimentId") String experimentId,
+ @QueryParam("workflowInstanceId") String workflowInstanceId,
+ @QueryParam("nodeId") String nodeId,
+ @QueryParam("gfacJobId") String gfacJobId,
+ @QueryParam("sourceFilter") ExecutionErrors.Source sourceFilter) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ List<ExecutionError> executionErrors = airavataRegistry.getExecutionErrors(experimentId, workflowInstanceId, nodeId, gfacJobId, sourceFilter);
+ if (executionErrors.size() != 0) {
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(executionErrors);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXECUTION_ERRORS, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @POST
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_EXPERIMENT_ERROR)
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response addExperimentError(ExperimentExecutionError error) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ int errorID = airavataRegistry.addExperimentError(error);
+ if (errorID != 0){
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(errorID);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_EXPERIMENT_ERROR, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @POST
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOW_ERROR)
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response addWorkflowError(WorkflowExecutionError error) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ int errorID = airavataRegistry.addWorkflowExecutionError(error);
+ if (errorID != 0){
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(errorID);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOW_ERROR, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @POST
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_NODE_ERROR)
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response addNodeExecutionError(NodeExecutionError error) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ int errorID = airavataRegistry.addNodeExecutionError(error);
+ if (errorID != 0){
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(errorID);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_NODE_ERROR, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
+
+ @POST
+ @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_GFAC_ERROR)
+ @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
+ @Produces(MediaType.TEXT_PLAIN)
+ public Response addGFacJobExecutionError(GFacJobExecutionError error) {
+ AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
+ try {
+ int errorID = airavataRegistry.addGFacJobExecutionError(error);
+ if (errorID != 0){
+ Response.ResponseBuilder builder = Response.status(Response.Status.OK);
+ builder.entity(errorID);
+ return builder.build();
+ } else {
+ Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
+ return builder.build();
+ }
+ } catch (Throwable e) {
+ return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_GFAC_ERROR, e);
+ } finally {
+ if (airavataRegistry != null) {
+ RegPoolUtils.releaseRegistry(context, airavataRegistry);
+ }
+ }
+ }
}