示例#1
0
 def deactivate_tracing(self):
     lm_function = lambda request: self.lm_stub.deactivateTracing.future(
         request=request, metadata=self.metadata_call)
     response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                       lm_function)
     if response.isException:
         raise DataClayException(response.exceptionMessage)
示例#2
0
 def check_alive(self):
     lm_function = lambda request: self.lm_stub.checkAlive.future(
         request=request, metadata=self.metadata_call)
     response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                       lm_function)
     if response.isException:
         raise DataClayException(response.exceptionMessage)
示例#3
0
def return_empty_message(resp_obs):
    """Return a protobuf empty message.

    :param resp_obs: string msg with UUID.
    """
    resp = common_messages.EmptyMessage()
    resp_obs(resp)
示例#4
0
 def get_num_objects(self):
     lm_function = lambda request: self.lm_stub.getNumObjects.future(
         request=request, metadata=self.metadata_call)
     response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                       lm_function)
     if response.excInfo.isException:
         raise DataClayException(response.excInfo.exceptionMessage)
     return response.numObjs
示例#5
0
 def is_prefetching_enabled(self):
     lm_function = lambda request: self.lm_stub.isPrefetchingEnabled.future(
         request=request, metadata=self.metadata_call)
     response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                       lm_function)
     if response.excInfo.isException:
         raise DataClayException(response.excInfo.exceptionMessage)
     return response.enabled
示例#6
0
    def deactivate_tracing(self):
        try:
            response = self.ds_stub.deactivateTracing(
                CommonMessages.EmptyMessage())

        except RuntimeError as e:
            raise e

        if response.isException:
            raise DataClayException(response.exceptionMessage)
示例#7
0
    def get_dataclay_id(self):

        lm_function = lambda request: self.lm_stub.getDataClayID.future(
            request=request, metadata=self.metadata_call)
        response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                          lm_function)
        if response.excInfo.isException:
            raise DataClayException(response.exceptionMessage)

        return Utils.get_id(response.dataClayID)
示例#8
0
    def get_traces(self):
        try:
            response = self.ds_stub.getTraces(CommonMessages.EmptyMessage())
        except RuntimeError as e:
            raise e

        result = dict()
        for k, v in response.stubs.items():
            result[k] = v

        return result
示例#9
0
    def get_traces(self):
        lm_function = lambda request: self.lm_stub.getTraces.future(
            request=request, metadata=self.metadata_call)
        response = self._call_logicmodule(CommonMessages.EmptyMessage(),
                                          lm_function)
        if response.excInfo.isException:
            raise DataClayException(response.excInfo.exceptionMessage)

        result = dict()
        for k, v in response.traces.items():
            result[k] = v

        return result