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 2021/06/23 19:44:59 UTC

[airavata] branch airavata-3322 updated (e170341 -> 30e675f)

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

machristie pushed a change to branch airavata-3322
in repository https://gitbox.apache.org/repos/asf/airavata.git.


    from e170341  AIRAVATA-3322 Setting limit and offset defaults at API level
     add b9e44ea  AIRAVATA-3322 Fixing logic to cap the max returned experiments
     new bea9611  AIRAVATA-3322 Regenerating Python stubs
     new 30e675f  AIRAVATA-3322 Index to improve experiment statistics query performance

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../airavata/api/Airavata-remote                   |  8 +-
 .../airavata-python-sdk/airavata/api/Airavata.py   | 54 +++++++++++--
 .../airavata/model/workspace/ttypes.py             | 90 ++++++++++++++++++++++
 .../api/service/handler/RegistryServerHandler.java |  2 +-
 .../experimentCatalog_schema_delta.sql             |  3 +
 5 files changed, 146 insertions(+), 11 deletions(-)

[airavata] 01/02: AIRAVATA-3322 Regenerating Python stubs

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bea9611f40efb9236dbf5a44f673f6cf4c63dee2
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 23 13:06:36 2021 -0400

    AIRAVATA-3322 Regenerating Python stubs
---
 .../airavata/api/Airavata-remote                   |  8 +-
 .../airavata-python-sdk/airavata/api/Airavata.py   | 54 +++++++++++--
 .../airavata/model/workspace/ttypes.py             | 90 ++++++++++++++++++++++
 3 files changed, 142 insertions(+), 10 deletions(-)

diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata-remote b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata-remote
index 2531223..a90b1ba 100755
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata-remote
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata-remote
@@ -50,7 +50,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
     print('   getUserProjects(AuthzToken authzToken, string gatewayId, string userName, i32 limit, i32 offset)')
     print('   searchProjects(AuthzToken authzToken, string gatewayId, string userName,  filters, i32 limit, i32 offset)')
     print('   searchExperiments(AuthzToken authzToken, string gatewayId, string userName,  filters, i32 limit, i32 offset)')
-    print('  ExperimentStatistics getExperimentStatistics(AuthzToken authzToken, string gatewayId, i64 fromTime, i64 toTime, string userName, string applicationName, string resourceHostName)')
+    print('  ExperimentStatistics getExperimentStatistics(AuthzToken authzToken, string gatewayId, i64 fromTime, i64 toTime, string userName, string applicationName, string resourceHostName, i32 limit, i32 offset)')
     print('   getExperimentsInProject(AuthzToken authzToken, string projectId, i32 limit, i32 offset)')
     print('   getUserExperiments(AuthzToken authzToken, string gatewayId, string userName, i32 limit, i32 offset)')
     print('  string createExperiment(AuthzToken authzToken, string gatewayId, ExperimentModel experiment)')
@@ -452,10 +452,10 @@ elif cmd == 'searchExperiments':
     pp.pprint(client.searchExperiments(eval(args[0]), args[1], args[2], eval(args[3]), eval(args[4]), eval(args[5]),))
 
 elif cmd == 'getExperimentStatistics':
-    if len(args) != 7:
-        print('getExperimentStatistics requires 7 args')
+    if len(args) != 9:
+        print('getExperimentStatistics requires 9 args')
         sys.exit(1)
-    pp.pprint(client.getExperimentStatistics(eval(args[0]), args[1], eval(args[2]), eval(args[3]), args[4], args[5], args[6],))
+    pp.pprint(client.getExperimentStatistics(eval(args[0]), args[1], eval(args[2]), eval(args[3]), args[4], args[5], args[6], eval(args[7]), eval(args[8]),))
 
 elif cmd == 'getExperimentsInProject':
     if len(args) != 4:
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata.py
index 94b5d17..de0b91e 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/api/Airavata.py
@@ -459,7 +459,7 @@ class Iface(airavata.base.api.BaseAPI.Iface):
         """
         pass
 
-    def getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName):
+    def getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, limit, offset):
         """
 
         Get Experiment Statistics
@@ -483,6 +483,12 @@ class Iface(airavata.base.api.BaseAPI.Iface):
         @param resourceHostName
               Hostname id substring with which to further filter statistics.
 
+        @param limit
+              Amount of results to be fetched.
+
+        @param offset
+              The starting point of the results to be fetched.
+
 
 
         Parameters:
@@ -493,6 +499,8 @@ class Iface(airavata.base.api.BaseAPI.Iface):
          - userName
          - applicationName
          - resourceHostName
+         - limit
+         - offset
         """
         pass
 
@@ -4913,7 +4921,7 @@ class Client(airavata.base.api.BaseAPI.Client, Iface):
             raise result.ae
         raise TApplicationException(TApplicationException.MISSING_RESULT, "searchExperiments failed: unknown result")
 
-    def getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName):
+    def getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, limit, offset):
         """
 
         Get Experiment Statistics
