You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/02/26 17:15:28 UTC

[airavata] 02/03: Revert "Setting custos id to experiment"

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

dimuthuupe pushed a commit to branch custos-integration
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 9b1a0fae1b6c88cfa3ca616e50afe5f62fd6fa3f
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Fri Feb 26 12:13:56 2021 -0500

    Revert "Setting custos id to experiment"
    
    This reverts commit 53ccef40
---
 .../api/server/handler/AiravataServerHandler.java  |   2 +-
 .../airavata/model/experiment/ExperimentModel.java | 113 +--------------------
 .../experiment_model.thrift                        |   3 +-
 3 files changed, 6 insertions(+), 112 deletions(-)

diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index be6a32b..c0004df 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1550,7 +1550,7 @@ public class AiravataServerHandler implements Airavata.Iface {
         logger.info("Api server accepted experiment creation with name {}", experiment.getExperimentName());
         RegistryService.Client regClient = registryClientPool.getResource();
         String custosId = authzToken.getClaimsMap().get(Constants.CUSTOS_ID);
-        experiment.setCustosId(custosId);
+
         try {
             String experimentId = regClient.createExperiment(gatewayId, experiment);
 
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/experiment/ExperimentModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/experiment/ExperimentModel.java
index 39ca143..6d9f40b 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/experiment/ExperimentModel.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/experiment/ExperimentModel.java
@@ -64,7 +64,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
   private static final org.apache.thrift.protocol.TField ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("errors", org.apache.thrift.protocol.TType.LIST, (short)18);
   private static final org.apache.thrift.protocol.TField PROCESSES_FIELD_DESC = new org.apache.thrift.protocol.TField("processes", org.apache.thrift.protocol.TType.LIST, (short)19);
   private static final org.apache.thrift.protocol.TField WORKFLOW_FIELD_DESC = new org.apache.thrift.protocol.TField("workflow", org.apache.thrift.protocol.TType.STRUCT, (short)20);
-  private static final org.apache.thrift.protocol.TField CUSTOS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("custosId", org.apache.thrift.protocol.TType.STRING, (short)21);
 
   private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExperimentModelStandardSchemeFactory();
   private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExperimentModelTupleSchemeFactory();
@@ -89,7 +88,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
   private java.util.List<org.apache.airavata.model.commons.ErrorModel> errors; // optional
   private java.util.List<org.apache.airavata.model.process.ProcessModel> processes; // optional
   private org.apache.airavata.model.workflow.AiravataWorkflow workflow; // optional
-  private java.lang.String custosId; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -116,8 +114,7 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     EXPERIMENT_STATUS((short)17, "experimentStatus"),
     ERRORS((short)18, "errors"),
     PROCESSES((short)19, "processes"),
-    WORKFLOW((short)20, "workflow"),
-    CUSTOS_ID((short)21, "custosId");
+    WORKFLOW((short)20, "workflow");
 
     private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
 
@@ -172,8 +169,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
           return PROCESSES;
         case 20: // WORKFLOW
           return WORKFLOW;
-        case 21: // CUSTOS_ID
-          return CUSTOS_ID;
         default:
           return null;
       }
@@ -217,7 +212,7 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
   private static final int __CREATIONTIME_ISSET_ID = 0;
   private static final int __ENABLEEMAILNOTIFICATION_ISSET_ID = 1;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.DESCRIPTION,_Fields.EXECUTION_ID,_Fields.GATEWAY_EXECUTION_ID,_Fields.GATEWAY_INSTANCE_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.USER_CONFIGURATION_DATA,_Fields.EXPERIMENT_INPUTS,_Fields.EXPERIMENT_OUTPUTS,_Fields.EXPERIMENT_STATUS,_Fields.ERRORS,_Fields.PROCESSES,_Fields.WORKFLOW,_Fields.CUSTOS_ID};
+  private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.DESCRIPTION,_Fields.EXECUTION_ID,_Fields.GATEWAY_EXECUTION_ID,_Fields.GATEWAY_INSTANCE_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.USER_CONFIGURATION_DATA,_Fields.EXPERIMENT_INPUTS,_Fields.EXPERIMENT_OUTPUTS,_Fields.EXPERIMENT_STATUS,_Fields.ERRORS,_Fields.PROCESSES,_Fields.WORKFLOW};
   public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -267,8 +262,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.process.ProcessModel.class))));
     tmpMap.put(_Fields.WORKFLOW, new org.apache.thrift.meta_data.FieldMetaData("workflow", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.workflow.AiravataWorkflow.class)));
-    tmpMap.put(_Fields.CUSTOS_ID, new org.apache.thrift.meta_data.FieldMetaData("custosId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExperimentModel.class, metaDataMap);
   }
@@ -379,9 +372,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     if (other.isSetWorkflow()) {
       this.workflow = new org.apache.airavata.model.workflow.AiravataWorkflow(other.workflow);
     }
-    if (other.isSetCustosId()) {
-      this.custosId = other.custosId;
-    }
   }
 
   public ExperimentModel deepCopy() {
@@ -414,7 +404,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     this.errors = null;
     this.processes = null;
     this.workflow = null;
-    this.custosId = null;
   }
 
   public java.lang.String getExperimentId() {
@@ -973,29 +962,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     }
   }
 
