airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Added qos, reservation registry changes
Date Fri, 05 Aug 2016 23:42:05 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 9bc25f9a1 -> a4716a7b3


Added qos, reservation registry changes


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

Branch: refs/heads/master
Commit: a4716a7b3bdf07645370117edc0b9484d3308dab
Parents: 9bc25f9
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Fri Aug 5 19:41:44 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Fri Aug 5 19:41:44 2016 -0400

----------------------------------------------------------------------
 .../catalog/impl/GwyResourceProfileImpl.java    |  9 ++++
 .../model/ComputeResourcePreference.java        | 43 +++++++++++++++++++
 .../ComputeHostPreferenceResource.java          | 45 ++++++++++++++++++++
 .../app/catalog/util/AppCatalogJPAUtils.java    |  4 ++
 .../util/AppCatalogThriftConversion.java        |  4 ++
 .../src/main/resources/appcatalog-derby.sql     |  4 ++
 .../src/main/resources/appcatalog-mysql.sql     |  4 ++
 7 files changed, 113 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
index da80baf..bbf300a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.registry.core.app.catalog.impl;
 
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
@@ -81,6 +82,10 @@ public class GwyResourceProfileImpl implements GwyResourceProfile {
                     resource.setBatchQueue(preference.getPreferredBatchQueue());
                     resource.setProjectNumber(preference.getAllocationProjectNumber());
                     resource.setScratchLocation(preference.getScratchLocation());
+                    resource.setQualityOfService(preference.getQualityOfService());
+                    resource.setReservation(preference.getReservation());
+                    resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
+                    resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
                     resource.save();
                 }
             }
