ImpalaHiveServer2Service.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. #
  2. # Autogenerated by Thrift Compiler (0.9.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, TException, TApplicationException
  9. import cli_service.TCLIService
  10. from ttypes import *
  11. from thrift.Thrift import TProcessor
  12. from thrift.transport import TTransport
  13. from thrift.protocol import TBinaryProtocol, TProtocol
  14. try:
  15. from thrift.protocol import fastbinary
  16. except:
  17. fastbinary = None
  18. class Iface(cli_service.TCLIService.Iface):
  19. def ResetCatalog(self, ):
  20. pass
  21. def ResetTable(self, request):
  22. """
  23. Parameters:
  24. - request
  25. """
  26. pass
  27. class Client(cli_service.TCLIService.Client, Iface):
  28. def __init__(self, iprot, oprot=None):
  29. cli_service.TCLIService.Client.__init__(self, iprot, oprot)
  30. def ResetCatalog(self, ):
  31. self.send_ResetCatalog()
  32. return self.recv_ResetCatalog()
  33. def send_ResetCatalog(self, ):
  34. self._oprot.writeMessageBegin('ResetCatalog', TMessageType.CALL, self._seqid)
  35. args = ResetCatalog_args()
  36. args.write(self._oprot)
  37. self._oprot.writeMessageEnd()
  38. self._oprot.trans.flush()
  39. def recv_ResetCatalog(self, ):
  40. (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  41. if mtype == TMessageType.EXCEPTION:
  42. x = TApplicationException()
  43. x.read(self._iprot)
  44. self._iprot.readMessageEnd()
  45. raise x
  46. result = ResetCatalog_result()
  47. result.read(self._iprot)
  48. self._iprot.readMessageEnd()
  49. if result.success is not None:
  50. return result.success
  51. raise TApplicationException(TApplicationException.MISSING_RESULT, "ResetCatalog failed: unknown result");
  52. def ResetTable(self, request):
  53. """
  54. Parameters:
  55. - request
  56. """
  57. self.send_ResetTable(request)
  58. return self.recv_ResetTable()
  59. def send_ResetTable(self, request):
  60. self._oprot.writeMessageBegin('ResetTable', TMessageType.CALL, self._seqid)
  61. args = ResetTable_args()
  62. args.request = request
  63. args.write(self._oprot)
  64. self._oprot.writeMessageEnd()
  65. self._oprot.trans.flush()
  66. def recv_ResetTable(self, ):
  67. (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  68. if mtype == TMessageType.EXCEPTION:
  69. x = TApplicationException()
  70. x.read(self._iprot)
  71. self._iprot.readMessageEnd()
  72. raise x
  73. result = ResetTable_result()
  74. result.read(self._iprot)
  75. self._iprot.readMessageEnd()
  76. if result.success is not None:
  77. return result.success
  78. raise TApplicationException(TApplicationException.MISSING_RESULT, "ResetTable failed: unknown result");
  79. class Processor(cli_service.TCLIService.Processor, Iface, TProcessor):
  80. def __init__(self, handler):
  81. cli_service.TCLIService.Processor.__init__(self, handler)
  82. self._processMap["ResetCatalog"] = Processor.process_ResetCatalog
  83. self._processMap["ResetTable"] = Processor.process_ResetTable
  84. def process(self, iprot, oprot):
  85. (name, type, seqid) = iprot.readMessageBegin()
  86. if name not in self._processMap:
  87. iprot.skip(TType.STRUCT)
  88. iprot.readMessageEnd()
  89. x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
  90. oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
  91. x.write(oprot)
  92. oprot.writeMessageEnd()
  93. oprot.trans.flush()
  94. return
  95. else:
  96. self._processMap[name](self, seqid, iprot, oprot)
  97. return True
  98. def process_ResetCatalog(self, seqid, iprot, oprot):
  99. args = ResetCatalog_args()
  100. args.read(iprot)
  101. iprot.readMessageEnd()
  102. result = ResetCatalog_result()
  103. result.success = self._handler.ResetCatalog()
  104. oprot.writeMessageBegin("ResetCatalog", TMessageType.REPLY, seqid)
  105. result.write(oprot)
  106. oprot.writeMessageEnd()
  107. oprot.trans.flush()
  108. def process_ResetTable(self, seqid, iprot, oprot):
  109. args = ResetTable_args()
  110. args.read(iprot)
  111. iprot.readMessageEnd()
  112. result = ResetTable_result()
  113. result.success = self._handler.ResetTable(args.request)
  114. oprot.writeMessageBegin("ResetTable", TMessageType.REPLY, seqid)
  115. result.write(oprot)
  116. oprot.writeMessageEnd()
  117. oprot.trans.flush()
  118. # HELPER FUNCTIONS AND STRUCTURES
  119. class ResetCatalog_args(object):
  120. thrift_spec = (
  121. )
  122. def read(self, iprot):
  123. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  124. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  125. return
  126. iprot.readStructBegin()
  127. while True:
  128. (fname, ftype, fid) = iprot.readFieldBegin()
  129. if ftype == TType.STOP:
  130. break
  131. else:
  132. iprot.skip(ftype)
  133. iprot.readFieldEnd()
  134. iprot.readStructEnd()
  135. def write(self, oprot):
  136. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  137. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  138. return
  139. oprot.writeStructBegin('ResetCatalog_args')
  140. oprot.writeFieldStop()
  141. oprot.writeStructEnd()
  142. def validate(self):
  143. return
  144. def __repr__(self):
  145. L = ['%s=%r' % (key, value)
  146. for key, value in self.__dict__.iteritems()]
  147. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  148. def __eq__(self, other):
  149. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  150. def __ne__(self, other):
  151. return not (self == other)
  152. class ResetCatalog_result(object):
  153. """
  154. Attributes:
  155. - success
  156. """
  157. thrift_spec = (
  158. (0, TType.STRUCT, 'success', (TResetCatalogResp, TResetCatalogResp.thrift_spec), None, ), # 0
  159. )
  160. def __init__(self, success=None,):
  161. self.success = success
  162. def read(self, iprot):
  163. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  164. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  165. return
  166. iprot.readStructBegin()
  167. while True:
  168. (fname, ftype, fid) = iprot.readFieldBegin()
  169. if ftype == TType.STOP:
  170. break
  171. if fid == 0:
  172. if ftype == TType.STRUCT:
  173. self.success = TResetCatalogResp()
  174. self.success.read(iprot)
  175. else:
  176. iprot.skip(ftype)
  177. else:
  178. iprot.skip(ftype)
  179. iprot.readFieldEnd()
  180. iprot.readStructEnd()
  181. def write(self, oprot):
  182. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  183. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  184. return
  185. oprot.writeStructBegin('ResetCatalog_result')
  186. if self.success is not None:
  187. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  188. self.success.write(oprot)
  189. oprot.writeFieldEnd()
  190. oprot.writeFieldStop()
  191. oprot.writeStructEnd()
  192. def validate(self):
  193. return
  194. def __repr__(self):
  195. L = ['%s=%r' % (key, value)
  196. for key, value in self.__dict__.iteritems()]
  197. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  198. def __eq__(self, other):
  199. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  200. def __ne__(self, other):
  201. return not (self == other)
  202. class ResetTable_args(object):
  203. """
  204. Attributes:
  205. - request
  206. """
  207. thrift_spec = (
  208. None, # 0
  209. (1, TType.STRUCT, 'request', (TResetTableReq, TResetTableReq.thrift_spec), None, ), # 1
  210. )
  211. def __init__(self, request=None,):
  212. self.request = request
  213. def read(self, iprot):
  214. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  215. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  216. return
  217. iprot.readStructBegin()
  218. while True:
  219. (fname, ftype, fid) = iprot.readFieldBegin()
  220. if ftype == TType.STOP:
  221. break
  222. if fid == 1:
  223. if ftype == TType.STRUCT:
  224. self.request = TResetTableReq()
  225. self.request.read(iprot)
  226. else:
  227. iprot.skip(ftype)
  228. else:
  229. iprot.skip(ftype)
  230. iprot.readFieldEnd()
  231. iprot.readStructEnd()
  232. def write(self, oprot):
  233. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  234. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  235. return
  236. oprot.writeStructBegin('ResetTable_args')
  237. if self.request is not None:
  238. oprot.writeFieldBegin('request', TType.STRUCT, 1)
  239. self.request.write(oprot)
  240. oprot.writeFieldEnd()
  241. oprot.writeFieldStop()
  242. oprot.writeStructEnd()
  243. def validate(self):
  244. return
  245. def __repr__(self):
  246. L = ['%s=%r' % (key, value)
  247. for key, value in self.__dict__.iteritems()]
  248. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  249. def __eq__(self, other):
  250. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  251. def __ne__(self, other):
  252. return not (self == other)
  253. class ResetTable_result(object):
  254. """
  255. Attributes:
  256. - success
  257. """
  258. thrift_spec = (
  259. (0, TType.STRUCT, 'success', (TResetTableResp, TResetTableResp.thrift_spec), None, ), # 0
  260. )
  261. def __init__(self, success=None,):
  262. self.success = success
  263. def read(self, iprot):
  264. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  265. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  266. return
  267. iprot.readStructBegin()
  268. while True:
  269. (fname, ftype, fid) = iprot.readFieldBegin()
  270. if ftype == TType.STOP:
  271. break
  272. if fid == 0:
  273. if ftype == TType.STRUCT:
  274. self.success = TResetTableResp()
  275. self.success.read(iprot)
  276. else:
  277. iprot.skip(ftype)
  278. else:
  279. iprot.skip(ftype)
  280. iprot.readFieldEnd()
  281. iprot.readStructEnd()
  282. def write(self, oprot):
  283. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  284. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  285. return
  286. oprot.writeStructBegin('ResetTable_result')
  287. if self.success is not None:
  288. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  289. self.success.write(oprot)
  290. oprot.writeFieldEnd()
  291. oprot.writeFieldStop()
  292. oprot.writeStructEnd()
  293. def validate(self):
  294. return
  295. def __repr__(self):
  296. L = ['%s=%r' % (key, value)
  297. for key, value in self.__dict__.iteritems()]
  298. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  299. def __eq__(self, other):
  300. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  301. def __ne__(self, other):
  302. return not (self == other)