| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158 |
- #
- # 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 logging
- from .ttypes import *
- from thrift.Thrift import TProcessor
- from thrift.transport import TTransport
- all_structs = []
- class Iface(object):
- """
- Standard base service
- """
- def getName(self):
- """
- Returns a descriptive name of the service
- """
- pass
- def getVersion(self):
- """
- Returns the version of the service
- """
- pass
- def getStatus(self):
- """
- Gets the status of this service
- """
- pass
- def getStatusDetails(self):
- """
- User friendly description of status, such as why the service is in
- the dead or warning state, or what is being started or stopped.
- """
- pass
- def getCounters(self):
- """
- Gets the counters for this service
- """
- pass
- def getCounter(self, key):
- """
- Gets the value of a single counter
- Parameters:
- - key
- """
- pass
- def setOption(self, key, value):
- """
- Sets an option
- Parameters:
- - key
- - value
- """
- pass
- def getOption(self, key):
- """
- Gets an option
- Parameters:
- - key
- """
- pass
- def getOptions(self):
- """
- Gets all options
- """
- pass
- def getCpuProfile(self, profileDurationInSec):
- """
- Returns a CPU profile over the given time interval (client and server
- must agree on the profile format).
- Parameters:
- - profileDurationInSec
- """
- pass
- def aliveSince(self):
- """
- Returns the unix time that the server has been running since
- """
- pass
- def reinitialize(self):
- """
- Tell the server to reload its configuration, reopen log files, etc
- """
- pass
- def shutdown(self):
- """
- Suggest a shutdown to the server
- """
- pass
- class Client(Iface):
- """
- Standard base service
- """
- def __init__(self, iprot, oprot=None):
- self._iprot = self._oprot = iprot
- if oprot is not None:
- self._oprot = oprot
- self._seqid = 0
- def getName(self):
- """
- Returns a descriptive name of the service
- """
- self.send_getName()
- return self.recv_getName()
- def send_getName(self):
- self._oprot.writeMessageBegin('getName', TMessageType.CALL, self._seqid)
- args = getName_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getName(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getName_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getName failed: unknown result")
- def getVersion(self):
- """
- Returns the version of the service
- """
- self.send_getVersion()
- return self.recv_getVersion()
- def send_getVersion(self):
- self._oprot.writeMessageBegin('getVersion', TMessageType.CALL, self._seqid)
- args = getVersion_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getVersion(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getVersion_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getVersion failed: unknown result")
- def getStatus(self):
- """
- Gets the status of this service
- """
- self.send_getStatus()
- return self.recv_getStatus()
- def send_getStatus(self):
- self._oprot.writeMessageBegin('getStatus', TMessageType.CALL, self._seqid)
- args = getStatus_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getStatus(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getStatus_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatus failed: unknown result")
- def getStatusDetails(self):
- """
- User friendly description of status, such as why the service is in
- the dead or warning state, or what is being started or stopped.
- """
- self.send_getStatusDetails()
- return self.recv_getStatusDetails()
- def send_getStatusDetails(self):
- self._oprot.writeMessageBegin('getStatusDetails', TMessageType.CALL, self._seqid)
- args = getStatusDetails_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getStatusDetails(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getStatusDetails_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatusDetails failed: unknown result")
- def getCounters(self):
- """
- Gets the counters for this service
- """
- self.send_getCounters()
- return self.recv_getCounters()
- def send_getCounters(self):
- self._oprot.writeMessageBegin('getCounters', TMessageType.CALL, self._seqid)
- args = getCounters_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getCounters(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getCounters_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounters failed: unknown result")
- def getCounter(self, key):
- """
- Gets the value of a single counter
- Parameters:
- - key
- """
- self.send_getCounter(key)
- return self.recv_getCounter()
- def send_getCounter(self, key):
- self._oprot.writeMessageBegin('getCounter', TMessageType.CALL, self._seqid)
- args = getCounter_args()
- args.key = key
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getCounter(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getCounter_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounter failed: unknown result")
- def setOption(self, key, value):
- """
- Sets an option
- Parameters:
- - key
- - value
- """
- self.send_setOption(key, value)
- self.recv_setOption()
- def send_setOption(self, key, value):
- self._oprot.writeMessageBegin('setOption', TMessageType.CALL, self._seqid)
- args = setOption_args()
- args.key = key
- args.value = value
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_setOption(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = setOption_result()
- result.read(iprot)
- iprot.readMessageEnd()
- return
- def getOption(self, key):
- """
- Gets an option
- Parameters:
- - key
- """
- self.send_getOption(key)
- return self.recv_getOption()
- def send_getOption(self, key):
- self._oprot.writeMessageBegin('getOption', TMessageType.CALL, self._seqid)
- args = getOption_args()
- args.key = key
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getOption(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getOption_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getOption failed: unknown result")
- def getOptions(self):
- """
- Gets all options
- """
- self.send_getOptions()
- return self.recv_getOptions()
- def send_getOptions(self):
- self._oprot.writeMessageBegin('getOptions', TMessageType.CALL, self._seqid)
- args = getOptions_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getOptions(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getOptions_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getOptions failed: unknown result")
- def getCpuProfile(self, profileDurationInSec):
- """
- Returns a CPU profile over the given time interval (client and server
- must agree on the profile format).
- Parameters:
- - profileDurationInSec
- """
- self.send_getCpuProfile(profileDurationInSec)
- return self.recv_getCpuProfile()
- def send_getCpuProfile(self, profileDurationInSec):
- self._oprot.writeMessageBegin('getCpuProfile', TMessageType.CALL, self._seqid)
- args = getCpuProfile_args()
- args.profileDurationInSec = profileDurationInSec
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_getCpuProfile(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = getCpuProfile_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getCpuProfile failed: unknown result")
- def aliveSince(self):
- """
- Returns the unix time that the server has been running since
- """
- self.send_aliveSince()
- return self.recv_aliveSince()
- def send_aliveSince(self):
- self._oprot.writeMessageBegin('aliveSince', TMessageType.CALL, self._seqid)
- args = aliveSince_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def recv_aliveSince(self):
- iprot = self._iprot
- (fname, mtype, rseqid) = iprot.readMessageBegin()
- if mtype == TMessageType.EXCEPTION:
- x = TApplicationException()
- x.read(iprot)
- iprot.readMessageEnd()
- raise x
- result = aliveSince_result()
- result.read(iprot)
- iprot.readMessageEnd()
- if result.success is not None:
- return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "aliveSince failed: unknown result")
- def reinitialize(self):
- """
- Tell the server to reload its configuration, reopen log files, etc
- """
- self.send_reinitialize()
- def send_reinitialize(self):
- self._oprot.writeMessageBegin('reinitialize', TMessageType.ONEWAY, self._seqid)
- args = reinitialize_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- def shutdown(self):
- """
- Suggest a shutdown to the server
- """
- self.send_shutdown()
- def send_shutdown(self):
- self._oprot.writeMessageBegin('shutdown', TMessageType.ONEWAY, self._seqid)
- args = shutdown_args()
- args.write(self._oprot)
- self._oprot.writeMessageEnd()
- self._oprot.trans.flush()
- class Processor(Iface, TProcessor):
- def __init__(self, handler):
- self._handler = handler
- self._processMap = {}
- self._processMap["getName"] = Processor.process_getName
- self._processMap["getVersion"] = Processor.process_getVersion
- self._processMap["getStatus"] = Processor.process_getStatus
- self._processMap["getStatusDetails"] = Processor.process_getStatusDetails
- self._processMap["getCounters"] = Processor.process_getCounters
- self._processMap["getCounter"] = Processor.process_getCounter
- self._processMap["setOption"] = Processor.process_setOption
- self._processMap["getOption"] = Processor.process_getOption
- self._processMap["getOptions"] = Processor.process_getOptions
- self._processMap["getCpuProfile"] = Processor.process_getCpuProfile
- self._processMap["aliveSince"] = Processor.process_aliveSince
- self._processMap["reinitialize"] = Processor.process_reinitialize
- self._processMap["shutdown"] = Processor.process_shutdown
- 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_getName(self, seqid, iprot, oprot):
- args = getName_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getName_result()
- try:
- result.success = self._handler.getName()
- 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("getName", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getVersion(self, seqid, iprot, oprot):
- args = getVersion_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getVersion_result()
- try:
- result.success = self._handler.getVersion()
- 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("getVersion", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getStatus(self, seqid, iprot, oprot):
- args = getStatus_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getStatus_result()
- try:
- result.success = self._handler.getStatus()
- 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("getStatus", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getStatusDetails(self, seqid, iprot, oprot):
- args = getStatusDetails_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getStatusDetails_result()
- try:
- result.success = self._handler.getStatusDetails()
- 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("getStatusDetails", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getCounters(self, seqid, iprot, oprot):
- args = getCounters_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getCounters_result()
- try:
- result.success = self._handler.getCounters()
- 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("getCounters", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getCounter(self, seqid, iprot, oprot):
- args = getCounter_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getCounter_result()
- try:
- result.success = self._handler.getCounter(args.key)
- 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("getCounter", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_setOption(self, seqid, iprot, oprot):
- args = setOption_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = setOption_result()
- try:
- self._handler.setOption(args.key, args.value)
- 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("setOption", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getOption(self, seqid, iprot, oprot):
- args = getOption_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getOption_result()
- try:
- result.success = self._handler.getOption(args.key)
- 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("getOption", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getOptions(self, seqid, iprot, oprot):
- args = getOptions_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getOptions_result()
- try:
- result.success = self._handler.getOptions()
- 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("getOptions", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_getCpuProfile(self, seqid, iprot, oprot):
- args = getCpuProfile_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = getCpuProfile_result()
- try:
- result.success = self._handler.getCpuProfile(args.profileDurationInSec)
- 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("getCpuProfile", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_aliveSince(self, seqid, iprot, oprot):
- args = aliveSince_args()
- args.read(iprot)
- iprot.readMessageEnd()
- result = aliveSince_result()
- try:
- result.success = self._handler.aliveSince()
- 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("aliveSince", msg_type, seqid)
- result.write(oprot)
- oprot.writeMessageEnd()
- oprot.trans.flush()
- def process_reinitialize(self, seqid, iprot, oprot):
- args = reinitialize_args()
- args.read(iprot)
- iprot.readMessageEnd()
- try:
- self._handler.reinitialize()
- except TTransport.TTransportException:
- raise
- except Exception:
- logging.exception('Exception in oneway handler')
- def process_shutdown(self, seqid, iprot, oprot):
- args = shutdown_args()
- args.read(iprot)
- iprot.readMessageEnd()
- try:
- self._handler.shutdown()
- except TTransport.TTransportException:
- raise
- except Exception:
- logging.exception('Exception in oneway handler')
- # HELPER FUNCTIONS AND STRUCTURES
- class getName_args(object):
- 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
- 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('getName_args')
- 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(getName_args)
- getName_args.thrift_spec = (
- )
- class getName_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.STRING:
- self.success = 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('getName_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRING, 0)
- oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
- 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(getName_result)
- getName_result.thrift_spec = (
- (0, TType.STRING, 'success', 'UTF8', None, ), # 0
- )
- class getVersion_args(object):
- 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
- 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('getVersion_args')
- 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(getVersion_args)
- getVersion_args.thrift_spec = (
- )
- class getVersion_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.STRING:
- self.success = 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('getVersion_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRING, 0)
- oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
- 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(getVersion_result)
- getVersion_result.thrift_spec = (
- (0, TType.STRING, 'success', 'UTF8', None, ), # 0
- )
- class getStatus_args(object):
- 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
- 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('getStatus_args')
- 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(getStatus_args)
- getStatus_args.thrift_spec = (
- )
- class getStatus_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.I32:
- self.success = iprot.readI32()
- 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('getStatus_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.I32, 0)
- oprot.writeI32(self.success)
- 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(getStatus_result)
- getStatus_result.thrift_spec = (
- (0, TType.I32, 'success', None, None, ), # 0
- )
- class getStatusDetails_args(object):
- 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
- 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('getStatusDetails_args')
- 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(getStatusDetails_args)
- getStatusDetails_args.thrift_spec = (
- )
- class getStatusDetails_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.STRING:
- self.success = 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('getStatusDetails_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRING, 0)
- oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
- 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(getStatusDetails_result)
- getStatusDetails_result.thrift_spec = (
- (0, TType.STRING, 'success', 'UTF8', None, ), # 0
- )
- class getCounters_args(object):
- 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
- 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('getCounters_args')
- 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(getCounters_args)
- getCounters_args.thrift_spec = (
- )
- class getCounters_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.MAP:
- self.success = {}
- (_ktype1, _vtype2, _size0) = iprot.readMapBegin()
- for _i4 in range(_size0):
- _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
- _val6 = iprot.readI64()
- self.success[_key5] = _val6
- iprot.readMapEnd()
- 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('getCounters_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.MAP, 0)
- oprot.writeMapBegin(TType.STRING, TType.I64, len(self.success))
- for kiter7, viter8 in self.success.items():
- oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7)
- oprot.writeI64(viter8)
- oprot.writeMapEnd()
- 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(getCounters_result)
- getCounters_result.thrift_spec = (
- (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.I64, None, False), None, ), # 0
- )
- class getCounter_args(object):
- """
- Attributes:
- - key
- """
- def __init__(self, key=None,):
- self.key = key
- 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.key = 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('getCounter_args')
- if self.key is not None:
- oprot.writeFieldBegin('key', TType.STRING, 1)
- oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
- 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(getCounter_args)
- getCounter_args.thrift_spec = (
- None, # 0
- (1, TType.STRING, 'key', 'UTF8', None, ), # 1
- )
- class getCounter_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.I64:
- self.success = iprot.readI64()
- 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('getCounter_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.I64, 0)
- oprot.writeI64(self.success)
- 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(getCounter_result)
- getCounter_result.thrift_spec = (
- (0, TType.I64, 'success', None, None, ), # 0
- )
- class setOption_args(object):
- """
- Attributes:
- - key
- - value
- """
- def __init__(self, key=None, value=None,):
- self.key = key
- self.value = value
- 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.key = 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.value = 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('setOption_args')
- if self.key is not None:
- oprot.writeFieldBegin('key', TType.STRING, 1)
- oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
- oprot.writeFieldEnd()
- if self.value is not None:
- oprot.writeFieldBegin('value', TType.STRING, 2)
- oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value)
- 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(setOption_args)
- setOption_args.thrift_spec = (
- None, # 0
- (1, TType.STRING, 'key', 'UTF8', None, ), # 1
- (2, TType.STRING, 'value', 'UTF8', None, ), # 2
- )
- class setOption_result(object):
- 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
- 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('setOption_result')
- 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(setOption_result)
- setOption_result.thrift_spec = (
- )
- class getOption_args(object):
- """
- Attributes:
- - key
- """
- def __init__(self, key=None,):
- self.key = key
- 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.key = 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('getOption_args')
- if self.key is not None:
- oprot.writeFieldBegin('key', TType.STRING, 1)
- oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
- 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(getOption_args)
- getOption_args.thrift_spec = (
- None, # 0
- (1, TType.STRING, 'key', 'UTF8', None, ), # 1
- )
- class getOption_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.STRING:
- self.success = 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('getOption_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRING, 0)
- oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
- 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(getOption_result)
- getOption_result.thrift_spec = (
- (0, TType.STRING, 'success', 'UTF8', None, ), # 0
- )
- class getOptions_args(object):
- 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
- 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('getOptions_args')
- 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(getOptions_args)
- getOptions_args.thrift_spec = (
- )
- class getOptions_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.MAP:
- self.success = {}
- (_ktype10, _vtype11, _size9) = iprot.readMapBegin()
- for _i13 in range(_size9):
- _key14 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
- _val15 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
- self.success[_key14] = _val15
- iprot.readMapEnd()
- 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('getOptions_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.MAP, 0)
- oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.success))
- for kiter16, viter17 in self.success.items():
- oprot.writeString(kiter16.encode('utf-8') if sys.version_info[0] == 2 else kiter16)
- oprot.writeString(viter17.encode('utf-8') if sys.version_info[0] == 2 else viter17)
- oprot.writeMapEnd()
- 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(getOptions_result)
- getOptions_result.thrift_spec = (
- (0, TType.MAP, 'success', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 0
- )
- class getCpuProfile_args(object):
- """
- Attributes:
- - profileDurationInSec
- """
- def __init__(self, profileDurationInSec=None,):
- self.profileDurationInSec = profileDurationInSec
- 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.I32:
- self.profileDurationInSec = iprot.readI32()
- 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('getCpuProfile_args')
- if self.profileDurationInSec is not None:
- oprot.writeFieldBegin('profileDurationInSec', TType.I32, 1)
- oprot.writeI32(self.profileDurationInSec)
- 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(getCpuProfile_args)
- getCpuProfile_args.thrift_spec = (
- None, # 0
- (1, TType.I32, 'profileDurationInSec', None, None, ), # 1
- )
- class getCpuProfile_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.STRING:
- self.success = 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('getCpuProfile_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.STRING, 0)
- oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
- 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(getCpuProfile_result)
- getCpuProfile_result.thrift_spec = (
- (0, TType.STRING, 'success', 'UTF8', None, ), # 0
- )
- class aliveSince_args(object):
- 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
- 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('aliveSince_args')
- 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(aliveSince_args)
- aliveSince_args.thrift_spec = (
- )
- class aliveSince_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.I64:
- self.success = iprot.readI64()
- 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('aliveSince_result')
- if self.success is not None:
- oprot.writeFieldBegin('success', TType.I64, 0)
- oprot.writeI64(self.success)
- 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(aliveSince_result)
- aliveSince_result.thrift_spec = (
- (0, TType.I64, 'success', None, None, ), # 0
- )
- class reinitialize_args(object):
- 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
- 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('reinitialize_args')
- 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(reinitialize_args)
- reinitialize_args.thrift_spec = (
- )
- class shutdown_args(object):
- 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
- 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('shutdown_args')
- 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(shutdown_args)
- shutdown_args.thrift_spec = (
- )
- fix_spec(all_structs)
- del all_structs
|