PageRenderTime 55ms CodeModel.GetById 12ms app.highlight 39ms RepoModel.GetById 1ms app.codeStats 1ms

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