airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: change job details to CLOB instead of varchar - AIRAVATA-1049
Date Wed, 05 Mar 2014 04:13:43 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 908132809 -> d4ed9c583


change job details to CLOB instead of varchar - AIRAVATA-1049


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d4ed9c58
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d4ed9c58
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d4ed9c58

Branch: refs/heads/master
Commit: d4ed9c58379e44f31c1aedb8ffebc47055b2b4fc
Parents: 9081328
Author: chathuri <chathuri@apache.org>
Authored: Tue Mar 4 23:13:25 2014 -0500
Committer: chathuri <chathuri@apache.org>
Committed: Tue Mar 4 23:13:25 2014 -0500

----------------------------------------------------------------------
 .../src/main/resources/registry-derby.sql               |  2 +-
 .../src/main/resources/registry-mysql.sql               |  4 ++--
 .../airavata/client/samples/CreateLaunchExperiment.java | 12 ++++++------
 .../persistance/registry/jpa/model/JobDetail.java       |  7 ++++---
 .../registry/jpa/resources/JobDetailResource.java       |  8 ++++++--
 .../persistance/registry/jpa/resources/Utils.java       |  2 +-
 .../src/main/resources/registry-derby.sql               |  2 +-
 .../src/main/resources/registry-mysql.sql               |  2 +-
 .../src/test/resources/registry-derby.sql               |  2 +-
 9 files changed, 23 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql b/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
index 7b8fb39..b794ba0 100644
--- a/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
+++ b/airavata-api/airavata-api-server/src/main/resources/registry-derby.sql
@@ -255,7 +255,7 @@ CREATE TABLE JOB_DETAIL
 (
         JOB_ID VARCHAR(255),
         TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
+        JOB_DESCRIPTION CLOB,
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
         COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
         PRIMARY KEY (TASK_ID, JOB_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql b/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
index 1b2039c..494b3c9 100644
--- a/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
+++ b/airavata-api/airavata-api-server/src/main/resources/registry-mysql.sql
@@ -140,7 +140,7 @@ CREATE TABLE EXPERIMENT
         WORKFLOW_EXECUTION_ID VARCHAR(255),
         PRIMARY KEY(EXPERIMENT_ID),
         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-        FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(EXECUTION_USER) ON DELETE CASCADE,
+--        FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(EXECUTION_USER) ON DELETE CASCADE,
         FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
 );
 
@@ -237,7 +237,7 @@ CREATE TABLE JOB_DETAIL
 (
         JOB_ID VARCHAR(255),
         TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
+        JOB_DESCRIPTION LONGTEXT,
         CREATION_TIME TIMESTAMP DEFAULT NOW(),
         COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
         PRIMARY KEY (TASK_ID, JOB_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 0c5e351..63184d3 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -65,11 +65,11 @@ public class CreateLaunchExperiment {
             System.out.println("Experiment ID : " + expId);
             launchExperiment(airavata, expId);
             System.out.println("Launched successfully");
-            try {
-                Thread.sleep(20000);
-            } catch (InterruptedException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
-            }
+//            try {
+//                Thread.sleep(20000);
+//            } catch (InterruptedException e) {
+//                e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+//            }
             Thread monitor = (new Thread(){
                  public void run() {
                      Map<String, JobStatus> jobStatuses = null;
@@ -97,7 +97,7 @@ public class CreateLaunchExperiment {
                      }
                  }
             });
-            monitor.start();
+//            monitor.start();
             try {
                 monitor.join();
             } catch (InterruptedException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
index ba718a6..b399400 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/model/JobDetail.java
@@ -35,7 +35,8 @@ public class JobDetail {
     @Column(name = "TASK_ID")
     private String taskId;
     @Column(name = "JOB_DESCRIPTION")
-    private String jobDescription;
+    @Lob
+    private char[] jobDescription;
     @Column(name = "CREATION_TIME")
     private Timestamp creationTime;
     @Column(name = "COMPUTE_RESOURCE_CONSUMED")
@@ -62,11 +63,11 @@ public class JobDetail {
         this.taskId = taskId;
     }
 
-    public String getJobDescription() {
+    public char[] getJobDescription() {
         return jobDescription;
     }
 
-    public void setJobDescription(String jobDescription) {
+    public void setJobDescription(char[] jobDescription) {
         this.jobDescription = jobDescription;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
index bb120ca..f66ff84 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/JobDetailResource.java
@@ -223,14 +223,18 @@ public class JobDetailResource extends AbstractResource {
         jobDetail.setTask(taskDetail);
         jobDetail.setTaskId(taskDetailResource.getTaskId());
         jobDetail.setCreationTime(creationTime);
-        jobDetail.setJobDescription(jobDescription);
+        if (jobDescription != null){
+            jobDetail.setJobDescription(jobDescription.toCharArray());
+        }
         jobDetail.setComputeResourceConsumed(computeResourceConsumed);
         if (existingJobDetail != null){
             existingJobDetail.setJobId(jobId);
             existingJobDetail.setTask(taskDetail);
             existingJobDetail.setTaskId(taskDetailResource.getTaskId());
             existingJobDetail.setCreationTime(creationTime);
-            existingJobDetail.setJobDescription(jobDescription);
+            if (jobDescription != null){
+                existingJobDetail.setJobDescription(jobDescription.toCharArray());
+            }
             existingJobDetail.setComputeResourceConsumed(computeResourceConsumed);
             jobDetail = em.merge(existingJobDetail);
         }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
index d90cefe..9d96f51 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/resources/Utils.java
@@ -747,7 +747,7 @@ public class Utils {
         if (o != null){
             TaskDetailResource taskDetailResource = (TaskDetailResource)createTaskDetail(o.getTask());
             jobDetailResource.setTaskDetailResource(taskDetailResource);
-            jobDetailResource.setJobDescription(o.getJobDescription());
+            jobDetailResource.setJobDescription(new String(o.getJobDescription()));
             jobDetailResource.setJobId(o.getJobId());
             jobDetailResource.setCreationTime(o.getCreationTime());
             jobDetailResource.setComputeResourceConsumed(o.getComputeResourceConsumed());

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
index 7b8fb39..b794ba0 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-derby.sql
@@ -255,7 +255,7 @@ CREATE TABLE JOB_DETAIL
 (
         JOB_ID VARCHAR(255),
         TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
+        JOB_DESCRIPTION CLOB,
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
         COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
         PRIMARY KEY (TASK_ID, JOB_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
index b5e716a..494b3c9 100644
--- a/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
+++ b/modules/registry/airavata-jpa-registry/src/main/resources/registry-mysql.sql
@@ -237,7 +237,7 @@ CREATE TABLE JOB_DETAIL
 (
         JOB_ID VARCHAR(255),
         TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
+        JOB_DESCRIPTION LONGTEXT,
         CREATION_TIME TIMESTAMP DEFAULT NOW(),
         COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
         PRIMARY KEY (TASK_ID, JOB_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4ed9c58/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
index 7b8fb39..b794ba0 100644
--- a/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
+++ b/modules/registry/airavata-jpa-registry/src/test/resources/registry-derby.sql
@@ -255,7 +255,7 @@ CREATE TABLE JOB_DETAIL
 (
         JOB_ID VARCHAR(255),
         TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
+        JOB_DESCRIPTION CLOB,
         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
         COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
         PRIMARY KEY (TASK_ID, JOB_ID),


Mime
View raw message