PageRenderTime 26ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/service/src/gen/thrift/gen-py/hive_service/ttypes.py

#
Python | 239 lines | 192 code | 27 blank | 20 comment | 61 complexity | c1905b4adb1631e719af0e99f7b767f3 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. import fb303.ttypes
  8. import hive_metastore.ttypes
  9. import queryplan.ttypes
  10. from thrift.transport import TTransport
  11. from thrift.protocol import TBinaryProtocol, TProtocol
  12. try:
  13. from thrift.protocol import fastbinary
  14. except:
  15. fastbinary = None
  16. class JobTrackerState:
  17. INITIALIZING = 1
  18. RUNNING = 2
  19. _VALUES_TO_NAMES = {
  20. 1: "INITIALIZING",
  21. 2: "RUNNING",
  22. }
  23. _NAMES_TO_VALUES = {
  24. "INITIALIZING": 1,
  25. "RUNNING": 2,
  26. }
  27. class HiveClusterStatus:
  28. """
  29. Attributes:
  30. - taskTrackers
  31. - mapTasks
  32. - reduceTasks
  33. - maxMapTasks
  34. - maxReduceTasks
  35. - state
  36. """
  37. thrift_spec = (
  38. None, # 0
  39. (1, TType.I32, 'taskTrackers', None, None, ), # 1
  40. (2, TType.I32, 'mapTasks', None, None, ), # 2
  41. (3, TType.I32, 'reduceTasks', None, None, ), # 3
  42. (4, TType.I32, 'maxMapTasks', None, None, ), # 4
  43. (5, TType.I32, 'maxReduceTasks', None, None, ), # 5
  44. (6, TType.I32, 'state', None, None, ), # 6
  45. )
  46. def __init__(self, taskTrackers=None, mapTasks=None, reduceTasks=None, maxMapTasks=None, maxReduceTasks=None, state=None,):
  47. self.taskTrackers = taskTrackers
  48. self.mapTasks = mapTasks
  49. self.reduceTasks = reduceTasks
  50. self.maxMapTasks = maxMapTasks
  51. self.maxReduceTasks = maxReduceTasks
  52. self.state = state
  53. def read(self, iprot):
  54. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  55. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  56. return
  57. iprot.readStructBegin()
  58. while True:
  59. (fname, ftype, fid) = iprot.readFieldBegin()
  60. if ftype == TType.STOP:
  61. break
  62. if fid == 1:
  63. if ftype == TType.I32:
  64. self.taskTrackers = iprot.readI32();
  65. else:
  66. iprot.skip(ftype)
  67. elif fid == 2:
  68. if ftype == TType.I32:
  69. self.mapTasks = iprot.readI32();
  70. else:
  71. iprot.skip(ftype)
  72. elif fid == 3:
  73. if ftype == TType.I32:
  74. self.reduceTasks = iprot.readI32();
  75. else:
  76. iprot.skip(ftype)
  77. elif fid == 4:
  78. if ftype == TType.I32:
  79. self.maxMapTasks = iprot.readI32();
  80. else:
  81. iprot.skip(ftype)
  82. elif fid == 5:
  83. if ftype == TType.I32:
  84. self.maxReduceTasks = iprot.readI32();
  85. else:
  86. iprot.skip(ftype)
  87. elif fid == 6:
  88. if ftype == TType.I32:
  89. self.state = iprot.readI32();
  90. else:
  91. iprot.skip(ftype)
  92. else:
  93. iprot.skip(ftype)
  94. iprot.readFieldEnd()
  95. iprot.readStructEnd()
  96. def write(self, oprot):
  97. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  98. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  99. return
  100. oprot.writeStructBegin('HiveClusterStatus')
  101. if self.taskTrackers != None:
  102. oprot.writeFieldBegin('taskTrackers', TType.I32, 1)
  103. oprot.writeI32(self.taskTrackers)
  104. oprot.writeFieldEnd()
  105. if self.mapTasks != None:
  106. oprot.writeFieldBegin('mapTasks', TType.I32, 2)
  107. oprot.writeI32(self.mapTasks)
  108. oprot.writeFieldEnd()
  109. if self.reduceTasks != None:
  110. oprot.writeFieldBegin('reduceTasks', TType.I32, 3)
  111. oprot.writeI32(self.reduceTasks)
  112. oprot.writeFieldEnd()
  113. if self.maxMapTasks != None:
  114. oprot.writeFieldBegin('maxMapTasks', TType.I32, 4)
  115. oprot.writeI32(self.maxMapTasks)
  116. oprot.writeFieldEnd()
  117. if self.maxReduceTasks != None:
  118. oprot.writeFieldBegin('maxReduceTasks', TType.I32, 5)
  119. oprot.writeI32(self.maxReduceTasks)
  120. oprot.writeFieldEnd()
  121. if self.state != None:
  122. oprot.writeFieldBegin('state', TType.I32, 6)
  123. oprot.writeI32(self.state)
  124. oprot.writeFieldEnd()
  125. oprot.writeFieldStop()
  126. oprot.writeStructEnd()
  127. def validate(self):
  128. return
  129. def __repr__(self):
  130. L = ['%s=%r' % (key, value)
  131. for key, value in self.__dict__.iteritems()]
  132. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  133. def __eq__(self, other):
  134. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  135. def __ne__(self, other):
  136. return not (self == other)
  137. class HiveServerException(Exception):
  138. """
  139. Attributes:
  140. - message
  141. - errorCode
  142. - SQLState
  143. """
  144. thrift_spec = (
  145. None, # 0
  146. (1, TType.STRING, 'message', None, None, ), # 1
  147. (2, TType.I32, 'errorCode', None, None, ), # 2
  148. (3, TType.STRING, 'SQLState', None, None, ), # 3
  149. )
  150. def __init__(self, message=None, errorCode=None, SQLState=None,):
  151. self.message = message
  152. self.errorCode = errorCode
  153. self.SQLState = SQLState
  154. def read(self, iprot):
  155. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  156. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  157. return
  158. iprot.readStructBegin()
  159. while True:
  160. (fname, ftype, fid) = iprot.readFieldBegin()
  161. if ftype == TType.STOP:
  162. break
  163. if fid == 1:
  164. if ftype == TType.STRING:
  165. self.message = iprot.readString();
  166. else:
  167. iprot.skip(ftype)
  168. elif fid == 2:
  169. if ftype == TType.I32:
  170. self.errorCode = iprot.readI32();
  171. else:
  172. iprot.skip(ftype)
  173. elif fid == 3:
  174. if ftype == TType.STRING:
  175. self.SQLState = iprot.readString();
  176. else:
  177. iprot.skip(ftype)
  178. else:
  179. iprot.skip(ftype)
  180. iprot.readFieldEnd()
  181. iprot.readStructEnd()
  182. def write(self, oprot):
  183. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  184. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  185. return
  186. oprot.writeStructBegin('HiveServerException')
  187. if self.message != None:
  188. oprot.writeFieldBegin('message', TType.STRING, 1)
  189. oprot.writeString(self.message)
  190. oprot.writeFieldEnd()
  191. if self.errorCode != None:
  192. oprot.writeFieldBegin('errorCode', TType.I32, 2)
  193. oprot.writeI32(self.errorCode)
  194. oprot.writeFieldEnd()
  195. if self.SQLState != None:
  196. oprot.writeFieldBegin('SQLState', TType.STRING, 3)
  197. oprot.writeString(self.SQLState)
  198. oprot.writeFieldEnd()
  199. oprot.writeFieldStop()
  200. oprot.writeStructEnd()
  201. def validate(self):
  202. return
  203. def __str__(self):
  204. return repr(self)
  205. def __repr__(self):
  206. L = ['%s=%r' % (key, value)
  207. for key, value in self.__dict__.iteritems()]
  208. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  209. def __eq__(self, other):
  210. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  211. def __ne__(self, other):
  212. return not (self == other)