@@ -4937,6 +4945,12 @@ class Client(airavata.base.api.BaseAPI.Client, Iface):
         @param resourceHostName
               Hostname id substring with which to further filter statistics.
 
+        @param limit
+              Amount of results to be fetched.
+
+        @param offset
+              The starting point of the results to be fetched.
+
 
 
         Parameters:
@@ -4947,11 +4961,13 @@ class Client(airavata.base.api.BaseAPI.Client, Iface):
          - userName
          - applicationName
          - resourceHostName
+         - limit
+         - offset
         """
-        self.send_getExperimentStatistics(authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName)
+        self.send_getExperimentStatistics(authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, limit, offset)
         return self.recv_getExperimentStatistics()
 
-    def send_getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName):
+    def send_getExperimentStatistics(self, authzToken, gatewayId, fromTime, toTime, userName, applicationName, resourceHostName, limit, offset):
         self._oprot.writeMessageBegin('getExperimentStatistics', TMessageType.CALL, self._seqid)
         args = getExperimentStatistics_args()
         args.authzToken = authzToken
@@ -4961,6 +4977,8 @@ class Client(airavata.base.api.BaseAPI.Client, Iface):
         args.userName = userName
         args.applicationName = applicationName
         args.resourceHostName = resourceHostName
+        args.limit = limit
+        args.offset = offset
         args.write(self._oprot)
         self._oprot.writeMessageEnd()
         self._oprot.trans.flush()
@@ -14646,7 +14664,7 @@ class Processor(airavata.base.api.BaseAPI.Processor, Iface, TProcessor):
         iprot.readMessageEnd()
         result = getExperimentStatistics_result()
         try:
-            result.success = self._handler.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName)
+            result.success = self._handler.getExperimentStatistics(args.authzToken, args.gatewayId, args.fromTime, args.toTime, args.userName, args.applicationName, args.resourceHostName, args.limit, args.offset)
             msg_type = TMessageType.REPLY
         except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
             raise
@@ -25020,6 +25038,8 @@ class getExperimentStatistics_args(object):
      - userName
      - applicationName
      - resourceHostName
+     - limit
+     - offset
     """
 
     thrift_spec = (
@@ -25031,9 +25051,11 @@ class getExperimentStatistics_args(object):
         (5, TType.STRING, 'userName', 'UTF8', None, ),  # 5
         (6, TType.STRING, 'applicationName', 'UTF8', None, ),  # 6
         (7, TType.STRING, 'resourceHostName', 'UTF8', None, ),  # 7
+        (8, TType.I32, 'limit', None, 50, ),  # 8
+        (9, TType.I32, 'offset', None, 0, ),  # 9
     )
 
-    def __init__(self, authzToken=None, gatewayId=None, fromTime=None, toTime=None, userName=None, applicationName=None, resourceHostName=None,):
+    def __init__(self, authzToken=None, gatewayId=None, fromTime=None, toTime=None, userName=None, applicationName=None, resourceHostName=None, limit=thrift_spec[8][4], offset=thrift_spec[9][4],):
         self.authzToken = authzToken
         self.gatewayId = gatewayId
         self.fromTime = fromTime
@@ -25041,6 +25063,8 @@ class getExperimentStatistics_args(object):
         self.userName = userName
         self.applicationName = applicationName
         self.resourceHostName = resourceHostName
+        self.limit = limit
+        self.offset = offset
 
     def read(self, iprot):
         if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
@@ -25087,6 +25111,16 @@ class getExperimentStatistics_args(object):
                     self.resourceHostName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                 else:
                     iprot.skip(ftype)
+            elif fid == 8:
+                if ftype == TType.I32:
+                    self.limit = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 9:
+                if ftype == TType.I32:
+                    self.offset = iprot.readI32()
+                else:
+                    iprot.skip(ftype)
             else:
                 iprot.skip(ftype)
             iprot.readFieldEnd()
@@ -25125,6 +25159,14 @@ class getExperimentStatistics_args(object):
             oprot.writeFieldBegin('resourceHostName', TType.STRING, 7)
             oprot.writeString(self.resourceHostName.encode('utf-8') if sys.version_info[0] == 2 else self.resourceHostName)
             oprot.writeFieldEnd()
+        if self.limit is not None:
+            oprot.writeFieldBegin('limit', TType.I32, 8)
+            oprot.writeI32(self.limit)
+            oprot.writeFieldEnd()
+        if self.offset is not None:
+            oprot.writeFieldBegin('offset', TType.I32, 9)
+            oprot.writeI32(self.offset)
+            oprot.writeFieldEnd()
         oprot.writeFieldStop()
         oprot.writeStructEnd()
 
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/workspace/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/workspace/ttypes.py
index b25e05e..2dd3484 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/workspace/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/airavata/model/workspace/ttypes.py
@@ -723,6 +723,96 @@ class Gateway(object):
         return not (self == other)
 
 
