airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] 02/02: AIRAVATA-2806 ComputeResourcePreference default values
Date Fri, 03 Aug 2018 20:07:45 GMT
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 c378737e28b982700fabdc6cc49f3f3eeac26e9e
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Fri Aug 3 16:05:08 2018 -0400

    AIRAVATA-2806 ComputeResourcePreference default values
    
    Fixing up which fields are used from ComputeResourcePreferences for
    defualt values.
---
 .../airavata/gfac/core/context/ProcessContext.java | 38 +++++++---------------
 1 file changed, 11 insertions(+), 27 deletions(-)

diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
index 552028e..b6e9c62 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java
@@ -448,12 +448,8 @@ public class ProcessContext {
 				userComputeResourcePreference != null &&
 				isValid(userComputeResourcePreference.getComputeResourceId())) {
 			return userComputeResourcePreference.getComputeResourceId();
-		} else if (isSetGroupResourceProfile() &&
-					groupComputeResourcePreference != null &&
-					isValid(groupComputeResourcePreference.getComputeResourceId())){
-			return groupComputeResourcePreference.getComputeResourceId();
 		} else {
-			return gatewayComputeResourcePreference.getComputeResourceId();
+			return groupComputeResourcePreference.getComputeResourceId();
 		}
 	}
 
@@ -470,11 +466,8 @@ public class ProcessContext {
                     isValid(groupComputeResourcePreference.getResourceSpecificCredentialStoreToken()))
{
                 return groupComputeResourcePreference.getResourceSpecificCredentialStoreToken();
         } else {
-			if (isValid(gatewayComputeResourcePreference.getResourceSpecificCredentialStoreToken()))
{
-				return gatewayComputeResourcePreference.getResourceSpecificCredentialStoreToken();
-			} else {
-				return gatewayResourceProfile.getCredentialStoreToken();
-			}
+			// FIXME: fallback to credential store token on GroupResourceProfile (see AIRAVATA-2865)
+			return gatewayResourceProfile.getCredentialStoreToken();
 		}
 	}
 
@@ -691,11 +684,12 @@ getComputeResourceCredentialToken());
 	}
 
 	public String getUsageReportingGatewayId() {
-	    if (isSetGroupResourceProfile() &&
-                groupComputeResourcePreference != null &&
-                isValid(groupComputeResourcePreference.getUsageReportingGatewayId())) {
-	        return groupComputeResourcePreference.getUsageReportingGatewayId();
-        }
+	    // FIXME: Should GroupResourceProfiles be able to specify a different usage reporting
gateway id?
+//	    if (isSetGroupResourceProfile() &&
+//                groupComputeResourcePreference != null &&
+//                isValid(groupComputeResourcePreference.getUsageReportingGatewayId())) {
+//	        return groupComputeResourcePreference.getUsageReportingGatewayId();
+//        }
 		return gatewayComputeResourcePreference.getUsageReportingGatewayId();
 	}
 
@@ -722,16 +716,10 @@ getComputeResourceCredentialToken());
 			reservation = userComputeResourcePreference.getReservation();
 			start = userComputeResourcePreference.getReservationStartTime();
 			end = userComputeResourcePreference.getReservationEndTime();
-		} else if (isSetGroupResourceProfile() &&
-						groupComputeResourcePreference != null &&
-						isValid(groupComputeResourcePreference.getReservation())){
+		} else {
 			reservation = groupComputeResourcePreference.getReservation();
 			start = groupComputeResourcePreference.getReservationStartTime();
 			end = groupComputeResourcePreference.getReservationEndTime();
-		} else {
-			reservation = gatewayComputeResourcePreference.getReservation();
-			start = gatewayComputeResourcePreference.getReservationStartTime();
-			end = gatewayComputeResourcePreference.getReservationEndTime();
 		}
 		if (reservation != null && start > 0 && start < end) {
 			long now = Calendar.getInstance().getTimeInMillis();
@@ -747,12 +735,8 @@ getComputeResourceCredentialToken());
 				userComputeResourcePreference != null &&
 				userComputeResourcePreference.getQualityOfService() != null) {
 			return userComputeResourcePreference.getQualityOfService();
-		} else if (isSetGroupResourceProfile() &&
-                        groupComputeResourcePreference != null &&
-                        isValid(groupComputeResourcePreference.getQualityOfService())){
+		} else {
 		    return groupComputeResourcePreference.getQualityOfService();
-        } else {
-			return gatewayComputeResourcePreference.getQualityOfService();
 		}
 	}
 


Mime
View raw message