@@ -137,6 +142,10 @@ public class GwyResourceProfileImpl implements GwyResourceProfile {
                     resource.setScratchLocation(preference.getScratchLocation());
                     resource.setResourceCSToken(preference.getResourceSpecificCredentialStoreToken());
                     resource.setUsageReportingGatewayId(preference.getUsageReportingGatewayId());
+                    resource.setQualityOfService(preference.getQualityOfService());
+                    resource.setReservation(preference.getReservation());
+                    resource.setReservationStartTime(AiravataUtils.getTime(preference.getReservationStartTime()));
+                    resource.setReservationEndTime(AiravataUtils.getTime(preference.getReservationEndTime()));
                     resource.save();
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
index cdbce4e..676aa2d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
@@ -30,6 +30,7 @@ import javax.persistence.IdClass;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
+import java.sql.Timestamp;
 
 @Entity
 @Table(name = "COMPUTE_RESOURCE_PREFERENCE")
@@ -59,6 +60,15 @@ public class ComputeResourcePreference {
     private String computeResourceCSToken;
     @Column(name = "USAGE_REPORTING_GATEWAY_ID")
     private String usageReportingGWId;
+    @Column(name = "QUALITY_OF_SERVICE")
+    private String qualityOfService;
+    @Column(name = "RESERVATION")
+    private String reservation;
+    @Column(name = "RESERVATION_START_TIME")
+    private Timestamp reservationStartTime;
+    @Column(name = "RESERVATION_END_TIME")
+    private Timestamp reservationEndTime;
+
 
     @ManyToOne(cascade= CascadeType.MERGE)
     @JoinColumn(name = "RESOURCE_ID")
@@ -68,6 +78,7 @@ public class ComputeResourcePreference {
     @JoinColumn(name = "GATEWAY_ID")
     private GatewayProfile gatewayProfile;
 
+
     public String getGatewayId() {
         return gatewayId;
     }
@@ -171,4 +182,36 @@ public class ComputeResourcePreference {
     public void setUsageReportingGWId(String usageReportingGWId) {
         this.usageReportingGWId = usageReportingGWId;
     }
+
+    public String getQualityOfService() {
+        return qualityOfService;
+    }
+
+    public void setQualityOfService(String qualityOfService) {
+        this.qualityOfService = qualityOfService;
+    }
+
+    public String getReservation() {
+        return reservation;
+    }
+
+    public void setReservation(String reservation) {
+        this.reservation = reservation;
+    }
+
+    public Timestamp getReservationStartTime() {
+        return reservationStartTime;
+    }
+
+    public void setReservationStartTime(Timestamp reservationStratTime) {
+        this.reservationStartTime = reservationStratTime;
+    }
+
+    public Timestamp getReservationEndTime() {
+        return reservationEndTime;
+    }
+
+    public void setReservationEndTime(Timestamp reservationEndTime) {
+        this.reservationEndTime = reservationEndTime;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
index 6a95f61..67dd77c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
@@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -53,6 +54,10 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
     private String loginUserName;
     private String resourceCSToken;
     private String usageReportingGatewayId;
+    private String qualityOfService;
+    private String reservation;
+    private Timestamp reservationStartTime;
+    private Timestamp reservationEndTime;
 
     private GatewayProfileResource gatewayProfile;
     private ComputeResourceResource computeHostResource;
@@ -161,6 +166,38 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
         this.usageReportingGatewayId = usageReportingGatewayId;
     }
 
+    public String getQualityOfService() {
+        return qualityOfService;
+    }
+
+    public void setQualityOfService(String qualityOfService) {
+        this.qualityOfService = qualityOfService;
+    }
+
+    public String getReservation() {
+        return reservation;
+    }
+
+    public void setReservation(String reservation) {
+        this.reservation = reservation;
+    }
+
+    public Timestamp getReservationStartTime() {
+        return reservationStartTime;
+    }
+
+    public void setReservationStartTime(Timestamp reservationStartTime) {
+        this.reservationStartTime = reservationStartTime;
+    }
+
+    public Timestamp getReservationEndTime() {
+        return reservationEndTime;
+    }
+
+    public void setReservationEndTime(Timestamp reservationEndTime) {
+        this.reservationEndTime = reservationEndTime;
+    }
+
     @Override
     public void remove(Object identifier) throws AppCatalogException {
         HashMap<String, String> ids;
@@ -394,6 +431,10 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
                 existingPreference.setLoginUserName(loginUserName);
                 existingPreference.setComputeResourceCSToken(resourceCSToken);
                 existingPreference.setUsageReportingGWId(usageReportingGatewayId);
+                existingPreference.setQualityOfService(qualityOfService);
+                existingPreference.setReservation(reservation);
+                existingPreference.setReservationStartTime(reservationStartTime);
+                existingPreference.setReservationEndTime(reservationEndTime);
                 em.merge(existingPreference);
             } else {
                 ComputeResourcePreference resourcePreference = new ComputeResourcePreference();
@@ -410,6 +451,10 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
                 resourcePreference.setLoginUserName(loginUserName);
                 resourcePreference.setComputeResourceCSToken(resourceCSToken);
                 resourcePreference.setUsageReportingGWId(usageReportingGatewayId);
+                resourcePreference.setQualityOfService(qualityOfService);
+                resourcePreference.setReservation(reservation);
+                resourcePreference.setReservationStartTime(reservationStartTime);
+                resourcePreference.setReservationEndTime(reservationEndTime);
                 em.persist(resourcePreference);
             }
             em.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
index c839e50..a62259b 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
@@ -873,6 +873,10 @@ public class AppCatalogJPAUtils {
             resource.setUsageReportingGatewayId(o.getUsageReportingGWId());
             resource.setComputeHostResource((ComputeResourceResource) createComputeResource(o.getComputeHostResource()));
             resource.setGatewayProfile((GatewayProfileResource) createGatewayProfile(o.getGatewayProfile()));
+            resource.setQualityOfService(o.getQualityOfService());
+            resource.setReservation(o.getReservation());
+            resource.setReservationStartTime(o.getReservationStartTime());
+            resource.setReservationEndTime(o.getReservationEndTime());
         }
         return resource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
index be31d46..4d73ac6 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
@@ -832,6 +832,10 @@ public class AppCatalogThriftConversion {
         preference.setLoginUserName(resource.getLoginUserName());
         preference.setResourceSpecificCredentialStoreToken(resource.getResourceCSToken());
         preference.setUsageReportingGatewayId(resource.getGatewayId());
+        preference.setQualityOfService(resource.getQualityOfService());
+        preference.setReservation(resource.getReservation());
+        preference.setReservationStartTime(resource.getReservationStartTime().getTime());
+        preference.setReservationEndTime(resource.getReservationEndTime().getTime());
         return preference;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
index 61d06a2..9a23f5e 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
@@ -342,6 +342,10 @@ CREATE TABLE COMPUTE_RESOURCE_PREFERENCE
         LOGIN_USERNAME VARCHAR(255),
         RESOURCE_CS_TOKEN VARCHAR(255),
         USAGE_REPORTING_GATEWAY_ID VARCHAR(255),
+        QUALITY_OF_SERVICE VARCHAR(255),
+        RESERVATION VARCHAR (255),
+        RESERVATION_START_TIME timestamp,
+        RESERVATION_END_TIME timestamp,
         PRIMARY KEY(GATEWAY_ID,RESOURCE_ID),
         FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE,
         FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE

http://git-wip-us.apache.org/repos/asf/airavata/blob/a4716a7b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
index 545ca5c..0aa91a4 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
@@ -341,6 +341,10 @@ CREATE TABLE COMPUTE_RESOURCE_PREFERENCE
         LOGIN_USERNAME VARCHAR(255),
         RESOURCE_CS_TOKEN VARCHAR(255),
         USAGE_REPORTING_GATEWAY_ID VARCHAR(255),
+        QUALITY_OF_SERVICE VARCHAR(255),
+        RESERVATION VARCHAR (255),
+        RESERVATION_START_TIME timestamp,
+        RESERVATION_END_TIME timestamp,
         PRIMARY KEY(GATEWAY_ID,RESOURCE_ID),
         FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE,
         FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE


Mime
View raw message