+class GatewayUsageReportingCommand(object):
+    """
+    Attributes:
+     - gatewayId
+     - computeResourceId
+     - command
+    """
+
+    thrift_spec = (
+        None,  # 0
+        (1, TType.STRING, 'gatewayId', 'UTF8', None, ),  # 1
+        (2, TType.STRING, 'computeResourceId', 'UTF8', None, ),  # 2
+        (3, TType.STRING, 'command', 'UTF8', None, ),  # 3
+    )
+
+    def __init__(self, gatewayId=None, computeResourceId=None, command=None,):
+        self.gatewayId = gatewayId
+        self.computeResourceId = computeResourceId
+        self.command = command
+
+    def read(self, iprot):
+        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
+            iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec))
+            return
+        iprot.readStructBegin()
+        while True:
+            (fname, ftype, fid) = iprot.readFieldBegin()
+            if ftype == TType.STOP:
+                break
+            if fid == 1:
+                if ftype == TType.STRING:
+                    self.gatewayId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 2:
+                if ftype == TType.STRING:
+                    self.computeResourceId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+                else:
+                    iprot.skip(ftype)
+            elif fid == 3:
+                if ftype == TType.STRING:
+                    self.command = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
+                else:
+                    iprot.skip(ftype)
+            else:
+                iprot.skip(ftype)
+            iprot.readFieldEnd()
+        iprot.readStructEnd()
+
+    def write(self, oprot):
+        if oprot._fast_encode is not None and self.thrift_spec is not None:
+            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
+            return
+        oprot.writeStructBegin('GatewayUsageReportingCommand')
+        if self.gatewayId is not None:
+            oprot.writeFieldBegin('gatewayId', TType.STRING, 1)
+            oprot.writeString(self.gatewayId.encode('utf-8') if sys.version_info[0] == 2 else self.gatewayId)
+            oprot.writeFieldEnd()
+        if self.computeResourceId is not None:
+            oprot.writeFieldBegin('computeResourceId', TType.STRING, 2)
+            oprot.writeString(self.computeResourceId.encode('utf-8') if sys.version_info[0] == 2 else self.computeResourceId)
+            oprot.writeFieldEnd()
+        if self.command is not None:
+            oprot.writeFieldBegin('command', TType.STRING, 3)
+            oprot.writeString(self.command.encode('utf-8') if sys.version_info[0] == 2 else self.command)
+            oprot.writeFieldEnd()
+        oprot.writeFieldStop()
+        oprot.writeStructEnd()
+
+    def validate(self):
+        if self.gatewayId is None:
+            raise TProtocolException(message='Required field gatewayId is unset!')
+        if self.computeResourceId is None:
+            raise TProtocolException(message='Required field computeResourceId is unset!')
+        if self.command is None:
+            raise TProtocolException(message='Required field command is unset!')
+        return
+
+    def __repr__(self):
+        L = ['%s=%r' % (key, value)
+             for key, value in self.__dict__.items()]
+        return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+    def __ne__(self, other):
+        return not (self == other)
+
+
 class Notification(object):
     """
     Attributes:

[airavata] 02/02: AIRAVATA-3322 Index to improve experiment statistics query performance

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 30e675f69408f54f20f82e2955ca9579ea4c3e2a
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 23 15:44:41 2021 -0400

    AIRAVATA-3322 Index to improve experiment statistics query performance
---
 .../0.19-0.20/DeltaScripts/experimentCatalog_schema_delta.sql          | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/registry/release-migration-scripts/0.19-0.20/DeltaScripts/experimentCatalog_schema_delta.sql b/modules/registry/release-migration-scripts/0.19-0.20/DeltaScripts/experimentCatalog_schema_delta.sql
index 5338cbe..89e45dd 100644
--- a/modules/registry/release-migration-scripts/0.19-0.20/DeltaScripts/experimentCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/0.19-0.20/DeltaScripts/experimentCatalog_schema_delta.sql
@@ -30,3 +30,6 @@ CREATE TABLE IF NOT exists `GATEWAY_USAGE_REPORTING_COMMAND` (
 -- AIRAVATA-3369: Convert USER_FRIENDLY_DESCRIPTION from VARCHAR to TEXT (CLOB)
 alter table EXPERIMENT_INPUT modify column USER_FRIENDLY_DESCRIPTION TEXT;
 alter table PROCESS_INPUT modify column USER_FRIENDLY_DESCRIPTION TEXT;
+
+-- AIRAVATA-3322: Index on experiment_status to help statistics queries
+CREATE INDEX IF NOT EXISTS experiment_status_experiment_id_time_of_state_change_state ON EXPERIMENT_STATUS (EXPERIMENT_ID, TIME_OF_STATE_CHANGE, STATE);