-  public java.lang.String getCustosId() {
-    return this.custosId;
-  }
-
-  public void setCustosId(java.lang.String custosId) {
-    this.custosId = custosId;
-  }
-
-  public void unsetCustosId() {
-    this.custosId = null;
-  }
-
-  /** Returns true if field custosId is set (has been assigned a value) and false otherwise */
-  public boolean isSetCustosId() {
-    return this.custosId != null;
-  }
-
-  public void setCustosIdIsSet(boolean value) {
-    if (!value) {
-      this.custosId = null;
-    }
-  }
-
   public void setFieldValue(_Fields field, java.lang.Object value) {
     switch (field) {
     case EXPERIMENT_ID:
@@ -1158,14 +1124,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       }
       break;
 
-    case CUSTOS_ID:
-      if (value == null) {
-        unsetCustosId();
-      } else {
-        setCustosId((java.lang.String)value);
-      }
-      break;
-
     }
   }
 
@@ -1231,9 +1189,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     case WORKFLOW:
       return getWorkflow();
 
-    case CUSTOS_ID:
-      return getCustosId();
-
     }
     throw new java.lang.IllegalStateException();
   }
@@ -1285,8 +1240,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       return isSetProcesses();
     case WORKFLOW:
       return isSetWorkflow();
-    case CUSTOS_ID:
-      return isSetCustosId();
     }
     throw new java.lang.IllegalStateException();
   }
@@ -1486,15 +1439,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
         return false;
     }
 
-    boolean this_present_custosId = true && this.isSetCustosId();
-    boolean that_present_custosId = true && that.isSetCustosId();
-    if (this_present_custosId || that_present_custosId) {
-      if (!(this_present_custosId && that_present_custosId))
-        return false;
-      if (!this.custosId.equals(that.custosId))
-        return false;
-    }
-
     return true;
   }
 
@@ -1582,10 +1526,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
     if (isSetWorkflow())
       hashCode = hashCode * 8191 + workflow.hashCode();
 
-    hashCode = hashCode * 8191 + ((isSetCustosId()) ? 131071 : 524287);
-    if (isSetCustosId())
-      hashCode = hashCode * 8191 + custosId.hashCode();
-
     return hashCode;
   }
 
@@ -1797,16 +1737,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
         return lastComparison;
       }
     }
-    lastComparison = java.lang.Boolean.valueOf(isSetCustosId()).compareTo(other.isSetCustosId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCustosId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.custosId, other.custosId);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     return 0;
   }
 
@@ -2006,16 +1936,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       }
       first = false;
     }
-    if (isSetCustosId()) {
-      if (!first) sb.append(", ");
-      sb.append("custosId:");
-      if (this.custosId == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.custosId);
-      }
-      first = false;
-    }
     sb.append(")");
     return sb.toString();
   }
@@ -2318,14 +2238,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 21: // CUSTOS_ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.custosId = iprot.readString();
-              struct.setCustosIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -2505,13 +2417,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
           oprot.writeFieldEnd();
         }
       }
-      if (struct.custosId != null) {
-        if (struct.isSetCustosId()) {
-          oprot.writeFieldBegin(CUSTOS_ID_FIELD_DESC);
-          oprot.writeString(struct.custosId);
-          oprot.writeFieldEnd();
-        }
-      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -2578,10 +2483,7 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       if (struct.isSetWorkflow()) {
         optionals.set(13);
       }
-      if (struct.isSetCustosId()) {
-        optionals.set(14);
-      }
-      oprot.writeBitSet(optionals, 15);
+      oprot.writeBitSet(optionals, 14);
       if (struct.isSetCreationTime()) {
         oprot.writeI64(struct.creationTime);
       }
@@ -2660,9 +2562,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       if (struct.isSetWorkflow()) {
         struct.workflow.write(oprot);
       }
-      if (struct.isSetCustosId()) {
-        oprot.writeString(struct.custosId);
-      }
     }
 
     @Override
@@ -2680,7 +2579,7 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
       struct.setUserNameIsSet(true);
       struct.experimentName = iprot.readString();
       struct.setExperimentNameIsSet(true);
-      java.util.BitSet incoming = iprot.readBitSet(15);
+      java.util.BitSet incoming = iprot.readBitSet(14);
       if (incoming.get(0)) {
         struct.creationTime = iprot.readI64();
         struct.setCreationTimeIsSet(true);
@@ -2798,10 +2697,6 @@ public class ExperimentModel implements org.apache.thrift.TBase<ExperimentModel,
         struct.workflow.read(iprot);
         struct.setWorkflowIsSet(true);
       }
-      if (incoming.get(14)) {
-        struct.custosId = iprot.readString();
-        struct.setCustosIdIsSet(true);
-      }
     }
   }
 
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift b/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift
index c0e0121..1941d64 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/experiment_model.thrift
@@ -108,8 +108,7 @@ struct ExperimentModel {
     17: optional list<status_models.ExperimentStatus> experimentStatus,
     18: optional list<airavata_commons.ErrorModel> errors,
     19: optional list<process_model.ProcessModel> processes,
-    20: optional airavata_workflow_model.AiravataWorkflow workflow,
-    21: optional string custosId
+    20: optional airavata_workflow_model.AiravataWorkflow workflow
     }
 
 struct ExperimentSummaryModel {