ImpalaHiveServer2Service.py 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. class Client(cli_service.TCLIService.Client, Iface):
  22. def __init__(self, iprot, oprot=None):
  23. cli_service.TCLIService.Client.__init__(self, iprot, oprot)
  24. def ResetCatalog(self, ):
  25. self.send_ResetCatalog()
  26. return self.recv_ResetCatalog()
  27. def send_ResetCatalog(self, ):
  28. self._oprot.writeMessageBegin('ResetCatalog', TMessageType.CALL, self._seqid)
  29. args = ResetCatalog_args()
  30. args.write(self._oprot)
  31. self._oprot.writeMessageEnd()
  32. self._oprot.trans.flush()
  33. def recv_ResetCatalog(self, ):
  34. (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  35. if mtype == TMessageType.EXCEPTION:
  36. x = TApplicationException()
  37. x.read(self._iprot)
  38. self._iprot.readMessageEnd()
  39. raise x
  40. result = ResetCatalog_result()
  41. result.read(self._iprot)
  42. self._iprot.readMessageEnd()
  43. if result.success is not None:
  44. return result.success
  45. raise TApplicationException(TApplicationException.MISSING_RESULT, "ResetCatalog failed: unknown result");
  46. class Processor(cli_service.TCLIService.Processor, Iface, TProcessor):
  47. def __init__(self, handler):
  48. cli_service.TCLIService.Processor.__init__(self, handler)
  49. self._processMap["ResetCatalog"] = Processor.process_ResetCatalog
  50. def process(self, iprot, oprot):
  51. (name, type, seqid) = iprot.readMessageBegin()
  52. if name not in self._processMap:
  53. iprot.skip(TType.STRUCT)
  54. iprot.readMessageEnd()
  55. x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
  56. oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
  57. x.write(oprot)
  58. oprot.writeMessageEnd()
  59. oprot.trans.flush()
  60. return
  61. else:
  62. self._processMap[name](self, seqid, iprot, oprot)
  63. return True
  64. def process_ResetCatalog(self, seqid, iprot, oprot):
  65. args = ResetCatalog_args()
  66. args.read(iprot)
  67. iprot.readMessageEnd()
  68. result = ResetCatalog_result()
  69. result.success = self._handler.ResetCatalog()
  70. oprot.writeMessageBegin("ResetCatalog", TMessageType.REPLY, seqid)
  71. result.write(oprot)
  72. oprot.writeMessageEnd()
  73. oprot.trans.flush()
  74. # HELPER FUNCTIONS AND STRUCTURES
  75. class ResetCatalog_args(object):
  76. thrift_spec = (
  77. )
  78. def read(self, iprot):
  79. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  80. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  81. return
  82. iprot.readStructBegin()
  83. while True:
  84. (fname, ftype, fid) = iprot.readFieldBegin()
  85. if ftype == TType.STOP:
  86. break
  87. else:
  88. iprot.skip(ftype)
  89. iprot.readFieldEnd()
  90. iprot.readStructEnd()
  91. def write(self, oprot):
  92. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  93. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  94. return
  95. oprot.writeStructBegin('ResetCatalog_args')
  96. oprot.writeFieldStop()
  97. oprot.writeStructEnd()
  98. def validate(self):
  99. return
  100. def __repr__(self):
  101. L = ['%s=%r' % (key, value)
  102. for key, value in self.__dict__.iteritems()]
  103. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  104. def __eq__(self, other):
  105. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  106. def __ne__(self, other):
  107. return not (self == other)
  108. class ResetCatalog_result(object):
  109. """
  110. Attributes:
  111. - success
  112. """
  113. thrift_spec = (
  114. (0, TType.STRUCT, 'success', (Status.ttypes.TStatus, Status.ttypes.TStatus.thrift_spec), None, ), # 0
  115. )
  116. def __init__(self, success=None,):
  117. self.success = success
  118. def read(self, iprot):
  119. if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
  120. fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
  121. return
  122. iprot.readStructBegin()
  123. while True:
  124. (fname, ftype, fid) = iprot.readFieldBegin()
  125. if ftype == TType.STOP:
  126. break
  127. if fid == 0:
  128. if ftype == TType.STRUCT:
  129. self.success = Status.ttypes.TStatus()
  130. self.success.read(iprot)
  131. else:
  132. iprot.skip(ftype)
  133. else:
  134. iprot.skip(ftype)
  135. iprot.readFieldEnd()
  136. iprot.readStructEnd()
  137. def write(self, oprot):
  138. if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
  139. oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
  140. return
  141. oprot.writeStructBegin('ResetCatalog_result')
  142. if self.success is not None:
  143. oprot.writeFieldBegin('success', TType.STRUCT, 0)
  144. self.success.write(oprot)
  145. oprot.writeFieldEnd()
  146. oprot.writeFieldStop()
  147. oprot.writeStructEnd()
  148. def validate(self):
  149. return
  150. def __repr__(self):
  151. L = ['%s=%r' % (key, value)
  152. for key, value in self.__dict__.iteritems()]
  153. return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
  154. def __eq__(self, other):
  155. return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
  156. def __ne__(self, other):
  157. return not (self == other)