airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Qos per queue: que1=qos1,que2=qos2,que3=qos3
Date Fri, 05 Aug 2016 22:49:49 GMT
Repository: airavata
Updated Branches:
  refs/heads/hotfix-for-allocation f831fedf0 -> 9bc25f9a1


Qos per queue: que1=qos1,que2=qos2,que3=qos3


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

Branch: refs/heads/hotfix-for-allocation
Commit: 9bc25f9a117370dabbea4f4300f6d133feddf062
Parents: f831fed
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Fri Aug 5 18:49:44 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Fri Aug 5 18:49:44 2016 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/core/GFacUtils.java    | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9bc25f9a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 0bda74e..afbf425 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -73,6 +73,8 @@ import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
 import java.security.SecureRandom;
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 //import org.apache.airavata.commons.gfac.type.ActualParameter;
 
@@ -457,12 +459,12 @@ public class GFacUtils {
         }
 
         if (crp.getQualityOfService() != null) {
-            jobDescriptor.setQoS(crp.getQualityOfService());
+            // qos per queue
+            jobDescriptor.setQoS(
+                    getQoS(crp.getQualityOfService(), crp.getPreferredBatchQueue()));
         }
 
-        if (crp.getReservation() != null) {
-            jobDescriptor.setReservation(crp.getReservation());
-        }
+        jobDescriptor.setReservation(crp.getReservation());
         // To make job name alpha numeric
         jobDescriptor.setJobName("A" + String.valueOf(generateJobName()));
         jobDescriptor.setWorkingDirectory(processContext.getWorkingDir());
@@ -634,6 +636,16 @@ public class GFacUtils {
         return jobDescriptor;
     }
 
+    private static String getQoS(String qualityOfService, String preferredBatchQueue) {
+        final String qos = "qos";
+        Pattern pattern = Pattern.compile(preferredBatchQueue + "=(?<" + qos + ">[^,]*)");
+        Matcher matcher = pattern.matcher(qualityOfService);
+        if (matcher.matches()) {
+            return matcher.group(qos);
+        }
+        return null;
+    }
+
     private static int generateJobName() {
         Random random = new Random();
         int i = random.nextInt(Integer.MAX_VALUE);


Mime
View raw message