BeeswaxService.py 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533
  1. #
  2. # Autogenerated by Thrift Compiler (0.13.0)
  3. #
  4. # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. #
  6. # options string: py:new_style
  7. #
  8. from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
  9. from thrift.protocol.TProtocol import TProtocolException
  10. from thrift.TRecursive import fix_spec
  11. import sys
  12. import logging
  13. from .ttypes import *
  14. from thrift.Thrift import TProcessor
  15. from thrift.transport import TTransport
  16. all_structs = []
  17. class Iface(object):
  18. def query(self, query):
  19. """
  20. Submit a query and return a handle (QueryHandle). The query runs asynchronously.
  21. Parameters:
  22. - query
  23. """
  24. pass
  25. def executeAndWait(self, query, clientCtx):
  26. """
  27. run a query synchronously and return a handle (QueryHandle).
  28. Parameters:
  29. - query
  30. - clientCtx
  31. """
  32. pass
  33. def explain(self, query):
  34. """
  35. Get the query plan for a query.
  36. Parameters:
  37. - query
  38. """
  39. pass
  40. def fetch(self, query_id, start_over, fetch_size):
  41. """
  42. Get the results of a query. This is non-blocking. Caller should check
  43. Results.ready to determine if the results are in yet. The call requests
  44. the batch size of fetch.
  45. Parameters:
  46. - query_id
  47. - start_over
  48. - fetch_size
  49. """
  50. pass
  51. def get_state(self, handle):
  52. """
  53. Get the state of the query
  54. Parameters:
  55. - handle
  56. """
  57. pass
  58. def get_results_metadata(self, handle):
  59. """
  60. Get the result metadata
  61. Parameters:
  62. - handle
  63. """
  64. pass
  65. def echo(self, s):
  66. """
  67. Used to test connection to server. A "noop" command.
  68. Parameters:
  69. - s
  70. """
  71. pass
  72. def dump_config(self):
  73. """
  74. Returns a string representation of the configuration object being used.
  75. Handy for debugging.
  76. """
  77. pass
  78. def get_log(self, context):
  79. """
  80. Get the log messages related to the given context.
  81. Parameters:
  82. - context
  83. """
  84. pass
  85. def get_default_configuration(self, include_hadoop):
  86. """
  87. Parameters:
  88. - include_hadoop
  89. """
  90. pass
  91. def close(self, handle):
  92. """
  93. Parameters:
  94. - handle
  95. """
  96. pass
  97. def clean(self, log_context):
  98. """
  99. Parameters:
  100. - log_context
  101. """
  102. pass
  103. class Client(Iface):
  104. def __init__(self, iprot, oprot=None):
  105. self._iprot = self._oprot = iprot
  106. if oprot is not None:
  107. self._oprot = oprot
  108. self._seqid = 0
  109. def query(self, query):
  110. """
  111. Submit a query and return a handle (QueryHandle). The query runs asynchronously.
  112. Parameters:
  113. - query
  114. """
  115. self.send_query(query)
  116. return self.recv_query()
  117. def send_query(self, query):
  118. self._oprot.writeMessageBegin('query', TMessageType.CALL, self._seqid)
  119. args = query_args()
  120. args.query = query
  121. args.write(self._oprot)
  122. self._oprot.writeMessageEnd()
  123. self._oprot.trans.flush()
  124. def recv_query(self):
  125. iprot = self._iprot
  126. (fname, mtype, rseqid) = iprot.readMessageBegin()
  127. if mtype == TMessageType.EXCEPTION:
  128. x = TApplicationException()
  129. x.read(iprot)
  130. iprot.readMessageEnd()
  131. raise x
  132. result = query_result()
  133. result.read(iprot)
  134. iprot.readMessageEnd()
  135. if result.success is not None:
  136. return result.success
  137. if result.error is not None:
  138. raise result.error
  139. raise TApplicationException(TApplicationException.MISSING_RESULT, "query failed: unknown result")
  140. def executeAndWait(self, query, clientCtx):
  141. """
  142. run a query synchronously and return a handle (QueryHandle).
  143. Parameters:
  144. - query
  145. - clientCtx
  146. """
  147. self.send_executeAndWait(query, clientCtx)
  148. return self.recv_executeAndWait()
  149. def send_executeAndWait(self, query, clientCtx):
  150. self._oprot.writeMessageBegin('executeAndWait', TMessageType.CALL, self._seqid)
  151. args = executeAndWait_args()
  152. args.query = query
  153. args.clientCtx = clientCtx
  154. args.write(self._oprot)
  155. self._oprot.writeMessageEnd()
  156. self._oprot.trans.flush()
  157. def recv_executeAndWait(self):
  158. iprot = self._iprot
  159. (fname, mtype, rseqid) = iprot.readMessageBegin()
  160. if mtype == TMessageType.EXCEPTION:
  161. x = TApplicationException()
  162. x.read(iprot)
  163. iprot.readMessageEnd()
  164. raise x
  165. result = executeAndWait_result()
  166. result.read(iprot)
  167. iprot.readMessageEnd()
  168. if result.success is not None:
  169. return result.success
  170. if result.error is not None:
  171. raise result.error
  172. raise TApplicationException(TApplicationException.MISSING_RESULT, "executeAndWait failed: unknown result")
  173. def explain(self, query):
  174. """
  175. Get the query plan for a query.
  176. Parameters:
  177. - query
  178. """
  179. self.send_explain(query)
  180. return self.recv_explain()
  181. def send_explain(self, query):
  182. self._oprot.writeMessageBegin('explain', TMessageType.CALL, self._seqid)
  183. args = explain_args()
  184. args.query = query
  185. args.write(self._oprot)
  186. self._oprot.writeMessageEnd()
  187. self._oprot.trans.flush()
  188. def recv_explain(self):
  189. iprot = self._iprot
  190. (fname, mtype, rseqid) = iprot.readMessageBegin()
  191. if mtype == TMessageType.EXCEPTION:
  192. x = TApplicationException()
  193. x.read(iprot)
  194. iprot.readMessageEnd()
  195. raise x
  196. result = explain_result()
  197. result.read(iprot)
  198. iprot.readMessageEnd()
  199. if result.success is not None:
  200. return result.success
  201. if result.error is not None:
  202. raise result.error
  203. raise TApplicationException(TApplicationException.MISSING_RESULT, "explain failed: unknown result")
  204. def fetch(self, query_id, start_over, fetch_size):
  205. """
  206. Get the results of a query. This is non-blocking. Caller should check
  207. Results.ready to determine if the results are in yet. The call requests
  208. the batch size of fetch.
  209. Parameters:
  210. - query_id
  211. - start_over
  212. - fetch_size
  213. """
  214. self.send_fetch(query_id, start_over, fetch_size)
  215. return self.recv_fetch()
  216. def send_fetch(self, query_id, start_over, fetch_size):
  217. self._oprot.writeMessageBegin('fetch', TMessageType.CALL, self._seqid)
  218. args = fetch_args()
  219. args.query_id = query_id
  220. args.start_over = start_over
  221. args.fetch_size = fetch_size
  222. args.write(self._oprot)
  223. self._oprot.writeMessageEnd()
  224. self._oprot.trans.flush()
  225. def recv_fetch(self):
  226. iprot = self._iprot
  227. (fname, mtype, rseqid) = iprot.readMessageBegin()
  228. if mtype == TMessageType.EXCEPTION:
  229. x = TApplicationException()
  230. x.read(iprot)
  231. iprot.readMessageEnd()
  232. raise x
  233. result = fetch_result()
  234. result.read(iprot)
  235. iprot.readMessageEnd()
  236. if result.success is not None:
  237. return result.success
  238. if result.error is not None:
  239. raise result.error
  240. if result.error2 is not None:
  241. raise result.error2
  242. raise TApplicationException(TApplicationException.MISSING_RESULT, "fetch failed: unknown result")
  243. def get_state(self, handle):
  244. """
  245. Get the state of the query
  246. Parameters:
  247. - handle
  248. """
  249. self.send_get_state(handle)
  250. return self.recv_get_state()
  251. def send_get_state(self, handle):
  252. self._oprot.writeMessageBegin('get_state', TMessageType.CALL, self._seqid)
  253. args = get_state_args()
  254. args.handle = handle
  255. args.write(self._oprot)
  256. self._oprot.writeMessageEnd()
  257. self._oprot.trans.flush()
  258. def recv_get_state(self):
  259. iprot = self._iprot
  260. (fname, mtype, rseqid) = iprot.readMessageBegin()
  261. if mtype == TMessageType.EXCEPTION:
  262. x = TApplicationException()
  263. x.read(iprot)
  264. iprot.readMessageEnd()
  265. raise x
  266. result = get_state_result()
  267. result.read(iprot)
  268. iprot.readMessageEnd()
  269. if result.success is not None:
  270. return result.success
  271. if result.error is not None:
  272. raise result.error
  273. raise TApplicationException(TApplicationException.MISSING_RESULT, "get_state failed: unknown result")
  274. def get_results_metadata(self, handle):
  275. """
  276. Get the result metadata
  277. Parameters:
  278. - handle
  279. """
  280. self.send_get_results_metadata(handle)
  281. return self.recv_get_results_metadata()
  282. def send_get_results_metadata(self, handle):
  283. self._oprot.writeMessageBegin('get_results_metadata', TMessageType.CALL, self._seqid)
  284. args = get_results_metadata_args()
  285. args.handle = handle
  286. args.write(self._oprot)
  287. self._oprot.writeMessageEnd()
  288. self._oprot.trans.flush()
  289. def recv_get_results_metadata(self):
  290. iprot = self._iprot
  291. (fname, mtype, rseqid) = iprot.readMessageBegin()
  292. if mtype == TMessageType.EXCEPTION:
  293. x = TApplicationException()
  294. x.read(iprot)
  295. iprot.readMessageEnd()
  296. raise x
  297. result = get_results_metadata_result()
  298. result.read(iprot)
  299. iprot.readMessageEnd()
  300. if result.success is not None:
  301. return result.success
  302. if result.error is not None:
  303. raise result.error
  304. raise TApplicationException(TApplicationException.MISSING_RESULT, "get_results_metadata failed: unknown result")
  305. def echo(self, s):
  306. """
  307. Used to test connection to server. A "noop" command.
  308. Parameters:
  309. - s
  310. """
  311. self.send_echo(s)
  312. return self.recv_echo()
  313. def send_echo(self, s):
  314. self._oprot.writeMessageBegin('echo', TMessageType.CALL, self._seqid)
  315. args = echo_args()
  316. args.s = s
  317. args.write(self._oprot)
  318. self._oprot.writeMessageEnd()
  319. self._oprot.trans.flush()
  320. def recv_echo(self):
  321. iprot = self._iprot
  322. (fname, mtype, rseqid) = iprot.readMessageBegin()
  323. if mtype == TMessageType.EXCEPTION:
  324. x = TApplicationException()
  325. x.read(iprot)
  326. iprot.readMessageEnd()
  327. raise x
  328. result = echo_result()
  329. result.read(iprot)
  330. iprot.readMessageEnd()
  331. if result.success is not None:
  332. return result.success
  333. raise TApplicationException(TApplicationException.MISSING_RESULT, "echo failed: unknown result")
  334. def dump_config(self):
  335. """
  336. Returns a string representation of the configuration object being used.
  337. Handy for debugging.
  338. """
  339. self.send_dump_config()
  340. return self.recv_dump_config()
  341. def send_dump_config(self):
  342. self._oprot.writeMessageBegin('dump_config', TMessageType.CALL, self._seqid)
  343. args = dump_config_args()
  344. args.write(self._oprot)
  345. self._oprot.writeMessageEnd()
  346. self._oprot.trans.flush()
  347. def recv_dump_config(self):
  348. iprot = self._iprot
  349. (fname, mtype, rseqid) = iprot.readMessageBegin()
  350. if mtype == TMessageType.EXCEPTION:
  351. x = TApplicationException()
  352. x.read(iprot)
  353. iprot.readMessageEnd()
  354. raise x
  355. result = dump_config_result()
  356. result.read(iprot)
  357. iprot.readMessageEnd()
  358. if result.success is not None:
  359. return result.success
  360. raise TApplicationException(TApplicationException.MISSING_RESULT, "dump_config failed: unknown result")
  361. def get_log(self, context):
  362. """
  363. Get the log messages related to the given context.
  364. Parameters:
  365. - context
  366. """
  367. self.send_get_log(context)
  368. return self.recv_get_log()
  369. def send_get_log(self, context):
  370. self._oprot.writeMessageBegin('get_log', TMessageType.CALL, self._seqid)
  371. args = get_log_args()
  372. args.context = context
  373. args.write(self._oprot)
  374. self._oprot.writeMessageEnd()
  375. self._oprot.trans.flush()
  376. def recv_get_log(self):
  377. iprot = self._iprot
  378. (fname, mtype, rseqid) = iprot.readMessageBegin()
  379. if mtype == TMessageType.EXCEPTION:
  380. x = TApplicationException()
  381. x.read(iprot)
  382. iprot.readMessageEnd()
  383. raise x
  384. result = get_log_result()
  385. result.read(iprot)
  386. iprot.readMessageEnd()
  387. if result.success is not None:
  388. return result.success
  389. if result.error is not None:
  390. raise result.error
  391. raise TApplicationException(TApplicationException.MISSING_RESULT, "get_log failed: unknown result")
  392. def get_default_configuration(self, include_hadoop):
  393. """
  394. Parameters:
  395. - include_hadoop
  396. """
  397. self.send_get_default_configuration(include_hadoop)
  398. return self.recv_get_default_configuration()
  399. def send_get_default_configuration(self, include_hadoop):
  400. self._oprot.writeMessageBegin('get_default_configuration', TMessageType.CALL, self._seqid)
  401. args = get_default_configuration_args()
  402. args.include_hadoop = include_hadoop
  403. args.write(self._oprot)
  404. self._oprot.writeMessageEnd()
  405. self._oprot.trans.flush()
  406. def recv_get_default_configuration(self):
  407. iprot = self._iprot
  408. (fname, mtype, rseqid) = iprot.readMessageBegin()
  409. if mtype == TMessageType.EXCEPTION:
  410. x = TApplicationException()
  411. x.read(iprot)
  412. iprot.readMessageEnd()
  413. raise x
  414. result = get_default_configuration_result()
  415. result.read(iprot)
  416. iprot.readMessageEnd()
  417. if result.success is not None:
  418. return result.success
  419. raise TApplicationException(TApplicationException.MISSING_RESULT, "get_default_configuration failed: unknown result")
  420. def close(self, handle):
  421. """
  422. Parameters:
  423. - handle
  424. """
  425. self.send_close(handle)
  426. self.recv_close()
  427. def send_close(self, handle):
  428. self._oprot.writeMessageBegin('close', TMessageType.CALL, self._seqid)
  429. args = close_args()
  430. args.handle = handle
  431. args.write(self._oprot)
  432. self._oprot.writeMessageEnd()
  433. self._oprot.trans.flush()
  434. def recv_close(self):
  435. iprot = self._iprot
  436. (fname, mtype, rseqid) = iprot.readMessageBegin()
  437. if mtype == TMessageType.EXCEPTION:
  438. x = TApplicationException()
  439. x.read(iprot)
  440. iprot.readMessageEnd()
  441. raise x
  442. result = close_result()
  443. result.read(iprot)
  444. iprot.readMessageEnd()
  445. if result.error is not None:
  446. raise result.error
  447. if result.error2 is not None:
  448. raise result.error2
  449. return
  450. def clean(self, log_context):
  451. """
  452. Parameters:
  453. - log_context
  454. """
  455. self.send_clean(log_context)
  456. self.recv_clean()
  457. def send_clean(self, log_context):
  458. self._oprot.writeMessageBegin('clean', TMessageType.CALL, self._seqid)
  459. args = clean_args()
  460. args.log_context = log_context
  461. args.write(self._oprot)
  462. self._oprot.writeMessageEnd()
  463. self._oprot.trans.flush()
  464. def recv_clean(self):
  465. iprot = self._iprot
  466. (fname, mtype, rseqid) = iprot.readMessageBegin()
  467. if mtype == TMessageType.EXCEPTION:
  468. x = TApplicationException()
  469. x.read(iprot)
  470. iprot.readMessageEnd()
  471. raise x
  472. result = clean_result()
  473. result.read(iprot)
  474. iprot.readMessageEnd()
  475. return
  476. class Processor(Iface, TProcessor):
  477. def __init__(self, handler):
  478. self._handler = handler
  479. self._processMap = {}
  480. self._processMap["query"] = Processor.process_query
  481. self._processMap["executeAndWait"] = Processor.process_executeAndWait
  482. self._processMap["explain"] = Processor.process_explain
  483. self._processMap["fetch"] = Processor.process_fetch
  484. self._processMap["get_state"] = Processor.process_get_state
  485. self._processMap["get_results_metadata"] = Processor.process_get_results_metadata
  486. self._processMap["echo"] = Processor.process_echo
  487. self._processMap["dump_config"] = Processor.process_dump_config
  488. self._processMap["get_log"] = Processor.process_get_log
  489. self._processMap["get_default_configuration"] = Processor.process_get_default_configuration
  490. self._processMap["close"] = Processor.process_close
  491. self._processMap["clean"] = Processor.process_clean
  492. self._on_message_begin = None
  493. def on_message_begin(self, func):
  494. self._on_message_begin = func
  495. def process(self, iprot, oprot):
  496. (name, type, seqid) = iprot.readMessageBegin()
  497. if self._on_message_begin:
  498. self._on_message_begin(name, type, seqid)
  499. if name not in self._processMap:
  500. iprot.skip(TType.STRUCT)
  501. iprot.readMessageEnd()
  502. x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
  503. oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
  504. x.write(oprot)
  505. oprot.writeMessageEnd()
  506. oprot.trans.flush()
  507. return
  508. else:
  509. self._processMap[name](self, seqid, iprot, oprot)
  510. return True
  511. def process_query(self, seqid, iprot, oprot):
  512. args = query_args()
  513. args.read(iprot)
  514. iprot.readMessageEnd()
  515. result = query_result()
  516. try:
  517. result.success = self._handler.query(args.query)
  518. msg_type = TMessageType.REPLY
  519. except TTransport.TTransportException:
  520. raise
  521. except BeeswaxException as error:
  522. msg_type = TMessageType.REPLY
  523. result.error = error
  524. except TApplicationException as ex:
  525. logging.exception('TApplication exception in handler')
  526. msg_type = TMessageType.EXCEPTION
  527. result = ex
  528. except Exception:
  529. logging.exception('Unexpected exception in handler')
  530. msg_type = TMessageType.EXCEPTION
  531. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  532. oprot.writeMessageBegin("query", msg_type, seqid)
  533. result.write(oprot)
  534. oprot.writeMessageEnd()
  535. oprot.trans.flush()
  536. def process_executeAndWait(self, seqid, iprot, oprot):
  537. args = executeAndWait_args()
  538. args.read(iprot)
  539. iprot.readMessageEnd()
  540. result = executeAndWait_result()
  541. try:
  542. result.success = self._handler.executeAndWait(args.query, args.clientCtx)
  543. msg_type = TMessageType.REPLY
  544. except TTransport.TTransportException:
  545. raise
  546. except BeeswaxException as error:
  547. msg_type = TMessageType.REPLY
  548. result.error = error
  549. except TApplicationException as ex:
  550. logging.exception('TApplication exception in handler')
  551. msg_type = TMessageType.EXCEPTION
  552. result = ex
  553. except Exception:
  554. logging.exception('Unexpected exception in handler')
  555. msg_type = TMessageType.EXCEPTION
  556. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  557. oprot.writeMessageBegin("executeAndWait", msg_type, seqid)
  558. result.write(oprot)
  559. oprot.writeMessageEnd()
  560. oprot.trans.flush()
  561. def process_explain(self, seqid, iprot, oprot):
  562. args = explain_args()
  563. args.read(iprot)
  564. iprot.readMessageEnd()
  565. result = explain_result()
  566. try:
  567. result.success = self._handler.explain(args.query)
  568. msg_type = TMessageType.REPLY
  569. except TTransport.TTransportException:
  570. raise
  571. except BeeswaxException as error:
  572. msg_type = TMessageType.REPLY
  573. result.error = error
  574. except TApplicationException as ex:
  575. logging.exception('TApplication exception in handler')
  576. msg_type = TMessageType.EXCEPTION
  577. result = ex
  578. except Exception:
  579. logging.exception('Unexpected exception in handler')
  580. msg_type = TMessageType.EXCEPTION
  581. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  582. oprot.writeMessageBegin("explain", msg_type, seqid)
  583. result.write(oprot)
  584. oprot.writeMessageEnd()
  585. oprot.trans.flush()
  586. def process_fetch(self, seqid, iprot, oprot):
  587. args = fetch_args()
  588. args.read(iprot)
  589. iprot.readMessageEnd()
  590. result = fetch_result()
  591. try:
  592. result.success = self._handler.fetch(args.query_id, args.start_over, args.fetch_size)
  593. msg_type = TMessageType.REPLY
  594. except TTransport.TTransportException:
  595. raise
  596. except QueryNotFoundException as error:
  597. msg_type = TMessageType.REPLY
  598. result.error = error
  599. except BeeswaxException as error2:
  600. msg_type = TMessageType.REPLY
  601. result.error2 = error2
  602. except TApplicationException as ex:
  603. logging.exception('TApplication exception in handler')
  604. msg_type = TMessageType.EXCEPTION
  605. result = ex
  606. except Exception:
  607. logging.exception('Unexpected exception in handler')
  608. msg_type = TMessageType.EXCEPTION
  609. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  610. oprot.writeMessageBegin("fetch", msg_type, seqid)
  611. result.write(oprot)
  612. oprot.writeMessageEnd()
  613. oprot.trans.flush()
  614. def process_get_state(self, seqid, iprot, oprot):
  615. args = get_state_args()
  616. args.read(iprot)
  617. iprot.readMessageEnd()
  618. result = get_state_result()
  619. try:
  620. result.success = self._handler.get_state(args.handle)
  621. msg_type = TMessageType.REPLY
  622. except TTransport.TTransportException:
  623. raise
  624. except QueryNotFoundException as error:
  625. msg_type = TMessageType.REPLY
  626. result.error = error
  627. except TApplicationException as ex:
  628. logging.exception('TApplication exception in handler')
  629. msg_type = TMessageType.EXCEPTION
  630. result = ex
  631. except Exception:
  632. logging.exception('Unexpected exception in handler')
  633. msg_type = TMessageType.EXCEPTION
  634. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  635. oprot.writeMessageBegin("get_state", msg_type, seqid)
  636. result.write(oprot)
  637. oprot.writeMessageEnd()
  638. oprot.trans.flush()
  639. def process_get_results_metadata(self, seqid, iprot, oprot):
  640. args = get_results_metadata_args()
  641. args.read(iprot)
  642. iprot.readMessageEnd()
  643. result = get_results_metadata_result()
  644. try:
  645. result.success = self._handler.get_results_metadata(args.handle)
  646. msg_type = TMessageType.REPLY
  647. except TTransport.TTransportException:
  648. raise
  649. except QueryNotFoundException as error:
  650. msg_type = TMessageType.REPLY
  651. result.error = error
  652. except TApplicationException as ex:
  653. logging.exception('TApplication exception in handler')
  654. msg_type = TMessageType.EXCEPTION
  655. result = ex
  656. except Exception:
  657. logging.exception('Unexpected exception in handler')
  658. msg_type = TMessageType.EXCEPTION
  659. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  660. oprot.writeMessageBegin("get_results_metadata", msg_type, seqid)
  661. result.write(oprot)
  662. oprot.writeMessageEnd()
  663. oprot.trans.flush()
  664. def process_echo(self, seqid, iprot, oprot):
  665. args = echo_args()
  666. args.read(iprot)
  667. iprot.readMessageEnd()
  668. result = echo_result()
  669. try:
  670. result.success = self._handler.echo(args.s)
  671. msg_type = TMessageType.REPLY
  672. except TTransport.TTransportException:
  673. raise
  674. except TApplicationException as ex:
  675. logging.exception('TApplication exception in handler')
  676. msg_type = TMessageType.EXCEPTION
  677. result = ex
  678. except Exception:
  679. logging.exception('Unexpected exception in handler')
  680. msg_type = TMessageType.EXCEPTION
  681. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  682. oprot.writeMessageBegin("echo", msg_type, seqid)
  683. result.write(oprot)
  684. oprot.writeMessageEnd()
  685. oprot.trans.flush()
  686. def process_dump_config(self, seqid, iprot, oprot):
  687. args = dump_config_args()
  688. args.read(iprot)
  689. iprot.readMessageEnd()
  690. result = dump_config_result()
  691. try:
  692. result.success = self._handler.dump_config()
  693. msg_type = TMessageType.REPLY
  694. except TTransport.TTransportException:
  695. raise
  696. except TApplicationException as ex:
  697. logging.exception('TApplication exception in handler')
  698. msg_type = TMessageType.EXCEPTION
  699. result = ex
  700. except Exception:
  701. logging.exception('Unexpected exception in handler')
  702. msg_type = TMessageType.EXCEPTION
  703. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  704. oprot.writeMessageBegin("dump_config", msg_type, seqid)
  705. result.write(oprot)
  706. oprot.writeMessageEnd()
  707. oprot.trans.flush()
  708. def process_get_log(self, seqid, iprot, oprot):
  709. args = get_log_args()
  710. args.read(iprot)
  711. iprot.readMessageEnd()
  712. result = get_log_result()
  713. try:
  714. result.success = self._handler.get_log(args.context)
  715. msg_type = TMessageType.REPLY
  716. except TTransport.TTransportException:
  717. raise
  718. except QueryNotFoundException as error:
  719. msg_type = TMessageType.REPLY
  720. result.error = error
  721. except TApplicationException as ex:
  722. logging.exception('TApplication exception in handler')
  723. msg_type = TMessageType.EXCEPTION
  724. result = ex
  725. except Exception:
  726. logging.exception('Unexpected exception in handler')
  727. msg_type = TMessageType.EXCEPTION
  728. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  729. oprot.writeMessageBegin("get_log", msg_type, seqid)
  730. result.write(oprot)
  731. oprot.writeMessageEnd()
  732. oprot.trans.flush()
  733. def process_get_default_configuration(self, seqid, iprot, oprot):
  734. args = get_default_configuration_args()
  735. args.read(iprot)
  736. iprot.readMessageEnd()
  737. result = get_default_configuration_result()
  738. try:
  739. result.success = self._handler.get_default_configuration(args.include_hadoop)
  740. msg_type = TMessageType.REPLY
  741. except TTransport.TTransportException:
  742. raise
  743. except TApplicationException as ex:
  744. logging.exception('TApplication exception in handler')
  745. msg_type = TMessageType.EXCEPTION
  746. result = ex
  747. except Exception:
  748. logging.exception('Unexpected exception in handler')
  749. msg_type = TMessageType.EXCEPTION
  750. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  751. oprot.writeMessageBegin("get_default_configuration", msg_type, seqid)
  752. result.write(oprot)
  753. oprot.writeMessageEnd()
  754. oprot.trans.flush()
  755. def process_close(self, seqid, iprot, oprot):
  756. args = close_args()
  757. args.read(iprot)
  758. iprot.readMessageEnd()
  759. result = close_result()
  760. try:
  761. self._handler.close(args.handle)
  762. msg_type = TMessageType.REPLY
  763. except TTransport.TTransportException:
  764. raise
  765. except QueryNotFoundException as error:
  766. msg_type = TMessageType.REPLY
  767. result.error = error
  768. except BeeswaxException as error2:
  769. msg_type = TMessageType.REPLY
  770. result.error2 = error2
  771. except TApplicationException as ex:
  772. logging.exception('TApplication exception in handler')
  773. msg_type = TMessageType.EXCEPTION
  774. result = ex
  775. except Exception:
  776. logging.exception('Unexpected exception in handler')
  777. msg_type = TMessageType.EXCEPTION
  778. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  779. oprot.writeMessageBegin("close", msg_type, seqid)
  780. result.write(oprot)
  781. oprot.writeMessageEnd()
  782. oprot.trans.flush()
  783. def process_clean(self, seqid, iprot, oprot):
  784. args = clean_args()
  785. args.read(iprot)
  786. iprot.readMessageEnd()
  787. result = clean_result()
  788. try:
  789. self._handler.clean(args.log_context)
  790. msg_type = TMessageType.REPLY
  791. except TTransport.TTransportException:
  792. raise
  793. except TApplicationException as ex:
  794. logging.exception('TApplication exception in handler')
  795. msg_type = TMessageType.EXCEPTION
  796. result = ex
  797. except Exception:
  798. logging.exception('Unexpected exception in handler')
  799. msg_type = TMessageType.EXCEPTION
  800. result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
  801. oprot.writeMessageBegin("clean", msg_type, seqid)
  802. result.write(oprot)
  803. oprot.writeMessageEnd()
  804. oprot.trans.flush()
  805. # HELPER FUNCTIONS AND STRUCTURES
  806. class query_args(object):
  807. """
  808. Attributes:
  809. - query
  810. """
  811. def __init__(self, query=None,):
  812. self.query = query
  813. def read(self, iprot):
  814. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  815. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  816. return
  817. iprot.readStructBegin()
  818. while True:
  819. (fname, ftype, fid) = iprot.readFieldBegin()
  820. if ftype == TType.STOP:
  821. break
  822. if fid == 1:
  823. if ftype == TType.STRUCT:
  824. self.query = Query()
  825. self.query.read(iprot)
  826. else:
  827. iprot.skip(ftype)
  828. else:
  829. iprot.skip(ftype)
  830. iprot.readFieldEnd()
  831. iprot.readStructEnd()
  832. def write(self, oprot):
  833. if oprot._fast_encode is not None and self.thrift_spec is not None:
  834. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  835. return
  836. oprot.writeStructBegin('query_args')
  837. if self.query is not None:
  838. oprot.writeFieldBegin('query', TType.STRUCT, 1)
  839. self.query.write(oprot)
  840. oprot.writeFieldEnd()
  841. oprot.writeFieldStop()
  842. oprot.writeStructEnd()
  843. def validate(self):
  844. return
  845. def __repr__(self):
  846. L = ['%s=%r' % (key, value)
  847. for key, value in self.__dict__.items()]
  848. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  849. def __eq__(self, other):
  850. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  851. def __ne__(self, other):
  852. return not (self == other)
  853. all_structs.append(query_args)
  854. query_args.thrift_spec = (
  855. None, # 0
  856. (1, TType.STRUCT, 'query', [Query, None], None, ), # 1
  857. )
  858. class query_result(object):
  859. """
  860. Attributes:
  861. - success
  862. - error
  863. """
  864. def __init__(self, success=None, error=None,):
  865. self.success = success
  866. self.error = error
  867. def read(self, iprot):
  868. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  869. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  870. return
  871. iprot.readStructBegin()
  872. while True:
  873. (fname, ftype, fid) = iprot.readFieldBegin()
  874. if ftype == TType.STOP:
  875. break
  876. if fid == 0:
  877. if ftype == TType.STRUCT:
  878. self.success = QueryHandle()
  879. self.success.read(iprot)
  880. else:
  881. iprot.skip(ftype)
  882. elif fid == 1:
  883. if ftype == TType.STRUCT:
  884. self.error = BeeswaxException()
  885. self.error.read(iprot)
  886. else:
  887. iprot.skip(ftype)
  888. else:
  889. iprot.skip(ftype)
  890. iprot.readFieldEnd()
  891. iprot.readStructEnd()
  892. def write(self, oprot):
  893. if oprot._fast_encode is not None and self.thrift_spec is not None:
  894. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  895. return
  896. oprot.writeStructBegin('query_result')
  897. if self.success is not None:
  898. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  899. self.success.write(oprot)
  900. oprot.writeFieldEnd()
  901. if self.error is not None:
  902. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  903. self.error.write(oprot)
  904. oprot.writeFieldEnd()
  905. oprot.writeFieldStop()
  906. oprot.writeStructEnd()
  907. def validate(self):
  908. return
  909. def __repr__(self):
  910. L = ['%s=%r' % (key, value)
  911. for key, value in self.__dict__.items()]
  912. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  913. def __eq__(self, other):
  914. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  915. def __ne__(self, other):
  916. return not (self == other)
  917. all_structs.append(query_result)
  918. query_result.thrift_spec = (
  919. (0, TType.STRUCT, 'success', [QueryHandle, None], None, ), # 0
  920. (1, TType.STRUCT, 'error', [BeeswaxException, None], None, ), # 1
  921. )
  922. class executeAndWait_args(object):
  923. """
  924. Attributes:
  925. - query
  926. - clientCtx
  927. """
  928. def __init__(self, query=None, clientCtx=None,):
  929. self.query = query
  930. self.clientCtx = clientCtx
  931. def read(self, iprot):
  932. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  933. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  934. return
  935. iprot.readStructBegin()
  936. while True:
  937. (fname, ftype, fid) = iprot.readFieldBegin()
  938. if ftype == TType.STOP:
  939. break
  940. if fid == 1:
  941. if ftype == TType.STRUCT:
  942. self.query = Query()
  943. self.query.read(iprot)
  944. else:
  945. iprot.skip(ftype)
  946. elif fid == 2:
  947. if ftype == TType.STRING:
  948. self.clientCtx = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  949. else:
  950. iprot.skip(ftype)
  951. else:
  952. iprot.skip(ftype)
  953. iprot.readFieldEnd()
  954. iprot.readStructEnd()
  955. def write(self, oprot):
  956. if oprot._fast_encode is not None and self.thrift_spec is not None:
  957. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  958. return
  959. oprot.writeStructBegin('executeAndWait_args')
  960. if self.query is not None:
  961. oprot.writeFieldBegin('query', TType.STRUCT, 1)
  962. self.query.write(oprot)
  963. oprot.writeFieldEnd()
  964. if self.clientCtx is not None:
  965. oprot.writeFieldBegin('clientCtx', TType.STRING, 2)
  966. oprot.writeString(self.clientCtx.encode('utf-8') if sys.version_info[0] == 2 else self.clientCtx)
  967. oprot.writeFieldEnd()
  968. oprot.writeFieldStop()
  969. oprot.writeStructEnd()
  970. def validate(self):
  971. return
  972. def __repr__(self):
  973. L = ['%s=%r' % (key, value)
  974. for key, value in self.__dict__.items()]
  975. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  976. def __eq__(self, other):
  977. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  978. def __ne__(self, other):
  979. return not (self == other)
  980. all_structs.append(executeAndWait_args)
  981. executeAndWait_args.thrift_spec = (
  982. None, # 0
  983. (1, TType.STRUCT, 'query', [Query, None], None, ), # 1
  984. (2, TType.STRING, 'clientCtx', 'UTF8', None, ), # 2
  985. )
  986. class executeAndWait_result(object):
  987. """
  988. Attributes:
  989. - success
  990. - error
  991. """
  992. def __init__(self, success=None, error=None,):
  993. self.success = success
  994. self.error = error
  995. def read(self, iprot):
  996. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  997. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  998. return
  999. iprot.readStructBegin()
  1000. while True:
  1001. (fname, ftype, fid) = iprot.readFieldBegin()
  1002. if ftype == TType.STOP:
  1003. break
  1004. if fid == 0:
  1005. if ftype == TType.STRUCT:
  1006. self.success = QueryHandle()
  1007. self.success.read(iprot)
  1008. else:
  1009. iprot.skip(ftype)
  1010. elif fid == 1:
  1011. if ftype == TType.STRUCT:
  1012. self.error = BeeswaxException()
  1013. self.error.read(iprot)
  1014. else:
  1015. iprot.skip(ftype)
  1016. else:
  1017. iprot.skip(ftype)
  1018. iprot.readFieldEnd()
  1019. iprot.readStructEnd()
  1020. def write(self, oprot):
  1021. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1022. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1023. return
  1024. oprot.writeStructBegin('executeAndWait_result')
  1025. if self.success is not None:
  1026. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  1027. self.success.write(oprot)
  1028. oprot.writeFieldEnd()
  1029. if self.error is not None:
  1030. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1031. self.error.write(oprot)
  1032. oprot.writeFieldEnd()
  1033. oprot.writeFieldStop()
  1034. oprot.writeStructEnd()
  1035. def validate(self):
  1036. return
  1037. def __repr__(self):
  1038. L = ['%s=%r' % (key, value)
  1039. for key, value in self.__dict__.items()]
  1040. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1041. def __eq__(self, other):
  1042. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1043. def __ne__(self, other):
  1044. return not (self == other)
  1045. all_structs.append(executeAndWait_result)
  1046. executeAndWait_result.thrift_spec = (
  1047. (0, TType.STRUCT, 'success', [QueryHandle, None], None, ), # 0
  1048. (1, TType.STRUCT, 'error', [BeeswaxException, None], None, ), # 1
  1049. )
  1050. class explain_args(object):
  1051. """
  1052. Attributes:
  1053. - query
  1054. """
  1055. def __init__(self, query=None,):
  1056. self.query = query
  1057. def read(self, iprot):
  1058. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1059. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1060. return
  1061. iprot.readStructBegin()
  1062. while True:
  1063. (fname, ftype, fid) = iprot.readFieldBegin()
  1064. if ftype == TType.STOP:
  1065. break
  1066. if fid == 1:
  1067. if ftype == TType.STRUCT:
  1068. self.query = Query()
  1069. self.query.read(iprot)
  1070. else:
  1071. iprot.skip(ftype)
  1072. else:
  1073. iprot.skip(ftype)
  1074. iprot.readFieldEnd()
  1075. iprot.readStructEnd()
  1076. def write(self, oprot):
  1077. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1078. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1079. return
  1080. oprot.writeStructBegin('explain_args')
  1081. if self.query is not None:
  1082. oprot.writeFieldBegin('query', TType.STRUCT, 1)
  1083. self.query.write(oprot)
  1084. oprot.writeFieldEnd()
  1085. oprot.writeFieldStop()
  1086. oprot.writeStructEnd()
  1087. def validate(self):
  1088. return
  1089. def __repr__(self):
  1090. L = ['%s=%r' % (key, value)
  1091. for key, value in self.__dict__.items()]
  1092. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1093. def __eq__(self, other):
  1094. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1095. def __ne__(self, other):
  1096. return not (self == other)
  1097. all_structs.append(explain_args)
  1098. explain_args.thrift_spec = (
  1099. None, # 0
  1100. (1, TType.STRUCT, 'query', [Query, None], None, ), # 1
  1101. )
  1102. class explain_result(object):
  1103. """
  1104. Attributes:
  1105. - success
  1106. - error
  1107. """
  1108. def __init__(self, success=None, error=None,):
  1109. self.success = success
  1110. self.error = error
  1111. def read(self, iprot):
  1112. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1113. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1114. return
  1115. iprot.readStructBegin()
  1116. while True:
  1117. (fname, ftype, fid) = iprot.readFieldBegin()
  1118. if ftype == TType.STOP:
  1119. break
  1120. if fid == 0:
  1121. if ftype == TType.STRUCT:
  1122. self.success = QueryExplanation()
  1123. self.success.read(iprot)
  1124. else:
  1125. iprot.skip(ftype)
  1126. elif fid == 1:
  1127. if ftype == TType.STRUCT:
  1128. self.error = BeeswaxException()
  1129. self.error.read(iprot)
  1130. else:
  1131. iprot.skip(ftype)
  1132. else:
  1133. iprot.skip(ftype)
  1134. iprot.readFieldEnd()
  1135. iprot.readStructEnd()
  1136. def write(self, oprot):
  1137. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1138. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1139. return
  1140. oprot.writeStructBegin('explain_result')
  1141. if self.success is not None:
  1142. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  1143. self.success.write(oprot)
  1144. oprot.writeFieldEnd()
  1145. if self.error is not None:
  1146. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1147. self.error.write(oprot)
  1148. oprot.writeFieldEnd()
  1149. oprot.writeFieldStop()
  1150. oprot.writeStructEnd()
  1151. def validate(self):
  1152. return
  1153. def __repr__(self):
  1154. L = ['%s=%r' % (key, value)
  1155. for key, value in self.__dict__.items()]
  1156. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1157. def __eq__(self, other):
  1158. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1159. def __ne__(self, other):
  1160. return not (self == other)
  1161. all_structs.append(explain_result)
  1162. explain_result.thrift_spec = (
  1163. (0, TType.STRUCT, 'success', [QueryExplanation, None], None, ), # 0
  1164. (1, TType.STRUCT, 'error', [BeeswaxException, None], None, ), # 1
  1165. )
  1166. class fetch_args(object):
  1167. """
  1168. Attributes:
  1169. - query_id
  1170. - start_over
  1171. - fetch_size
  1172. """
  1173. def __init__(self, query_id=None, start_over=None, fetch_size=-1,):
  1174. self.query_id = query_id
  1175. self.start_over = start_over
  1176. self.fetch_size = fetch_size
  1177. def read(self, iprot):
  1178. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1179. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1180. return
  1181. iprot.readStructBegin()
  1182. while True:
  1183. (fname, ftype, fid) = iprot.readFieldBegin()
  1184. if ftype == TType.STOP:
  1185. break
  1186. if fid == 1:
  1187. if ftype == TType.STRUCT:
  1188. self.query_id = QueryHandle()
  1189. self.query_id.read(iprot)
  1190. else:
  1191. iprot.skip(ftype)
  1192. elif fid == 2:
  1193. if ftype == TType.BOOL:
  1194. self.start_over = iprot.readBool()
  1195. else:
  1196. iprot.skip(ftype)
  1197. elif fid == 3:
  1198. if ftype == TType.I32:
  1199. self.fetch_size = iprot.readI32()
  1200. else:
  1201. iprot.skip(ftype)
  1202. else:
  1203. iprot.skip(ftype)
  1204. iprot.readFieldEnd()
  1205. iprot.readStructEnd()
  1206. def write(self, oprot):
  1207. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1208. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1209. return
  1210. oprot.writeStructBegin('fetch_args')
  1211. if self.query_id is not None:
  1212. oprot.writeFieldBegin('query_id', TType.STRUCT, 1)
  1213. self.query_id.write(oprot)
  1214. oprot.writeFieldEnd()
  1215. if self.start_over is not None:
  1216. oprot.writeFieldBegin('start_over', TType.BOOL, 2)
  1217. oprot.writeBool(self.start_over)
  1218. oprot.writeFieldEnd()
  1219. if self.fetch_size is not None:
  1220. oprot.writeFieldBegin('fetch_size', TType.I32, 3)
  1221. oprot.writeI32(self.fetch_size)
  1222. oprot.writeFieldEnd()
  1223. oprot.writeFieldStop()
  1224. oprot.writeStructEnd()
  1225. def validate(self):
  1226. return
  1227. def __repr__(self):
  1228. L = ['%s=%r' % (key, value)
  1229. for key, value in self.__dict__.items()]
  1230. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1231. def __eq__(self, other):
  1232. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1233. def __ne__(self, other):
  1234. return not (self == other)
  1235. all_structs.append(fetch_args)
  1236. fetch_args.thrift_spec = (
  1237. None, # 0
  1238. (1, TType.STRUCT, 'query_id', [QueryHandle, None], None, ), # 1
  1239. (2, TType.BOOL, 'start_over', None, None, ), # 2
  1240. (3, TType.I32, 'fetch_size', None, -1, ), # 3
  1241. )
  1242. class fetch_result(object):
  1243. """
  1244. Attributes:
  1245. - success
  1246. - error
  1247. - error2
  1248. """
  1249. def __init__(self, success=None, error=None, error2=None,):
  1250. self.success = success
  1251. self.error = error
  1252. self.error2 = error2
  1253. def read(self, iprot):
  1254. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1255. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1256. return
  1257. iprot.readStructBegin()
  1258. while True:
  1259. (fname, ftype, fid) = iprot.readFieldBegin()
  1260. if ftype == TType.STOP:
  1261. break
  1262. if fid == 0:
  1263. if ftype == TType.STRUCT:
  1264. self.success = Results()
  1265. self.success.read(iprot)
  1266. else:
  1267. iprot.skip(ftype)
  1268. elif fid == 1:
  1269. if ftype == TType.STRUCT:
  1270. self.error = QueryNotFoundException()
  1271. self.error.read(iprot)
  1272. else:
  1273. iprot.skip(ftype)
  1274. elif fid == 2:
  1275. if ftype == TType.STRUCT:
  1276. self.error2 = BeeswaxException()
  1277. self.error2.read(iprot)
  1278. else:
  1279. iprot.skip(ftype)
  1280. else:
  1281. iprot.skip(ftype)
  1282. iprot.readFieldEnd()
  1283. iprot.readStructEnd()
  1284. def write(self, oprot):
  1285. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1286. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1287. return
  1288. oprot.writeStructBegin('fetch_result')
  1289. if self.success is not None:
  1290. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  1291. self.success.write(oprot)
  1292. oprot.writeFieldEnd()
  1293. if self.error is not None:
  1294. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1295. self.error.write(oprot)
  1296. oprot.writeFieldEnd()
  1297. if self.error2 is not None:
  1298. oprot.writeFieldBegin('error2', TType.STRUCT, 2)
  1299. self.error2.write(oprot)
  1300. oprot.writeFieldEnd()
  1301. oprot.writeFieldStop()
  1302. oprot.writeStructEnd()
  1303. def validate(self):
  1304. return
  1305. def __repr__(self):
  1306. L = ['%s=%r' % (key, value)
  1307. for key, value in self.__dict__.items()]
  1308. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1309. def __eq__(self, other):
  1310. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1311. def __ne__(self, other):
  1312. return not (self == other)
  1313. all_structs.append(fetch_result)
  1314. fetch_result.thrift_spec = (
  1315. (0, TType.STRUCT, 'success', [Results, None], None, ), # 0
  1316. (1, TType.STRUCT, 'error', [QueryNotFoundException, None], None, ), # 1
  1317. (2, TType.STRUCT, 'error2', [BeeswaxException, None], None, ), # 2
  1318. )
  1319. class get_state_args(object):
  1320. """
  1321. Attributes:
  1322. - handle
  1323. """
  1324. def __init__(self, handle=None,):
  1325. self.handle = handle
  1326. def read(self, iprot):
  1327. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1328. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1329. return
  1330. iprot.readStructBegin()
  1331. while True:
  1332. (fname, ftype, fid) = iprot.readFieldBegin()
  1333. if ftype == TType.STOP:
  1334. break
  1335. if fid == 1:
  1336. if ftype == TType.STRUCT:
  1337. self.handle = QueryHandle()
  1338. self.handle.read(iprot)
  1339. else:
  1340. iprot.skip(ftype)
  1341. else:
  1342. iprot.skip(ftype)
  1343. iprot.readFieldEnd()
  1344. iprot.readStructEnd()
  1345. def write(self, oprot):
  1346. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1347. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1348. return
  1349. oprot.writeStructBegin('get_state_args')
  1350. if self.handle is not None:
  1351. oprot.writeFieldBegin('handle', TType.STRUCT, 1)
  1352. self.handle.write(oprot)
  1353. oprot.writeFieldEnd()
  1354. oprot.writeFieldStop()
  1355. oprot.writeStructEnd()
  1356. def validate(self):
  1357. return
  1358. def __repr__(self):
  1359. L = ['%s=%r' % (key, value)
  1360. for key, value in self.__dict__.items()]
  1361. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1362. def __eq__(self, other):
  1363. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1364. def __ne__(self, other):
  1365. return not (self == other)
  1366. all_structs.append(get_state_args)
  1367. get_state_args.thrift_spec = (
  1368. None, # 0
  1369. (1, TType.STRUCT, 'handle', [QueryHandle, None], None, ), # 1
  1370. )
  1371. class get_state_result(object):
  1372. """
  1373. Attributes:
  1374. - success
  1375. - error
  1376. """
  1377. def __init__(self, success=None, error=None,):
  1378. self.success = success
  1379. self.error = error
  1380. def read(self, iprot):
  1381. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1382. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1383. return
  1384. iprot.readStructBegin()
  1385. while True:
  1386. (fname, ftype, fid) = iprot.readFieldBegin()
  1387. if ftype == TType.STOP:
  1388. break
  1389. if fid == 0:
  1390. if ftype == TType.I32:
  1391. self.success = iprot.readI32()
  1392. else:
  1393. iprot.skip(ftype)
  1394. elif fid == 1:
  1395. if ftype == TType.STRUCT:
  1396. self.error = QueryNotFoundException()
  1397. self.error.read(iprot)
  1398. else:
  1399. iprot.skip(ftype)
  1400. else:
  1401. iprot.skip(ftype)
  1402. iprot.readFieldEnd()
  1403. iprot.readStructEnd()
  1404. def write(self, oprot):
  1405. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1406. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1407. return
  1408. oprot.writeStructBegin('get_state_result')
  1409. if self.success is not None:
  1410. oprot.writeFieldBegin('success', TType.I32, 0)
  1411. oprot.writeI32(self.success)
  1412. oprot.writeFieldEnd()
  1413. if self.error is not None:
  1414. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1415. self.error.write(oprot)
  1416. oprot.writeFieldEnd()
  1417. oprot.writeFieldStop()
  1418. oprot.writeStructEnd()
  1419. def validate(self):
  1420. return
  1421. def __repr__(self):
  1422. L = ['%s=%r' % (key, value)
  1423. for key, value in self.__dict__.items()]
  1424. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1425. def __eq__(self, other):
  1426. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1427. def __ne__(self, other):
  1428. return not (self == other)
  1429. all_structs.append(get_state_result)
  1430. get_state_result.thrift_spec = (
  1431. (0, TType.I32, 'success', None, None, ), # 0
  1432. (1, TType.STRUCT, 'error', [QueryNotFoundException, None], None, ), # 1
  1433. )
  1434. class get_results_metadata_args(object):
  1435. """
  1436. Attributes:
  1437. - handle
  1438. """
  1439. def __init__(self, handle=None,):
  1440. self.handle = handle
  1441. def read(self, iprot):
  1442. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1443. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1444. return
  1445. iprot.readStructBegin()
  1446. while True:
  1447. (fname, ftype, fid) = iprot.readFieldBegin()
  1448. if ftype == TType.STOP:
  1449. break
  1450. if fid == 1:
  1451. if ftype == TType.STRUCT:
  1452. self.handle = QueryHandle()
  1453. self.handle.read(iprot)
  1454. else:
  1455. iprot.skip(ftype)
  1456. else:
  1457. iprot.skip(ftype)
  1458. iprot.readFieldEnd()
  1459. iprot.readStructEnd()
  1460. def write(self, oprot):
  1461. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1462. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1463. return
  1464. oprot.writeStructBegin('get_results_metadata_args')
  1465. if self.handle is not None:
  1466. oprot.writeFieldBegin('handle', TType.STRUCT, 1)
  1467. self.handle.write(oprot)
  1468. oprot.writeFieldEnd()
  1469. oprot.writeFieldStop()
  1470. oprot.writeStructEnd()
  1471. def validate(self):
  1472. return
  1473. def __repr__(self):
  1474. L = ['%s=%r' % (key, value)
  1475. for key, value in self.__dict__.items()]
  1476. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1477. def __eq__(self, other):
  1478. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1479. def __ne__(self, other):
  1480. return not (self == other)
  1481. all_structs.append(get_results_metadata_args)
  1482. get_results_metadata_args.thrift_spec = (
  1483. None, # 0
  1484. (1, TType.STRUCT, 'handle', [QueryHandle, None], None, ), # 1
  1485. )
  1486. class get_results_metadata_result(object):
  1487. """
  1488. Attributes:
  1489. - success
  1490. - error
  1491. """
  1492. def __init__(self, success=None, error=None,):
  1493. self.success = success
  1494. self.error = error
  1495. def read(self, iprot):
  1496. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1497. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1498. return
  1499. iprot.readStructBegin()
  1500. while True:
  1501. (fname, ftype, fid) = iprot.readFieldBegin()
  1502. if ftype == TType.STOP:
  1503. break
  1504. if fid == 0:
  1505. if ftype == TType.STRUCT:
  1506. self.success = ResultsMetadata()
  1507. self.success.read(iprot)
  1508. else:
  1509. iprot.skip(ftype)
  1510. elif fid == 1:
  1511. if ftype == TType.STRUCT:
  1512. self.error = QueryNotFoundException()
  1513. self.error.read(iprot)
  1514. else:
  1515. iprot.skip(ftype)
  1516. else:
  1517. iprot.skip(ftype)
  1518. iprot.readFieldEnd()
  1519. iprot.readStructEnd()
  1520. def write(self, oprot):
  1521. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1522. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1523. return
  1524. oprot.writeStructBegin('get_results_metadata_result')
  1525. if self.success is not None:
  1526. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  1527. self.success.write(oprot)
  1528. oprot.writeFieldEnd()
  1529. if self.error is not None:
  1530. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1531. self.error.write(oprot)
  1532. oprot.writeFieldEnd()
  1533. oprot.writeFieldStop()
  1534. oprot.writeStructEnd()
  1535. def validate(self):
  1536. return
  1537. def __repr__(self):
  1538. L = ['%s=%r' % (key, value)
  1539. for key, value in self.__dict__.items()]
  1540. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1541. def __eq__(self, other):
  1542. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1543. def __ne__(self, other):
  1544. return not (self == other)
  1545. all_structs.append(get_results_metadata_result)
  1546. get_results_metadata_result.thrift_spec = (
  1547. (0, TType.STRUCT, 'success', [ResultsMetadata, None], None, ), # 0
  1548. (1, TType.STRUCT, 'error', [QueryNotFoundException, None], None, ), # 1
  1549. )
  1550. class echo_args(object):
  1551. """
  1552. Attributes:
  1553. - s
  1554. """
  1555. def __init__(self, s=None,):
  1556. self.s = s
  1557. def read(self, iprot):
  1558. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1559. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1560. return
  1561. iprot.readStructBegin()
  1562. while True:
  1563. (fname, ftype, fid) = iprot.readFieldBegin()
  1564. if ftype == TType.STOP:
  1565. break
  1566. if fid == 1:
  1567. if ftype == TType.STRING:
  1568. self.s = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  1569. else:
  1570. iprot.skip(ftype)
  1571. else:
  1572. iprot.skip(ftype)
  1573. iprot.readFieldEnd()
  1574. iprot.readStructEnd()
  1575. def write(self, oprot):
  1576. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1577. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1578. return
  1579. oprot.writeStructBegin('echo_args')
  1580. if self.s is not None:
  1581. oprot.writeFieldBegin('s', TType.STRING, 1)
  1582. oprot.writeString(self.s.encode('utf-8') if sys.version_info[0] == 2 else self.s)
  1583. oprot.writeFieldEnd()
  1584. oprot.writeFieldStop()
  1585. oprot.writeStructEnd()
  1586. def validate(self):
  1587. return
  1588. def __repr__(self):
  1589. L = ['%s=%r' % (key, value)
  1590. for key, value in self.__dict__.items()]
  1591. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1592. def __eq__(self, other):
  1593. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1594. def __ne__(self, other):
  1595. return not (self == other)
  1596. all_structs.append(echo_args)
  1597. echo_args.thrift_spec = (
  1598. None, # 0
  1599. (1, TType.STRING, 's', 'UTF8', None, ), # 1
  1600. )
  1601. class echo_result(object):
  1602. """
  1603. Attributes:
  1604. - success
  1605. """
  1606. def __init__(self, success=None,):
  1607. self.success = success
  1608. def read(self, iprot):
  1609. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1610. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1611. return
  1612. iprot.readStructBegin()
  1613. while True:
  1614. (fname, ftype, fid) = iprot.readFieldBegin()
  1615. if ftype == TType.STOP:
  1616. break
  1617. if fid == 0:
  1618. if ftype == TType.STRING:
  1619. self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  1620. else:
  1621. iprot.skip(ftype)
  1622. else:
  1623. iprot.skip(ftype)
  1624. iprot.readFieldEnd()
  1625. iprot.readStructEnd()
  1626. def write(self, oprot):
  1627. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1628. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1629. return
  1630. oprot.writeStructBegin('echo_result')
  1631. if self.success is not None:
  1632. oprot.writeFieldBegin('success', TType.STRING, 0)
  1633. oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
  1634. oprot.writeFieldEnd()
  1635. oprot.writeFieldStop()
  1636. oprot.writeStructEnd()
  1637. def validate(self):
  1638. return
  1639. def __repr__(self):
  1640. L = ['%s=%r' % (key, value)
  1641. for key, value in self.__dict__.items()]
  1642. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1643. def __eq__(self, other):
  1644. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1645. def __ne__(self, other):
  1646. return not (self == other)
  1647. all_structs.append(echo_result)
  1648. echo_result.thrift_spec = (
  1649. (0, TType.STRING, 'success', 'UTF8', None, ), # 0
  1650. )
  1651. class dump_config_args(object):
  1652. def read(self, iprot):
  1653. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1654. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1655. return
  1656. iprot.readStructBegin()
  1657. while True:
  1658. (fname, ftype, fid) = iprot.readFieldBegin()
  1659. if ftype == TType.STOP:
  1660. break
  1661. else:
  1662. iprot.skip(ftype)
  1663. iprot.readFieldEnd()
  1664. iprot.readStructEnd()
  1665. def write(self, oprot):
  1666. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1667. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1668. return
  1669. oprot.writeStructBegin('dump_config_args')
  1670. oprot.writeFieldStop()
  1671. oprot.writeStructEnd()
  1672. def validate(self):
  1673. return
  1674. def __repr__(self):
  1675. L = ['%s=%r' % (key, value)
  1676. for key, value in self.__dict__.items()]
  1677. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1678. def __eq__(self, other):
  1679. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1680. def __ne__(self, other):
  1681. return not (self == other)
  1682. all_structs.append(dump_config_args)
  1683. dump_config_args.thrift_spec = (
  1684. )
  1685. class dump_config_result(object):
  1686. """
  1687. Attributes:
  1688. - success
  1689. """
  1690. def __init__(self, success=None,):
  1691. self.success = success
  1692. def read(self, iprot):
  1693. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1694. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1695. return
  1696. iprot.readStructBegin()
  1697. while True:
  1698. (fname, ftype, fid) = iprot.readFieldBegin()
  1699. if ftype == TType.STOP:
  1700. break
  1701. if fid == 0:
  1702. if ftype == TType.STRING:
  1703. self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  1704. else:
  1705. iprot.skip(ftype)
  1706. else:
  1707. iprot.skip(ftype)
  1708. iprot.readFieldEnd()
  1709. iprot.readStructEnd()
  1710. def write(self, oprot):
  1711. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1712. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1713. return
  1714. oprot.writeStructBegin('dump_config_result')
  1715. if self.success is not None:
  1716. oprot.writeFieldBegin('success', TType.STRING, 0)
  1717. oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
  1718. oprot.writeFieldEnd()
  1719. oprot.writeFieldStop()
  1720. oprot.writeStructEnd()
  1721. def validate(self):
  1722. return
  1723. def __repr__(self):
  1724. L = ['%s=%r' % (key, value)
  1725. for key, value in self.__dict__.items()]
  1726. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1727. def __eq__(self, other):
  1728. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1729. def __ne__(self, other):
  1730. return not (self == other)
  1731. all_structs.append(dump_config_result)
  1732. dump_config_result.thrift_spec = (
  1733. (0, TType.STRING, 'success', 'UTF8', None, ), # 0
  1734. )
  1735. class get_log_args(object):
  1736. """
  1737. Attributes:
  1738. - context
  1739. """
  1740. def __init__(self, context=None,):
  1741. self.context = context
  1742. def read(self, iprot):
  1743. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1744. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1745. return
  1746. iprot.readStructBegin()
  1747. while True:
  1748. (fname, ftype, fid) = iprot.readFieldBegin()
  1749. if ftype == TType.STOP:
  1750. break
  1751. if fid == 1:
  1752. if ftype == TType.STRING:
  1753. self.context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  1754. else:
  1755. iprot.skip(ftype)
  1756. else:
  1757. iprot.skip(ftype)
  1758. iprot.readFieldEnd()
  1759. iprot.readStructEnd()
  1760. def write(self, oprot):
  1761. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1762. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1763. return
  1764. oprot.writeStructBegin('get_log_args')
  1765. if self.context is not None:
  1766. oprot.writeFieldBegin('context', TType.STRING, 1)
  1767. oprot.writeString(self.context.encode('utf-8') if sys.version_info[0] == 2 else self.context)
  1768. oprot.writeFieldEnd()
  1769. oprot.writeFieldStop()
  1770. oprot.writeStructEnd()
  1771. def validate(self):
  1772. return
  1773. def __repr__(self):
  1774. L = ['%s=%r' % (key, value)
  1775. for key, value in self.__dict__.items()]
  1776. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1777. def __eq__(self, other):
  1778. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1779. def __ne__(self, other):
  1780. return not (self == other)
  1781. all_structs.append(get_log_args)
  1782. get_log_args.thrift_spec = (
  1783. None, # 0
  1784. (1, TType.STRING, 'context', 'UTF8', None, ), # 1
  1785. )
  1786. class get_log_result(object):
  1787. """
  1788. Attributes:
  1789. - success
  1790. - error
  1791. """
  1792. def __init__(self, success=None, error=None,):
  1793. self.success = success
  1794. self.error = error
  1795. def read(self, iprot):
  1796. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1797. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1798. return
  1799. iprot.readStructBegin()
  1800. while True:
  1801. (fname, ftype, fid) = iprot.readFieldBegin()
  1802. if ftype == TType.STOP:
  1803. break
  1804. if fid == 0:
  1805. if ftype == TType.STRING:
  1806. self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  1807. else:
  1808. iprot.skip(ftype)
  1809. elif fid == 1:
  1810. if ftype == TType.STRUCT:
  1811. self.error = QueryNotFoundException()
  1812. self.error.read(iprot)
  1813. else:
  1814. iprot.skip(ftype)
  1815. else:
  1816. iprot.skip(ftype)
  1817. iprot.readFieldEnd()
  1818. iprot.readStructEnd()
  1819. def write(self, oprot):
  1820. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1821. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1822. return
  1823. oprot.writeStructBegin('get_log_result')
  1824. if self.success is not None:
  1825. oprot.writeFieldBegin('success', TType.STRING, 0)
  1826. oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
  1827. oprot.writeFieldEnd()
  1828. if self.error is not None:
  1829. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  1830. self.error.write(oprot)
  1831. oprot.writeFieldEnd()
  1832. oprot.writeFieldStop()
  1833. oprot.writeStructEnd()
  1834. def validate(self):
  1835. return
  1836. def __repr__(self):
  1837. L = ['%s=%r' % (key, value)
  1838. for key, value in self.__dict__.items()]
  1839. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1840. def __eq__(self, other):
  1841. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1842. def __ne__(self, other):
  1843. return not (self == other)
  1844. all_structs.append(get_log_result)
  1845. get_log_result.thrift_spec = (
  1846. (0, TType.STRING, 'success', 'UTF8', None, ), # 0
  1847. (1, TType.STRUCT, 'error', [QueryNotFoundException, None], None, ), # 1
  1848. )
  1849. class get_default_configuration_args(object):
  1850. """
  1851. Attributes:
  1852. - include_hadoop
  1853. """
  1854. def __init__(self, include_hadoop=None,):
  1855. self.include_hadoop = include_hadoop
  1856. def read(self, iprot):
  1857. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1858. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1859. return
  1860. iprot.readStructBegin()
  1861. while True:
  1862. (fname, ftype, fid) = iprot.readFieldBegin()
  1863. if ftype == TType.STOP:
  1864. break
  1865. if fid == 1:
  1866. if ftype == TType.BOOL:
  1867. self.include_hadoop = iprot.readBool()
  1868. else:
  1869. iprot.skip(ftype)
  1870. else:
  1871. iprot.skip(ftype)
  1872. iprot.readFieldEnd()
  1873. iprot.readStructEnd()
  1874. def write(self, oprot):
  1875. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1876. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1877. return
  1878. oprot.writeStructBegin('get_default_configuration_args')
  1879. if self.include_hadoop is not None:
  1880. oprot.writeFieldBegin('include_hadoop', TType.BOOL, 1)
  1881. oprot.writeBool(self.include_hadoop)
  1882. oprot.writeFieldEnd()
  1883. oprot.writeFieldStop()
  1884. oprot.writeStructEnd()
  1885. def validate(self):
  1886. return
  1887. def __repr__(self):
  1888. L = ['%s=%r' % (key, value)
  1889. for key, value in self.__dict__.items()]
  1890. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1891. def __eq__(self, other):
  1892. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1893. def __ne__(self, other):
  1894. return not (self == other)
  1895. all_structs.append(get_default_configuration_args)
  1896. get_default_configuration_args.thrift_spec = (
  1897. None, # 0
  1898. (1, TType.BOOL, 'include_hadoop', None, None, ), # 1
  1899. )
  1900. class get_default_configuration_result(object):
  1901. """
  1902. Attributes:
  1903. - success
  1904. """
  1905. def __init__(self, success=None,):
  1906. self.success = success
  1907. def read(self, iprot):
  1908. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1909. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1910. return
  1911. iprot.readStructBegin()
  1912. while True:
  1913. (fname, ftype, fid) = iprot.readFieldBegin()
  1914. if ftype == TType.STOP:
  1915. break
  1916. if fid == 0:
  1917. if ftype == TType.LIST:
  1918. self.success = []
  1919. (_etype24, _size21) = iprot.readListBegin()
  1920. for _i25 in range(_size21):
  1921. _elem26 = ConfigVariable()
  1922. _elem26.read(iprot)
  1923. self.success.append(_elem26)
  1924. iprot.readListEnd()
  1925. else:
  1926. iprot.skip(ftype)
  1927. else:
  1928. iprot.skip(ftype)
  1929. iprot.readFieldEnd()
  1930. iprot.readStructEnd()
  1931. def write(self, oprot):
  1932. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1933. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1934. return
  1935. oprot.writeStructBegin('get_default_configuration_result')
  1936. if self.success is not None:
  1937. oprot.writeFieldBegin('success', TType.LIST, 0)
  1938. oprot.writeListBegin(TType.STRUCT, len(self.success))
  1939. for iter27 in self.success:
  1940. iter27.write(oprot)
  1941. oprot.writeListEnd()
  1942. oprot.writeFieldEnd()
  1943. oprot.writeFieldStop()
  1944. oprot.writeStructEnd()
  1945. def validate(self):
  1946. return
  1947. def __repr__(self):
  1948. L = ['%s=%r' % (key, value)
  1949. for key, value in self.__dict__.items()]
  1950. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1951. def __eq__(self, other):
  1952. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1953. def __ne__(self, other):
  1954. return not (self == other)
  1955. all_structs.append(get_default_configuration_result)
  1956. get_default_configuration_result.thrift_spec = (
  1957. (0, TType.LIST, 'success', (TType.STRUCT, [ConfigVariable, None], False), None, ), # 0
  1958. )
  1959. class close_args(object):
  1960. """
  1961. Attributes:
  1962. - handle
  1963. """
  1964. def __init__(self, handle=None,):
  1965. self.handle = handle
  1966. def read(self, iprot):
  1967. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  1968. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  1969. return
  1970. iprot.readStructBegin()
  1971. while True:
  1972. (fname, ftype, fid) = iprot.readFieldBegin()
  1973. if ftype == TType.STOP:
  1974. break
  1975. if fid == 1:
  1976. if ftype == TType.STRUCT:
  1977. self.handle = QueryHandle()
  1978. self.handle.read(iprot)
  1979. else:
  1980. iprot.skip(ftype)
  1981. else:
  1982. iprot.skip(ftype)
  1983. iprot.readFieldEnd()
  1984. iprot.readStructEnd()
  1985. def write(self, oprot):
  1986. if oprot._fast_encode is not None and self.thrift_spec is not None:
  1987. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  1988. return
  1989. oprot.writeStructBegin('close_args')
  1990. if self.handle is not None:
  1991. oprot.writeFieldBegin('handle', TType.STRUCT, 1)
  1992. self.handle.write(oprot)
  1993. oprot.writeFieldEnd()
  1994. oprot.writeFieldStop()
  1995. oprot.writeStructEnd()
  1996. def validate(self):
  1997. return
  1998. def __repr__(self):
  1999. L = ['%s=%r' % (key, value)
  2000. for key, value in self.__dict__.items()]
  2001. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  2002. def __eq__(self, other):
  2003. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  2004. def __ne__(self, other):
  2005. return not (self == other)
  2006. all_structs.append(close_args)
  2007. close_args.thrift_spec = (
  2008. None, # 0
  2009. (1, TType.STRUCT, 'handle', [QueryHandle, None], None, ), # 1
  2010. )
  2011. class close_result(object):
  2012. """
  2013. Attributes:
  2014. - error
  2015. - error2
  2016. """
  2017. def __init__(self, error=None, error2=None,):
  2018. self.error = error
  2019. self.error2 = error2
  2020. def read(self, iprot):
  2021. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  2022. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  2023. return
  2024. iprot.readStructBegin()
  2025. while True:
  2026. (fname, ftype, fid) = iprot.readFieldBegin()
  2027. if ftype == TType.STOP:
  2028. break
  2029. if fid == 1:
  2030. if ftype == TType.STRUCT:
  2031. self.error = QueryNotFoundException()
  2032. self.error.read(iprot)
  2033. else:
  2034. iprot.skip(ftype)
  2035. elif fid == 2:
  2036. if ftype == TType.STRUCT:
  2037. self.error2 = BeeswaxException()
  2038. self.error2.read(iprot)
  2039. else:
  2040. iprot.skip(ftype)
  2041. else:
  2042. iprot.skip(ftype)
  2043. iprot.readFieldEnd()
  2044. iprot.readStructEnd()
  2045. def write(self, oprot):
  2046. if oprot._fast_encode is not None and self.thrift_spec is not None:
  2047. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  2048. return
  2049. oprot.writeStructBegin('close_result')
  2050. if self.error is not None:
  2051. oprot.writeFieldBegin('error', TType.STRUCT, 1)
  2052. self.error.write(oprot)
  2053. oprot.writeFieldEnd()
  2054. if self.error2 is not None:
  2055. oprot.writeFieldBegin('error2', TType.STRUCT, 2)
  2056. self.error2.write(oprot)
  2057. oprot.writeFieldEnd()
  2058. oprot.writeFieldStop()
  2059. oprot.writeStructEnd()
  2060. def validate(self):
  2061. return
  2062. def __repr__(self):
  2063. L = ['%s=%r' % (key, value)
  2064. for key, value in self.__dict__.items()]
  2065. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  2066. def __eq__(self, other):
  2067. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  2068. def __ne__(self, other):
  2069. return not (self == other)
  2070. all_structs.append(close_result)
  2071. close_result.thrift_spec = (
  2072. None, # 0
  2073. (1, TType.STRUCT, 'error', [QueryNotFoundException, None], None, ), # 1
  2074. (2, TType.STRUCT, 'error2', [BeeswaxException, None], None, ), # 2
  2075. )
  2076. class clean_args(object):
  2077. """
  2078. Attributes:
  2079. - log_context
  2080. """
  2081. def __init__(self, log_context=None,):
  2082. self.log_context = log_context
  2083. def read(self, iprot):
  2084. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  2085. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  2086. return
  2087. iprot.readStructBegin()
  2088. while True:
  2089. (fname, ftype, fid) = iprot.readFieldBegin()
  2090. if ftype == TType.STOP:
  2091. break
  2092. if fid == 1:
  2093. if ftype == TType.STRING:
  2094. self.log_context = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
  2095. else:
  2096. iprot.skip(ftype)
  2097. else:
  2098. iprot.skip(ftype)
  2099. iprot.readFieldEnd()
  2100. iprot.readStructEnd()
  2101. def write(self, oprot):
  2102. if oprot._fast_encode is not None and self.thrift_spec is not None:
  2103. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  2104. return
  2105. oprot.writeStructBegin('clean_args')
  2106. if self.log_context is not None:
  2107. oprot.writeFieldBegin('log_context', TType.STRING, 1)
  2108. oprot.writeString(self.log_context.encode('utf-8') if sys.version_info[0] == 2 else self.log_context)
  2109. oprot.writeFieldEnd()
  2110. oprot.writeFieldStop()
  2111. oprot.writeStructEnd()
  2112. def validate(self):
  2113. return
  2114. def __repr__(self):
  2115. L = ['%s=%r' % (key, value)
  2116. for key, value in self.__dict__.items()]
  2117. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  2118. def __eq__(self, other):
  2119. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  2120. def __ne__(self, other):
  2121. return not (self == other)
  2122. all_structs.append(clean_args)
  2123. clean_args.thrift_spec = (
  2124. None, # 0
  2125. (1, TType.STRING, 'log_context', 'UTF8', None, ), # 1
  2126. )
  2127. class clean_result(object):
  2128. def read(self, iprot):
  2129. if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
  2130. iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
  2131. return
  2132. iprot.readStructBegin()
  2133. while True:
  2134. (fname, ftype, fid) = iprot.readFieldBegin()
  2135. if ftype == TType.STOP:
  2136. break
  2137. else:
  2138. iprot.skip(ftype)
  2139. iprot.readFieldEnd()
  2140. iprot.readStructEnd()
  2141. def write(self, oprot):
  2142. if oprot._fast_encode is not None and self.thrift_spec is not None:
  2143. oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
  2144. return
  2145. oprot.writeStructBegin('clean_result')
  2146. oprot.writeFieldStop()
  2147. oprot.writeStructEnd()
  2148. def validate(self):
  2149. return
  2150. def __repr__(self):
  2151. L = ['%s=%r' % (key, value)
  2152. for key, value in self.__dict__.items()]
  2153. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  2154. def __eq__(self, other):
  2155. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  2156. def __ne__(self, other):
  2157. return not (self == other)
  2158. all_structs.append(clean_result)
  2159. clean_result.thrift_spec = (
  2160. )
  2161. fix_spec(all_structs)
  2162. del all_structs