You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/05/11 14:15:30 UTC

[airavata] 02/02: AIRAVATA-3327 Remove columns and usage of deprecated reservation columns

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit e10b84c8ee75fc46463d0ca2fd83dae88372957a
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon May 11 10:14:39 2020 -0400

    AIRAVATA-3327 Remove columns and usage of deprecated reservation columns
---
 .../airavata/helix/impl/task/TaskContext.java      |  5 ----
 .../database_scripts/appcatalog-mysql.sql          |  3 --
 .../init/03-appcatalog-migrations.sql              |  5 ++++
 .../appcatalog/GroupComputeResourcePrefEntity.java | 33 ----------------------
 .../src/main/resources/appcatalog-derby.sql        |  3 --
 .../next/DeltaScripts/appCatalog_schema_delta.sql  |  5 ++++
 6 files changed, 10 insertions(+), 44 deletions(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
index e57fa1e..7e32c00 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
@@ -647,11 +647,6 @@ public class TaskContext {
             reservation = userComputeResourcePreference.getReservation();
             start = userComputeResourcePreference.getReservationStartTime();
             end = userComputeResourcePreference.getReservationEndTime();
-        } else {
-            // TODO: remove this once we've migrated to groupComputeResourcePreference.getReservations()
-            reservation = groupComputeResourcePreference.getReservation();
-            start = groupComputeResourcePreference.getReservationStartTime();
-            end = groupComputeResourcePreference.getReservationEndTime();
         }
         if (reservation != null && start > 0 && start < end) {
             long now = Calendar.getInstance().getTimeInMillis();
diff --git a/modules/ide-integration/src/main/resources/database_scripts/appcatalog-mysql.sql b/modules/ide-integration/src/main/resources/database_scripts/appcatalog-mysql.sql
index 6c0359c..c6dfbc5 100644
--- a/modules/ide-integration/src/main/resources/database_scripts/appcatalog-mysql.sql
+++ b/modules/ide-integration/src/main/resources/database_scripts/appcatalog-mysql.sql
@@ -600,9 +600,6 @@ CREATE TABLE GROUP_COMPUTE_RESOURCE_PREFERENCE
         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,
         SSH_ACCOUNT_PROVISIONER VARCHAR(255),
         SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO VARCHAR(1000),
         PRIMARY KEY(RESOURCE_ID,GROUP_RESOURCE_PROFILE_ID),
diff --git a/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql b/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
index f6978cb..e4ea6b0 100644
--- a/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
+++ b/modules/ide-integration/src/main/resources/database_scripts/init/03-appcatalog-migrations.sql
@@ -10,3 +10,8 @@ CREATE TABLE IF NOT EXISTS COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID VA
 )ENGINE=InnoDB DEFAULT CHARSET=latin1;
 CREATE INDEX I_CMPTN_Q_RESERVATION_ID ON COMPUTE_RESOURCE_RESERVATION_QUEUE (RESERVATION_ID);
 ALTER TABLE COMPUTE_RESOURCE_RESERVATION ADD CONSTRAINT FK_COMPUTE_RESOURCE_RESERVATION FOREIGN KEY (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) REFERENCES GROUP_COMPUTE_RESOURCE_PREFERENCE (RESOURCE_ID, GROUP_RESOURCE_PROFILE_ID) ON DELETE CASCADE;
+
+-- AIRAVATA-3327: Remove deprecated reservation fields
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column RESERVATION;
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column RESERVATION_START_TIME;
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column RESERVATION_END_TIME;
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefEntity.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefEntity.java
index 22e0673..97383e8 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefEntity.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefEntity.java
@@ -82,15 +82,6 @@ public class GroupComputeResourcePrefEntity implements Serializable {
     @Column(name = "QUALITY_OF_SERVICE")
     private String qualityOfService;
 
-    @Column(name = "RESERVATION")
-    private String reservation;
-
-    @Column(name = "RESERVATION_END_TIME")
-    private Timestamp reservationEndTime;
-
-    @Column(name = "RESERVATION_START_TIME")
-    private Timestamp reservationStartTime;
-
     @Column(name = "RESOURCE_CS_TOKEN")
     private String resourceSpecificCredentialStoreToken;
 
@@ -193,30 +184,6 @@ public class GroupComputeResourcePrefEntity implements Serializable {
         this.qualityOfService = qualityOfService;
     }
 
-    public String getReservation() {
-        return reservation;
-    }
-
-    public void setReservation(String reservation) {
-        this.reservation = reservation;
-    }
-
-    public Timestamp getReservationEndTime() {
-        return reservationEndTime;
-    }
-
-    public void setReservationEndTime(Timestamp reservationEndTime) {
-        this.reservationEndTime = reservationEndTime;
-    }
-
-    public Timestamp getReservationStartTime() {
-        return reservationStartTime;
-    }
-
-    public void setReservationStartTime(Timestamp reservationStartTime) {
-        this.reservationStartTime = reservationStartTime;
-    }
-
     public String getResourceSpecificCredentialStoreToken() {
         return resourceSpecificCredentialStoreToken;
     }
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 afe5fed..ab1bcab 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
@@ -609,9 +609,6 @@ CREATE TABLE GROUP_COMPUTE_RESOURCE_PREFERENCE
         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,
         SSH_ACCOUNT_PROVISIONER VARCHAR(255),
         SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO VARCHAR(1000),
         PRIMARY KEY(RESOURCE_ID,GROUP_RESOURCE_PROFILE_ID),
diff --git a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
index 839c2e1..8092f44 100644
--- a/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
@@ -19,3 +19,8 @@
 --
 
 use app_catalog;
+
+-- AIRAVATA-3327: Remove deprecated reservation fields
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION;
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_START_TIME;
+alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_END_TIME;