| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- #
- # Autogenerated by Thrift Compiler (0.13.0)
- #
- # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- #
- # options string: py:new_style
- #
- from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
- from thrift.protocol.TProtocol import TProtocolException
- from thrift.TRecursive import fix_spec
- import sys
- import TCLIService.TCLIService
- import logging
- from .ttypes import *
- from thrift.Thrift import TProcessor
- from thrift.transport import TTransport
- all_structs = []
- class Iface(TCLIService.TCLIService.Iface):
- def GetExecSummary(self, req):
- """
- Parameters:
- - req
- """
- pass
- def GetRuntimeProfile(self, req):
- """
- Parameters:
- - req
- """
- pass
- class Client(TCLIService.TCLIService.Client, Iface):
- def __init__(self, iprot, oprot=None):
- TCLIService.TCLIService.Client.__init__(self, iprot, oprot)
- def GetExecSummary(self, req):
- """
- Parameters:
- - req
- """
- self.send_GetExecSummary(req)
- return self.recv_GetExecSummary()
- def send_GetExecSummary(self, req):
- self._oprot.writeMessageBegin('GetExecSummary', TMessageType.CALL, self._seqid)
- args = GetExecSummary_args()
- args.req = req
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_GetExecSummary(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = GetExecSummary_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "GetExecSummary failed: unknown result")
- def GetRuntimeProfile(self, req):
- """
- Parameters:
- - req
- """
- self.send_GetRuntimeProfile(req)
- return self.recv_GetRuntimeProfile()
- def send_GetRuntimeProfile(self, req):
- self._oprot.writeMessageBegin('GetRuntimeProfile', TMessageType.CALL, self._seqid)
- args = GetRuntimeProfile_args()
- args.req = req
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_GetRuntimeProfile(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = GetRuntimeProfile_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "GetRuntimeProfile failed: unknown result")
- class Processor(TCLIService.TCLIService.Processor, Iface, TProcessor):
- def __init__(self, handler):
- TCLIService.TCLIService.Processor.__init__(self, handler)
- self._processMap["GetExecSummary"] = Processor.process_GetExecSummary
- self._processMap["GetRuntimeProfile"] = Processor.process_GetRuntimeProfile
- self._on_message_begin = None
- def on_message_begin(self, func):
- self._on_message_begin = func
- def process(self, iprot, oprot):
- (name, type, seqid) = iprot.readMessageBegin()
- if self._on_message_begin:
- self._on_message_begin(name, type, seqid)
- if name not in self._processMap:
- iprot.skip(TType.STRUCT)
- iprot.readMessageEnd()
- x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
- oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
- x.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- return
- else:
- self._processMap[name](self, seqid, iprot, oprot)
- return True
- def process_GetExecSummary(self, seqid, iprot, oprot):
- args = GetExecSummary_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = GetExecSummary_result()
- try:
- result.success = self._handler.GetExecSummary(args.req)
- msg_type = TMessageType.REPLY
- except TTransport.TTransportException:
- raise
- except TApplicationException as ex:
- logging.exception('TApplication exception in handler')
- msg_type = TMessageType.EXCEPTION
- result = ex
- except Exception:
- logging.exception('Unexpected exception in handler')
- msg_type = TMessageType.EXCEPTION
- result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
- oprot.writeMessageBegin("GetExecSummary", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_GetRuntimeProfile(self, seqid, iprot, oprot):
- args = GetRuntimeProfile_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = GetRuntimeProfile_result()
- try:
- result.success = self._handler.GetRuntimeProfile(args.req)
- msg_type = TMessageType.REPLY
- except TTransport.TTransportException:
- raise
- except TApplicationException as ex:
- logging.exception('TApplication exception in handler')
- msg_type = TMessageType.EXCEPTION
- result = ex
- except Exception:
- logging.exception('Unexpected exception in handler')
- msg_type = TMessageType.EXCEPTION
- result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
- oprot.writeMessageBegin("GetRuntimeProfile", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- # HELPER FUNCTIONS AND STRUCTURES
- class GetExecSummary_args(object):
- """
- Attributes:
- - req
- """
- def __init__(self, req=None,):
- self.req = req
- 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.STRUCT:
- self.req = TGetExecSummaryReq()
- self.req.read(iprot)
- 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('GetExecSummary_args')
- if self.req is not None:
- oprot.writeFieldBegin('req', TType.STRUCT, 1)
- self.req.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
- def validate(self):
- 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)
- all_structs.append(GetExecSummary_args)
- GetExecSummary_args.thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'req', [TGetExecSummaryReq, None], None, ), # 1
- )
- class GetExecSummary_result(object):
- """
- Attributes:
- - success
- """
- def __init__(self, success=None,):
- self.success = success
- 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 == 0:
- if ftype == TType.STRUCT:
- self.success = TGetExecSummaryResp()
- self.success.read(iprot)
- 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('GetExecSummary_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRUCT, 0)
- self.success.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
- def validate(self):
- 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)
- all_structs.append(GetExecSummary_result)
- GetExecSummary_result.thrift_spec = (
- (0, TType.STRUCT, 'success', [TGetExecSummaryResp, None], None, ), # 0
- )
- class GetRuntimeProfile_args(object):
- """
- Attributes:
- - req
- """
- def __init__(self, req=None,):
- self.req = req
- 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.STRUCT:
- self.req = TGetRuntimeProfileReq()
- self.req.read(iprot)
- 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('GetRuntimeProfile_args')
- if self.req is not None:
- oprot.writeFieldBegin('req', TType.STRUCT, 1)
- self.req.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
- def validate(self):
- 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)
- all_structs.append(GetRuntimeProfile_args)
- GetRuntimeProfile_args.thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'req', [TGetRuntimeProfileReq, None], None, ), # 1
- )
- class GetRuntimeProfile_result(object):
- """
- Attributes:
- - success
- """
- def __init__(self, success=None,):
- self.success = success
- 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 == 0:
- if ftype == TType.STRUCT:
- self.success = TGetRuntimeProfileResp()
- self.success.read(iprot)
- 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('GetRuntimeProfile_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRUCT, 0)
- self.success.write(oprot)
- oprot.writeFieldEnd()
- oprot.writeFieldStop()
- oprot.writeStructEnd()
- def validate(self):
- 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)
- all_structs.append(GetRuntimeProfile_result)
- GetRuntimeProfile_result.thrift_spec = (
- (0, TType.STRUCT, 'success', [TGetRuntimeProfileResp, None], None, ), # 0
- )
- fix_spec(all_structs)
- del all_structs
|