PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/gen/thrift/gen-py/queryplan/ttypes.py

#
Python | 1089 lines | 943 code | 82 blank | 64 comment | 267 complexity | 39df4e91e9a378be0efe772111c170fc MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. #
  2. # Autogenerated by Thrift
  3. #
  4. # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. #
  6. from thrift.Thrift import *
  7. from thrift.transport import TTransport
  8. from thrift.protocol import TBinaryProtocol, TProtocol
  9. try:
  10. from thrift.protocol import fastbinary
  11. except:
  12. fastbinary = None
  13. class AdjacencyType:
  14. CONJUNCTIVE = 0
  15. DISJUNCTIVE = 1
  16. _VALUES_TO_NAMES = {
  17. 0: "CONJUNCTIVE",
  18. 1: "DISJUNCTIVE",
  19. }
  20. _NAMES_TO_VALUES = {
  21. "CONJUNCTIVE": 0,
  22. "DISJUNCTIVE": 1,
  23. }
  24. class NodeType:
  25. OPERATOR = 0
  26. STAGE = 1
  27. _VALUES_TO_NAMES = {
  28. 0: "OPERATOR",
  29. 1: "STAGE",
  30. }
  31. _NAMES_TO_VALUES = {
  32. "OPERATOR": 0,
  33. "STAGE": 1,
  34. }
  35. class OperatorType:
  36. JOIN = 0
  37. MAPJOIN = 1
  38. EXTRACT = 2
  39. FILTER = 3
  40. FORWARD = 4
  41. GROUPBY = 5
  42. LIMIT = 6
  43. SCRIPT = 7
  44. SELECT = 8
  45. TABLESCAN = 9
  46. FILESINK = 10
  47. REDUCESINK = 11
  48. UNION = 12
  49. UDTF = 13
  50. LATERALVIEWJOIN = 14
  51. LATERALVIEWFORWARD = 15
  52. HASHTABLESINK = 16
  53. HASHTABLEDUMMY = 17
  54. _VALUES_TO_NAMES = {
  55. 0: "JOIN",
  56. 1: "MAPJOIN",
  57. 2: "EXTRACT",
  58. 3: "FILTER",
  59. 4: "FORWARD",
  60. 5: "GROUPBY",
  61. 6: "LIMIT",
  62. 7: "SCRIPT",
  63. 8: "SELECT",
  64. 9: "TABLESCAN",
  65. 10: "FILESINK",
  66. 11: "REDUCESINK",
  67. 12: "UNION",
  68. 13: "UDTF",
  69. 14: "LATERALVIEWJOIN",
  70. 15: "LATERALVIEWFORWARD",
  71. 16: "HASHTABLESINK",
  72. 17: "HASHTABLEDUMMY",
  73. }
  74. _NAMES_TO_VALUES = {
  75. "JOIN": 0,
  76. "MAPJOIN": 1,
  77. "EXTRACT": 2,
  78. "FILTER": 3,
  79. "FORWARD": 4,
  80. "GROUPBY": 5,
  81. "LIMIT": 6,
  82. "SCRIPT": 7,
  83. "SELECT": 8,
  84. "TABLESCAN": 9,
  85. "FILESINK": 10,
  86. "REDUCESINK": 11,
  87. "UNION": 12,
  88. "UDTF": 13,
  89. "LATERALVIEWJOIN": 14,
  90. "LATERALVIEWFORWARD": 15,
  91. "HASHTABLESINK": 16,
  92. "HASHTABLEDUMMY": 17,
  93. }
  94. class TaskType:
  95. MAP = 0
  96. REDUCE = 1
  97. OTHER = 2
  98. _VALUES_TO_NAMES = {
  99. 0: "MAP",
  100. 1: "REDUCE",
  101. 2: "OTHER",
  102. }
  103. _NAMES_TO_VALUES = {
  104. "MAP": 0,
  105. "REDUCE": 1,
  106. "OTHER": 2,
  107. }
  108. class StageType:
  109. CONDITIONAL = 0
  110. COPY = 1
  111. DDL = 2
  112. MAPRED = 3
  113. EXPLAIN = 4
  114. FETCH = 5
  115. FUNC = 6
  116. MAPREDLOCAL = 7
  117. MOVE = 8
  118. STATS = 9
  119. _VALUES_TO_NAMES = {
  120. 0: "CONDITIONAL",
  121. 1: "COPY",
  122. 2: "DDL",
  123. 3: "MAPRED",
  124. 4: "EXPLAIN",
  125. 5: "FETCH",
  126. 6: "FUNC",
  127. 7: "MAPREDLOCAL",
  128. 8: "MOVE",
  129. 9: "STATS",
  130. }
  131. _NAMES_TO_VALUES = {
  132. "CONDITIONAL": 0,
  133. "COPY": 1,
  134. "DDL": 2,
  135. "MAPRED": 3,
  136. "EXPLAIN": 4,
  137. "FETCH": 5,
  138. "FUNC": 6,
  139. "MAPREDLOCAL": 7,
  140. "MOVE": 8,
  141. "STATS": 9,
  142. }
  143. class Adjacency:
  144. """
  145. Attributes:
  146. - node
  147. - children
  148. - adjacencyType
  149. """
  150. thrift_spec = (
  151. None, # 0
  152. (1, TType.STRING, 'node', None, None, ), # 1
  153. (2, TType.LIST, 'children', (TType.STRING,None), None, ), # 2
  154. (3, TType.I32, 'adjacencyType', None, None, ), # 3
  155. )
  156. def __init__(self, node=None, children=None, adjacencyType=None,):
  157. self.node = node
  158. self.children = children
  159. self.adjacencyType = adjacencyType
  160. def read(self, iprot):
  161. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  162. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  163. return
  164. iprot.readStructBegin()
  165. while True:
  166. (fname, ftype, fid) = iprot.readFieldBegin()
  167. if ftype == TType.STOP:
  168. break
  169. if fid == 1:
  170. if ftype == TType.STRING:
  171. self.node = iprot.readString();
  172. else:
  173. iprot.skip(ftype)
  174. elif fid == 2:
  175. if ftype == TType.LIST:
  176. self.children = []
  177. (_etype3, _size0) = iprot.readListBegin()
  178. for _i4 in xrange(_size0):
  179. _elem5 = iprot.readString();
  180. self.children.append(_elem5)
  181. iprot.readListEnd()
  182. else:
  183. iprot.skip(ftype)
  184. elif fid == 3:
  185. if ftype == TType.I32:
  186. self.adjacencyType = iprot.readI32();
  187. else:
  188. iprot.skip(ftype)
  189. else:
  190. iprot.skip(ftype)
  191. iprot.readFieldEnd()
  192. iprot.readStructEnd()
  193. def write(self, oprot):
  194. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  195. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  196. return
  197. oprot.writeStructBegin('Adjacency')
  198. if self.node != None:
  199. oprot.writeFieldBegin('node', TType.STRING, 1)
  200. oprot.writeString(self.node)
  201. oprot.writeFieldEnd()
  202. if self.children != None:
  203. oprot.writeFieldBegin('children', TType.LIST, 2)
  204. oprot.writeListBegin(TType.STRING, len(self.children))
  205. for iter6 in self.children:
  206. oprot.writeString(iter6)
  207. oprot.writeListEnd()
  208. oprot.writeFieldEnd()
  209. if self.adjacencyType != None:
  210. oprot.writeFieldBegin('adjacencyType', TType.I32, 3)
  211. oprot.writeI32(self.adjacencyType)
  212. oprot.writeFieldEnd()
  213. oprot.writeFieldStop()
  214. oprot.writeStructEnd()
  215. def validate(self):
  216. return
  217. def __repr__(self):
  218. L = ['%s=%r' % (key, value)
  219. for key, value in self.__dict__.iteritems()]
  220. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  221. def __eq__(self, other):
  222. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  223. def __ne__(self, other):
  224. return not (self == other)
  225. class Graph:
  226. """
  227. Attributes:
  228. - nodeType
  229. - roots
  230. - adjacencyList
  231. """
  232. thrift_spec = (
  233. None, # 0
  234. (1, TType.I32, 'nodeType', None, None, ), # 1
  235. (2, TType.LIST, 'roots', (TType.STRING,None), None, ), # 2
  236. (3, TType.LIST, 'adjacencyList', (TType.STRUCT,(Adjacency, Adjacency.thrift_spec)), None, ), # 3
  237. )
  238. def __init__(self, nodeType=None, roots=None, adjacencyList=None,):
  239. self.nodeType = nodeType
  240. self.roots = roots
  241. self.adjacencyList = adjacencyList
  242. def read(self, iprot):
  243. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  244. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  245. return
  246. iprot.readStructBegin()
  247. while True:
  248. (fname, ftype, fid) = iprot.readFieldBegin()
  249. if ftype == TType.STOP:
  250. break
  251. if fid == 1:
  252. if ftype == TType.I32:
  253. self.nodeType = iprot.readI32();
  254. else:
  255. iprot.skip(ftype)
  256. elif fid == 2:
  257. if ftype == TType.LIST:
  258. self.roots = []
  259. (_etype10, _size7) = iprot.readListBegin()
  260. for _i11 in xrange(_size7):
  261. _elem12 = iprot.readString();
  262. self.roots.append(_elem12)
  263. iprot.readListEnd()
  264. else:
  265. iprot.skip(ftype)
  266. elif fid == 3:
  267. if ftype == TType.LIST:
  268. self.adjacencyList = []
  269. (_etype16, _size13) = iprot.readListBegin()
  270. for _i17 in xrange(_size13):
  271. _elem18 = Adjacency()
  272. _elem18.read(iprot)
  273. self.adjacencyList.append(_elem18)
  274. iprot.readListEnd()
  275. else:
  276. iprot.skip(ftype)
  277. else:
  278. iprot.skip(ftype)
  279. iprot.readFieldEnd()
  280. iprot.readStructEnd()
  281. def write(self, oprot):
  282. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  283. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  284. return
  285. oprot.writeStructBegin('Graph')
  286. if self.nodeType != None:
  287. oprot.writeFieldBegin('nodeType', TType.I32, 1)
  288. oprot.writeI32(self.nodeType)
  289. oprot.writeFieldEnd()
  290. if self.roots != None:
  291. oprot.writeFieldBegin('roots', TType.LIST, 2)
  292. oprot.writeListBegin(TType.STRING, len(self.roots))
  293. for iter19 in self.roots:
  294. oprot.writeString(iter19)
  295. oprot.writeListEnd()
  296. oprot.writeFieldEnd()
  297. if self.adjacencyList != None:
  298. oprot.writeFieldBegin('adjacencyList', TType.LIST, 3)
  299. oprot.writeListBegin(TType.STRUCT, len(self.adjacencyList))
  300. for iter20 in self.adjacencyList:
  301. iter20.write(oprot)
  302. oprot.writeListEnd()
  303. oprot.writeFieldEnd()
  304. oprot.writeFieldStop()
  305. oprot.writeStructEnd()
  306. def validate(self):
  307. return
  308. def __repr__(self):
  309. L = ['%s=%r' % (key, value)
  310. for key, value in self.__dict__.iteritems()]
  311. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  312. def __eq__(self, other):
  313. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  314. def __ne__(self, other):
  315. return not (self == other)
  316. class Operator:
  317. """
  318. Attributes:
  319. - operatorId
  320. - operatorType
  321. - operatorAttributes
  322. - operatorCounters
  323. - done
  324. - started
  325. """
  326. thrift_spec = (
  327. None, # 0
  328. (1, TType.STRING, 'operatorId', None, None, ), # 1
  329. (2, TType.I32, 'operatorType', None, None, ), # 2
  330. (3, TType.MAP, 'operatorAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
  331. (4, TType.MAP, 'operatorCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
  332. (5, TType.BOOL, 'done', None, None, ), # 5
  333. (6, TType.BOOL, 'started', None, None, ), # 6
  334. )
  335. def __init__(self, operatorId=None, operatorType=None, operatorAttributes=None, operatorCounters=None, done=None, started=None,):
  336. self.operatorId = operatorId
  337. self.operatorType = operatorType
  338. self.operatorAttributes = operatorAttributes
  339. self.operatorCounters = operatorCounters
  340. self.done = done
  341. self.started = started
  342. def read(self, iprot):
  343. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  344. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  345. return
  346. iprot.readStructBegin()
  347. while True:
  348. (fname, ftype, fid) = iprot.readFieldBegin()
  349. if ftype == TType.STOP:
  350. break
  351. if fid == 1:
  352. if ftype == TType.STRING:
  353. self.operatorId = iprot.readString();
  354. else:
  355. iprot.skip(ftype)
  356. elif fid == 2:
  357. if ftype == TType.I32:
  358. self.operatorType = iprot.readI32();
  359. else:
  360. iprot.skip(ftype)
  361. elif fid == 3:
  362. if ftype == TType.MAP:
  363. self.operatorAttributes = {}
  364. (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin()
  365. for _i25 in xrange(_size21):
  366. _key26 = iprot.readString();
  367. _val27 = iprot.readString();
  368. self.operatorAttributes[_key26] = _val27
  369. iprot.readMapEnd()
  370. else:
  371. iprot.skip(ftype)
  372. elif fid == 4:
  373. if ftype == TType.MAP:
  374. self.operatorCounters = {}
  375. (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin()
  376. for _i32 in xrange(_size28):
  377. _key33 = iprot.readString();
  378. _val34 = iprot.readI64();
  379. self.operatorCounters[_key33] = _val34
  380. iprot.readMapEnd()
  381. else:
  382. iprot.skip(ftype)
  383. elif fid == 5:
  384. if ftype == TType.BOOL:
  385. self.done = iprot.readBool();
  386. else:
  387. iprot.skip(ftype)
  388. elif fid == 6:
  389. if ftype == TType.BOOL:
  390. self.started = iprot.readBool();
  391. else:
  392. iprot.skip(ftype)
  393. else:
  394. iprot.skip(ftype)
  395. iprot.readFieldEnd()
  396. iprot.readStructEnd()
  397. def write(self, oprot):
  398. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  399. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  400. return
  401. oprot.writeStructBegin('Operator')
  402. if self.operatorId != None:
  403. oprot.writeFieldBegin('operatorId', TType.STRING, 1)
  404. oprot.writeString(self.operatorId)
  405. oprot.writeFieldEnd()
  406. if self.operatorType != None:
  407. oprot.writeFieldBegin('operatorType', TType.I32, 2)
  408. oprot.writeI32(self.operatorType)
  409. oprot.writeFieldEnd()
  410. if self.operatorAttributes != None:
  411. oprot.writeFieldBegin('operatorAttributes', TType.MAP, 3)
  412. oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.operatorAttributes))
  413. for kiter35,viter36 in self.operatorAttributes.items():
  414. oprot.writeString(kiter35)
  415. oprot.writeString(viter36)
  416. oprot.writeMapEnd()
  417. oprot.writeFieldEnd()
  418. if self.operatorCounters != None:
  419. oprot.writeFieldBegin('operatorCounters', TType.MAP, 4)
  420. oprot.writeMapBegin(TType.STRING, TType.I64, len(self.operatorCounters))
  421. for kiter37,viter38 in self.operatorCounters.items():
  422. oprot.writeString(kiter37)
  423. oprot.writeI64(viter38)
  424. oprot.writeMapEnd()
  425. oprot.writeFieldEnd()
  426. if self.done != None:
  427. oprot.writeFieldBegin('done', TType.BOOL, 5)
  428. oprot.writeBool(self.done)
  429. oprot.writeFieldEnd()
  430. if self.started != None:
  431. oprot.writeFieldBegin('started', TType.BOOL, 6)
  432. oprot.writeBool(self.started)
  433. oprot.writeFieldEnd()
  434. oprot.writeFieldStop()
  435. oprot.writeStructEnd()
  436. def validate(self):
  437. return
  438. def __repr__(self):
  439. L = ['%s=%r' % (key, value)
  440. for key, value in self.__dict__.iteritems()]
  441. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  442. def __eq__(self, other):
  443. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  444. def __ne__(self, other):
  445. return not (self == other)
  446. class Task:
  447. """
  448. Attributes:
  449. - taskId
  450. - taskType
  451. - taskAttributes
  452. - taskCounters
  453. - operatorGraph
  454. - operatorList
  455. - done
  456. - started
  457. """
  458. thrift_spec = (
  459. None, # 0
  460. (1, TType.STRING, 'taskId', None, None, ), # 1
  461. (2, TType.I32, 'taskType', None, None, ), # 2
  462. (3, TType.MAP, 'taskAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
  463. (4, TType.MAP, 'taskCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
  464. (5, TType.STRUCT, 'operatorGraph', (Graph, Graph.thrift_spec), None, ), # 5
  465. (6, TType.LIST, 'operatorList', (TType.STRUCT,(Operator, Operator.thrift_spec)), None, ), # 6
  466. (7, TType.BOOL, 'done', None, None, ), # 7
  467. (8, TType.BOOL, 'started', None, None, ), # 8
  468. )
  469. def __init__(self, taskId=None, taskType=None, taskAttributes=None, taskCounters=None, operatorGraph=None, operatorList=None, done=None, started=None,):
  470. self.taskId = taskId
  471. self.taskType = taskType
  472. self.taskAttributes = taskAttributes
  473. self.taskCounters = taskCounters
  474. self.operatorGraph = operatorGraph
  475. self.operatorList = operatorList
  476. self.done = done
  477. self.started = started
  478. def read(self, iprot):
  479. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  480. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  481. return
  482. iprot.readStructBegin()
  483. while True:
  484. (fname, ftype, fid) = iprot.readFieldBegin()
  485. if ftype == TType.STOP:
  486. break
  487. if fid == 1:
  488. if ftype == TType.STRING:
  489. self.taskId = iprot.readString();
  490. else:
  491. iprot.skip(ftype)
  492. elif fid == 2:
  493. if ftype == TType.I32:
  494. self.taskType = iprot.readI32();
  495. else:
  496. iprot.skip(ftype)
  497. elif fid == 3:
  498. if ftype == TType.MAP:
  499. self.taskAttributes = {}
  500. (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin()
  501. for _i43 in xrange(_size39):
  502. _key44 = iprot.readString();
  503. _val45 = iprot.readString();
  504. self.taskAttributes[_key44] = _val45
  505. iprot.readMapEnd()
  506. else:
  507. iprot.skip(ftype)
  508. elif fid == 4:
  509. if ftype == TType.MAP:
  510. self.taskCounters = {}
  511. (_ktype47, _vtype48, _size46 ) = iprot.readMapBegin()
  512. for _i50 in xrange(_size46):
  513. _key51 = iprot.readString();
  514. _val52 = iprot.readI64();
  515. self.taskCounters[_key51] = _val52
  516. iprot.readMapEnd()
  517. else:
  518. iprot.skip(ftype)
  519. elif fid == 5:
  520. if ftype == TType.STRUCT:
  521. self.operatorGraph = Graph()
  522. self.operatorGraph.read(iprot)
  523. else:
  524. iprot.skip(ftype)
  525. elif fid == 6:
  526. if ftype == TType.LIST:
  527. self.operatorList = []
  528. (_etype56, _size53) = iprot.readListBegin()
  529. for _i57 in xrange(_size53):
  530. _elem58 = Operator()
  531. _elem58.read(iprot)
  532. self.operatorList.append(_elem58)
  533. iprot.readListEnd()
  534. else:
  535. iprot.skip(ftype)
  536. elif fid == 7:
  537. if ftype == TType.BOOL:
  538. self.done = iprot.readBool();
  539. else:
  540. iprot.skip(ftype)
  541. elif fid == 8:
  542. if ftype == TType.BOOL:
  543. self.started = iprot.readBool();
  544. else:
  545. iprot.skip(ftype)
  546. else:
  547. iprot.skip(ftype)
  548. iprot.readFieldEnd()
  549. iprot.readStructEnd()
  550. def write(self, oprot):
  551. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  552. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  553. return
  554. oprot.writeStructBegin('Task')
  555. if self.taskId != None:
  556. oprot.writeFieldBegin('taskId', TType.STRING, 1)
  557. oprot.writeString(self.taskId)
  558. oprot.writeFieldEnd()
  559. if self.taskType != None:
  560. oprot.writeFieldBegin('taskType', TType.I32, 2)
  561. oprot.writeI32(self.taskType)
  562. oprot.writeFieldEnd()
  563. if self.taskAttributes != None:
  564. oprot.writeFieldBegin('taskAttributes', TType.MAP, 3)
  565. oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.taskAttributes))
  566. for kiter59,viter60 in self.taskAttributes.items():
  567. oprot.writeString(kiter59)
  568. oprot.writeString(viter60)
  569. oprot.writeMapEnd()
  570. oprot.writeFieldEnd()
  571. if self.taskCounters != None:
  572. oprot.writeFieldBegin('taskCounters', TType.MAP, 4)
  573. oprot.writeMapBegin(TType.STRING, TType.I64, len(self.taskCounters))
  574. for kiter61,viter62 in self.taskCounters.items():
  575. oprot.writeString(kiter61)
  576. oprot.writeI64(viter62)
  577. oprot.writeMapEnd()
  578. oprot.writeFieldEnd()
  579. if self.operatorGraph != None:
  580. oprot.writeFieldBegin('operatorGraph', TType.STRUCT, 5)
  581. self.operatorGraph.write(oprot)
  582. oprot.writeFieldEnd()
  583. if self.operatorList != None:
  584. oprot.writeFieldBegin('operatorList', TType.LIST, 6)
  585. oprot.writeListBegin(TType.STRUCT, len(self.operatorList))
  586. for iter63 in self.operatorList:
  587. iter63.write(oprot)
  588. oprot.writeListEnd()
  589. oprot.writeFieldEnd()
  590. if self.done != None:
  591. oprot.writeFieldBegin('done', TType.BOOL, 7)
  592. oprot.writeBool(self.done)
  593. oprot.writeFieldEnd()
  594. if self.started != None:
  595. oprot.writeFieldBegin('started', TType.BOOL, 8)
  596. oprot.writeBool(self.started)
  597. oprot.writeFieldEnd()
  598. oprot.writeFieldStop()
  599. oprot.writeStructEnd()
  600. def validate(self):
  601. return
  602. def __repr__(self):
  603. L = ['%s=%r' % (key, value)
  604. for key, value in self.__dict__.iteritems()]
  605. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  606. def __eq__(self, other):
  607. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  608. def __ne__(self, other):
  609. return not (self == other)
  610. class Stage:
  611. """
  612. Attributes:
  613. - stageId
  614. - stageType
  615. - stageAttributes
  616. - stageCounters
  617. - taskList
  618. - done
  619. - started
  620. """
  621. thrift_spec = (
  622. None, # 0
  623. (1, TType.STRING, 'stageId', None, None, ), # 1
  624. (2, TType.I32, 'stageType', None, None, ), # 2
  625. (3, TType.MAP, 'stageAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
  626. (4, TType.MAP, 'stageCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
  627. (5, TType.LIST, 'taskList', (TType.STRUCT,(Task, Task.thrift_spec)), None, ), # 5
  628. (6, TType.BOOL, 'done', None, None, ), # 6
  629. (7, TType.BOOL, 'started', None, None, ), # 7
  630. )
  631. def __init__(self, stageId=None, stageType=None, stageAttributes=None, stageCounters=None, taskList=None, done=None, started=None,):
  632. self.stageId = stageId
  633. self.stageType = stageType
  634. self.stageAttributes = stageAttributes
  635. self.stageCounters = stageCounters
  636. self.taskList = taskList
  637. self.done = done
  638. self.started = started
  639. def read(self, iprot):
  640. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  641. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  642. return
  643. iprot.readStructBegin()
  644. while True:
  645. (fname, ftype, fid) = iprot.readFieldBegin()
  646. if ftype == TType.STOP:
  647. break
  648. if fid == 1:
  649. if ftype == TType.STRING:
  650. self.stageId = iprot.readString();
  651. else:
  652. iprot.skip(ftype)
  653. elif fid == 2:
  654. if ftype == TType.I32:
  655. self.stageType = iprot.readI32();
  656. else:
  657. iprot.skip(ftype)
  658. elif fid == 3:
  659. if ftype == TType.MAP:
  660. self.stageAttributes = {}
  661. (_ktype65, _vtype66, _size64 ) = iprot.readMapBegin()
  662. for _i68 in xrange(_size64):
  663. _key69 = iprot.readString();
  664. _val70 = iprot.readString();
  665. self.stageAttributes[_key69] = _val70
  666. iprot.readMapEnd()
  667. else:
  668. iprot.skip(ftype)
  669. elif fid == 4:
  670. if ftype == TType.MAP:
  671. self.stageCounters = {}
  672. (_ktype72, _vtype73, _size71 ) = iprot.readMapBegin()
  673. for _i75 in xrange(_size71):
  674. _key76 = iprot.readString();
  675. _val77 = iprot.readI64();
  676. self.stageCounters[_key76] = _val77
  677. iprot.readMapEnd()
  678. else:
  679. iprot.skip(ftype)
  680. elif fid == 5:
  681. if ftype == TType.LIST:
  682. self.taskList = []
  683. (_etype81, _size78) = iprot.readListBegin()
  684. for _i82 in xrange(_size78):
  685. _elem83 = Task()
  686. _elem83.read(iprot)
  687. self.taskList.append(_elem83)
  688. iprot.readListEnd()
  689. else:
  690. iprot.skip(ftype)
  691. elif fid == 6:
  692. if ftype == TType.BOOL:
  693. self.done = iprot.readBool();
  694. else:
  695. iprot.skip(ftype)
  696. elif fid == 7:
  697. if ftype == TType.BOOL:
  698. self.started = iprot.readBool();
  699. else:
  700. iprot.skip(ftype)
  701. else:
  702. iprot.skip(ftype)
  703. iprot.readFieldEnd()
  704. iprot.readStructEnd()
  705. def write(self, oprot):
  706. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  707. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  708. return
  709. oprot.writeStructBegin('Stage')
  710. if self.stageId != None:
  711. oprot.writeFieldBegin('stageId', TType.STRING, 1)
  712. oprot.writeString(self.stageId)
  713. oprot.writeFieldEnd()
  714. if self.stageType != None:
  715. oprot.writeFieldBegin('stageType', TType.I32, 2)
  716. oprot.writeI32(self.stageType)
  717. oprot.writeFieldEnd()
  718. if self.stageAttributes != None:
  719. oprot.writeFieldBegin('stageAttributes', TType.MAP, 3)
  720. oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.stageAttributes))
  721. for kiter84,viter85 in self.stageAttributes.items():
  722. oprot.writeString(kiter84)
  723. oprot.writeString(viter85)
  724. oprot.writeMapEnd()
  725. oprot.writeFieldEnd()
  726. if self.stageCounters != None:
  727. oprot.writeFieldBegin('stageCounters', TType.MAP, 4)
  728. oprot.writeMapBegin(TType.STRING, TType.I64, len(self.stageCounters))
  729. for kiter86,viter87 in self.stageCounters.items():
  730. oprot.writeString(kiter86)
  731. oprot.writeI64(viter87)
  732. oprot.writeMapEnd()
  733. oprot.writeFieldEnd()
  734. if self.taskList != None:
  735. oprot.writeFieldBegin('taskList', TType.LIST, 5)
  736. oprot.writeListBegin(TType.STRUCT, len(self.taskList))
  737. for iter88 in self.taskList:
  738. iter88.write(oprot)
  739. oprot.writeListEnd()
  740. oprot.writeFieldEnd()
  741. if self.done != None:
  742. oprot.writeFieldBegin('done', TType.BOOL, 6)
  743. oprot.writeBool(self.done)
  744. oprot.writeFieldEnd()
  745. if self.started != None:
  746. oprot.writeFieldBegin('started', TType.BOOL, 7)
  747. oprot.writeBool(self.started)
  748. oprot.writeFieldEnd()
  749. oprot.writeFieldStop()
  750. oprot.writeStructEnd()
  751. def validate(self):
  752. return
  753. def __repr__(self):
  754. L = ['%s=%r' % (key, value)
  755. for key, value in self.__dict__.iteritems()]
  756. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  757. def __eq__(self, other):
  758. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  759. def __ne__(self, other):
  760. return not (self == other)
  761. class Query:
  762. """
  763. Attributes:
  764. - queryId
  765. - queryType
  766. - queryAttributes
  767. - queryCounters
  768. - stageGraph
  769. - stageList
  770. - done
  771. - started
  772. """
  773. thrift_spec = (
  774. None, # 0
  775. (1, TType.STRING, 'queryId', None, None, ), # 1
  776. (2, TType.STRING, 'queryType', None, None, ), # 2
  777. (3, TType.MAP, 'queryAttributes', (TType.STRING,None,TType.STRING,None), None, ), # 3
  778. (4, TType.MAP, 'queryCounters', (TType.STRING,None,TType.I64,None), None, ), # 4
  779. (5, TType.STRUCT, 'stageGraph', (Graph, Graph.thrift_spec), None, ), # 5
  780. (6, TType.LIST, 'stageList', (TType.STRUCT,(Stage, Stage.thrift_spec)), None, ), # 6
  781. (7, TType.BOOL, 'done', None, None, ), # 7
  782. (8, TType.BOOL, 'started', None, None, ), # 8
  783. )
  784. def __init__(self, queryId=None, queryType=None, queryAttributes=None, queryCounters=None, stageGraph=None, stageList=None, done=None, started=None,):
  785. self.queryId = queryId
  786. self.queryType = queryType
  787. self.queryAttributes = queryAttributes
  788. self.queryCounters = queryCounters
  789. self.stageGraph = stageGraph
  790. self.stageList = stageList
  791. self.done = done
  792. self.started = started
  793. def read(self, iprot):
  794. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  795. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  796. return
  797. iprot.readStructBegin()
  798. while True:
  799. (fname, ftype, fid) = iprot.readFieldBegin()
  800. if ftype == TType.STOP:
  801. break
  802. if fid == 1:
  803. if ftype == TType.STRING:
  804. self.queryId = iprot.readString();
  805. else:
  806. iprot.skip(ftype)
  807. elif fid == 2:
  808. if ftype == TType.STRING:
  809. self.queryType = iprot.readString();
  810. else:
  811. iprot.skip(ftype)
  812. elif fid == 3:
  813. if ftype == TType.MAP:
  814. self.queryAttributes = {}
  815. (_ktype90, _vtype91, _size89 ) = iprot.readMapBegin()
  816. for _i93 in xrange(_size89):
  817. _key94 = iprot.readString();
  818. _val95 = iprot.readString();
  819. self.queryAttributes[_key94] = _val95
  820. iprot.readMapEnd()
  821. else:
  822. iprot.skip(ftype)
  823. elif fid == 4:
  824. if ftype == TType.MAP:
  825. self.queryCounters = {}
  826. (_ktype97, _vtype98, _size96 ) = iprot.readMapBegin()
  827. for _i100 in xrange(_size96):
  828. _key101 = iprot.readString();
  829. _val102 = iprot.readI64();
  830. self.queryCounters[_key101] = _val102
  831. iprot.readMapEnd()
  832. else:
  833. iprot.skip(ftype)
  834. elif fid == 5:
  835. if ftype == TType.STRUCT:
  836. self.stageGraph = Graph()
  837. self.stageGraph.read(iprot)
  838. else:
  839. iprot.skip(ftype)
  840. elif fid == 6:
  841. if ftype == TType.LIST:
  842. self.stageList = []
  843. (_etype106, _size103) = iprot.readListBegin()
  844. for _i107 in xrange(_size103):
  845. _elem108 = Stage()
  846. _elem108.read(iprot)
  847. self.stageList.append(_elem108)
  848. iprot.readListEnd()
  849. else:
  850. iprot.skip(ftype)
  851. elif fid == 7:
  852. if ftype == TType.BOOL:
  853. self.done = iprot.readBool();
  854. else:
  855. iprot.skip(ftype)
  856. elif fid == 8:
  857. if ftype == TType.BOOL:
  858. self.started = iprot.readBool();
  859. else:
  860. iprot.skip(ftype)
  861. else:
  862. iprot.skip(ftype)
  863. iprot.readFieldEnd()
  864. iprot.readStructEnd()
  865. def write(self, oprot):
  866. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  867. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  868. return
  869. oprot.writeStructBegin('Query')
  870. if self.queryId != None:
  871. oprot.writeFieldBegin('queryId', TType.STRING, 1)
  872. oprot.writeString(self.queryId)
  873. oprot.writeFieldEnd()
  874. if self.queryType != None:
  875. oprot.writeFieldBegin('queryType', TType.STRING, 2)
  876. oprot.writeString(self.queryType)
  877. oprot.writeFieldEnd()
  878. if self.queryAttributes != None:
  879. oprot.writeFieldBegin('queryAttributes', TType.MAP, 3)
  880. oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.queryAttributes))
  881. for kiter109,viter110 in self.queryAttributes.items():
  882. oprot.writeString(kiter109)
  883. oprot.writeString(viter110)
  884. oprot.writeMapEnd()
  885. oprot.writeFieldEnd()
  886. if self.queryCounters != None:
  887. oprot.writeFieldBegin('queryCounters', TType.MAP, 4)
  888. oprot.writeMapBegin(TType.STRING, TType.I64, len(self.queryCounters))
  889. for kiter111,viter112 in self.queryCounters.items():
  890. oprot.writeString(kiter111)
  891. oprot.writeI64(viter112)
  892. oprot.writeMapEnd()
  893. oprot.writeFieldEnd()
  894. if self.stageGraph != None:
  895. oprot.writeFieldBegin('stageGraph', TType.STRUCT, 5)
  896. self.stageGraph.write(oprot)
  897. oprot.writeFieldEnd()
  898. if self.stageList != None:
  899. oprot.writeFieldBegin('stageList', TType.LIST, 6)
  900. oprot.writeListBegin(TType.STRUCT, len(self.stageList))
  901. for iter113 in self.stageList:
  902. iter113.write(oprot)
  903. oprot.writeListEnd()
  904. oprot.writeFieldEnd()
  905. if self.done != None:
  906. oprot.writeFieldBegin('done', TType.BOOL, 7)
  907. oprot.writeBool(self.done)
  908. oprot.writeFieldEnd()
  909. if self.started != None:
  910. oprot.writeFieldBegin('started', TType.BOOL, 8)
  911. oprot.writeBool(self.started)
  912. oprot.writeFieldEnd()
  913. oprot.writeFieldStop()
  914. oprot.writeStructEnd()
  915. def validate(self):
  916. return
  917. def __repr__(self):
  918. L = ['%s=%r' % (key, value)
  919. for key, value in self.__dict__.iteritems()]
  920. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  921. def __eq__(self, other):
  922. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  923. def __ne__(self, other):
  924. return not (self == other)
  925. class QueryPlan:
  926. """
  927. Attributes:
  928. - queries
  929. - done
  930. - started
  931. """
  932. thrift_spec = (
  933. None, # 0
  934. (1, TType.LIST, 'queries', (TType.STRUCT,(Query, Query.thrift_spec)), None, ), # 1
  935. (2, TType.BOOL, 'done', None, None, ), # 2
  936. (3, TType.BOOL, 'started', None, None, ), # 3
  937. )
  938. def __init__(self, queries=None, done=None, started=None,):
  939. self.queries = queries
  940. self.done = done
  941. self.started = started
  942. def read(self, iprot):
  943. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  944. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  945. return
  946. iprot.readStructBegin()
  947. while True:
  948. (fname, ftype, fid) = iprot.readFieldBegin()
  949. if ftype == TType.STOP:
  950. break
  951. if fid == 1:
  952. if ftype == TType.LIST:
  953. self.queries = []
  954. (_etype117, _size114) = iprot.readListBegin()
  955. for _i118 in xrange(_size114):
  956. _elem119 = Query()
  957. _elem119.read(iprot)
  958. self.queries.append(_elem119)
  959. iprot.readListEnd()
  960. else:
  961. iprot.skip(ftype)
  962. elif fid == 2:
  963. if ftype == TType.BOOL:
  964. self.done = iprot.readBool();
  965. else:
  966. iprot.skip(ftype)
  967. elif fid == 3:
  968. if ftype == TType.BOOL:
  969. self.started = iprot.readBool();
  970. else:
  971. iprot.skip(ftype)
  972. else:
  973. iprot.skip(ftype)
  974. iprot.readFieldEnd()
  975. iprot.readStructEnd()
  976. def write(self, oprot):
  977. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  978. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  979. return
  980. oprot.writeStructBegin('QueryPlan')
  981. if self.queries != None:
  982. oprot.writeFieldBegin('queries', TType.LIST, 1)
  983. oprot.writeListBegin(TType.STRUCT, len(self.queries))
  984. for iter120 in self.queries:
  985. iter120.write(oprot)
  986. oprot.writeListEnd()
  987. oprot.writeFieldEnd()
  988. if self.done != None:
  989. oprot.writeFieldBegin('done', TType.BOOL, 2)
  990. oprot.writeBool(self.done)
  991. oprot.writeFieldEnd()
  992. if self.started != None:
  993. oprot.writeFieldBegin('started', TType.BOOL, 3)
  994. oprot.writeBool(self.started)
  995. oprot.writeFieldEnd()
  996. oprot.writeFieldStop()
  997. oprot.writeStructEnd()
  998. def validate(self):
  999. return
  1000. def __repr__(self):
  1001. L = ['%s=%r' % (key, value)
  1002. for key, value in self.__dict__.iteritems()]
  1003. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  1004. def __eq__(self, other):
  1005. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  1006. def __ne__(self, other):
  1007. return not (self == other)