| # |
| # Autogenerated by Thrift Compiler (0.7.0) |
| # |
| # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| # |
| |
| from thrift.Thrift import * |
| |
| from thrift.transport import TTransport |
| from thrift.protocol import TBinaryProtocol, TProtocol |
| try: |
| from thrift.protocol import fastbinary |
| except: |
| fastbinary = None |
| |
| |
| |
| class JavaObjectArg: |
| """ |
| Attributes: |
| - int_arg |
| - long_arg |
| - string_arg |
| - bool_arg |
| - binary_arg |
| - double_arg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'int_arg', None, None, ), # 1 |
| (2, TType.I64, 'long_arg', None, None, ), # 2 |
| (3, TType.STRING, 'string_arg', None, None, ), # 3 |
| (4, TType.BOOL, 'bool_arg', None, None, ), # 4 |
| (5, TType.STRING, 'binary_arg', None, None, ), # 5 |
| (6, TType.DOUBLE, 'double_arg', None, None, ), # 6 |
| ) |
| |
| def __init__(self, int_arg=None, long_arg=None, string_arg=None, bool_arg=None, binary_arg=None, double_arg=None,): |
| self.int_arg = int_arg |
| self.long_arg = long_arg |
| self.string_arg = string_arg |
| self.bool_arg = bool_arg |
| self.binary_arg = binary_arg |
| self.double_arg = double_arg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.I32: |
| self.int_arg = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I64: |
| self.long_arg = iprot.readI64(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.string_arg = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.BOOL: |
| self.bool_arg = iprot.readBool(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.STRING: |
| self.binary_arg = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.DOUBLE: |
| self.double_arg = iprot.readDouble(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('JavaObjectArg') |
| if self.int_arg is not None: |
| oprot.writeFieldBegin('int_arg', TType.I32, 1) |
| oprot.writeI32(self.int_arg) |
| oprot.writeFieldEnd() |
| if self.long_arg is not None: |
| oprot.writeFieldBegin('long_arg', TType.I64, 2) |
| oprot.writeI64(self.long_arg) |
| oprot.writeFieldEnd() |
| if self.string_arg is not None: |
| oprot.writeFieldBegin('string_arg', TType.STRING, 3) |
| oprot.writeString(self.string_arg.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.bool_arg is not None: |
| oprot.writeFieldBegin('bool_arg', TType.BOOL, 4) |
| oprot.writeBool(self.bool_arg) |
| oprot.writeFieldEnd() |
| if self.binary_arg is not None: |
| oprot.writeFieldBegin('binary_arg', TType.STRING, 5) |
| oprot.writeString(self.binary_arg) |
| oprot.writeFieldEnd() |
| if self.double_arg is not None: |
| oprot.writeFieldBegin('double_arg', TType.DOUBLE, 6) |
| oprot.writeDouble(self.double_arg) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class JavaObject: |
| """ |
| Attributes: |
| - full_class_name |
| - args_list |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'full_class_name', None, None, ), # 1 |
| (2, TType.LIST, 'args_list', (TType.STRUCT,(JavaObjectArg, JavaObjectArg.thrift_spec)), None, ), # 2 |
| ) |
| |
| def __init__(self, full_class_name=None, args_list=None,): |
| self.full_class_name = full_class_name |
| self.args_list = args_list |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.full_class_name = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.LIST: |
| self.args_list = [] |
| (_etype3, _size0) = iprot.readListBegin() |
| for _i4 in xrange(_size0): |
| _elem5 = JavaObjectArg() |
| _elem5.read(iprot) |
| self.args_list.append(_elem5) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('JavaObject') |
| if self.full_class_name is not None: |
| oprot.writeFieldBegin('full_class_name', TType.STRING, 1) |
| oprot.writeString(self.full_class_name.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.args_list is not None: |
| oprot.writeFieldBegin('args_list', TType.LIST, 2) |
| oprot.writeListBegin(TType.STRUCT, len(self.args_list)) |
| for iter6 in self.args_list: |
| iter6.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.full_class_name is None: |
| raise TProtocol.TProtocolException(message='Required field full_class_name is unset!') |
| if self.args_list is None: |
| raise TProtocol.TProtocolException(message='Required field args_list is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class NullStruct: |
| |
| thrift_spec = ( |
| ) |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('NullStruct') |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class GlobalStreamId: |
| """ |
| Attributes: |
| - componentId |
| - streamId |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'componentId', None, None, ), # 1 |
| (2, TType.STRING, 'streamId', None, None, ), # 2 |
| ) |
| |
| def __init__(self, componentId=None, streamId=None,): |
| self.componentId = componentId |
| self.streamId = streamId |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.componentId = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.streamId = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('GlobalStreamId') |
| if self.componentId is not None: |
| oprot.writeFieldBegin('componentId', TType.STRING, 1) |
| oprot.writeString(self.componentId.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.streamId is not None: |
| oprot.writeFieldBegin('streamId', TType.STRING, 2) |
| oprot.writeString(self.streamId.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.componentId is None: |
| raise TProtocol.TProtocolException(message='Required field componentId is unset!') |
| if self.streamId is None: |
| raise TProtocol.TProtocolException(message='Required field streamId is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class Grouping: |
| """ |
| Attributes: |
| - fields |
| - shuffle |
| - all |
| - none |
| - direct |
| - custom_object |
| - custom_serialized |
| - local_or_shuffle |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.LIST, 'fields', (TType.STRING,None), None, ), # 1 |
| (2, TType.STRUCT, 'shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 2 |
| (3, TType.STRUCT, 'all', (NullStruct, NullStruct.thrift_spec), None, ), # 3 |
| (4, TType.STRUCT, 'none', (NullStruct, NullStruct.thrift_spec), None, ), # 4 |
| (5, TType.STRUCT, 'direct', (NullStruct, NullStruct.thrift_spec), None, ), # 5 |
| (6, TType.STRUCT, 'custom_object', (JavaObject, JavaObject.thrift_spec), None, ), # 6 |
| (7, TType.STRING, 'custom_serialized', None, None, ), # 7 |
| (8, TType.STRUCT, 'local_or_shuffle', (NullStruct, NullStruct.thrift_spec), None, ), # 8 |
| ) |
| |
| def __init__(self, fields=None, shuffle=None, all=None, none=None, direct=None, custom_object=None, custom_serialized=None, local_or_shuffle=None,): |
| self.fields = fields |
| self.shuffle = shuffle |
| self.all = all |
| self.none = none |
| self.direct = direct |
| self.custom_object = custom_object |
| self.custom_serialized = custom_serialized |
| self.local_or_shuffle = local_or_shuffle |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.LIST: |
| self.fields = [] |
| (_etype10, _size7) = iprot.readListBegin() |
| for _i11 in xrange(_size7): |
| _elem12 = iprot.readString().decode('utf-8') |
| self.fields.append(_elem12) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.shuffle = NullStruct() |
| self.shuffle.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRUCT: |
| self.all = NullStruct() |
| self.all.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.STRUCT: |
| self.none = NullStruct() |
| self.none.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.STRUCT: |
| self.direct = NullStruct() |
| self.direct.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.STRUCT: |
| self.custom_object = JavaObject() |
| self.custom_object.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 7: |
| if ftype == TType.STRING: |
| self.custom_serialized = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 8: |
| if ftype == TType.STRUCT: |
| self.local_or_shuffle = NullStruct() |
| self.local_or_shuffle.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('Grouping') |
| if self.fields is not None: |
| oprot.writeFieldBegin('fields', TType.LIST, 1) |
| oprot.writeListBegin(TType.STRING, len(self.fields)) |
| for iter13 in self.fields: |
| oprot.writeString(iter13.encode('utf-8')) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.shuffle is not None: |
| oprot.writeFieldBegin('shuffle', TType.STRUCT, 2) |
| self.shuffle.write(oprot) |
| oprot.writeFieldEnd() |
| if self.all is not None: |
| oprot.writeFieldBegin('all', TType.STRUCT, 3) |
| self.all.write(oprot) |
| oprot.writeFieldEnd() |
| if self.none is not None: |
| oprot.writeFieldBegin('none', TType.STRUCT, 4) |
| self.none.write(oprot) |
| oprot.writeFieldEnd() |
| if self.direct is not None: |
| oprot.writeFieldBegin('direct', TType.STRUCT, 5) |
| self.direct.write(oprot) |
| oprot.writeFieldEnd() |
| if self.custom_object is not None: |
| oprot.writeFieldBegin('custom_object', TType.STRUCT, 6) |
| self.custom_object.write(oprot) |
| oprot.writeFieldEnd() |
| if self.custom_serialized is not None: |
| oprot.writeFieldBegin('custom_serialized', TType.STRING, 7) |
| oprot.writeString(self.custom_serialized) |
| oprot.writeFieldEnd() |
| if self.local_or_shuffle is not None: |
| oprot.writeFieldBegin('local_or_shuffle', TType.STRUCT, 8) |
| self.local_or_shuffle.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class StreamInfo: |
| """ |
| Attributes: |
| - output_fields |
| - direct |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.LIST, 'output_fields', (TType.STRING,None), None, ), # 1 |
| (2, TType.BOOL, 'direct', None, None, ), # 2 |
| ) |
| |
| def __init__(self, output_fields=None, direct=None,): |
| self.output_fields = output_fields |
| self.direct = direct |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.LIST: |
| self.output_fields = [] |
| (_etype17, _size14) = iprot.readListBegin() |
| for _i18 in xrange(_size14): |
| _elem19 = iprot.readString().decode('utf-8') |
| self.output_fields.append(_elem19) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.BOOL: |
| self.direct = iprot.readBool(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('StreamInfo') |
| if self.output_fields is not None: |
| oprot.writeFieldBegin('output_fields', TType.LIST, 1) |
| oprot.writeListBegin(TType.STRING, len(self.output_fields)) |
| for iter20 in self.output_fields: |
| oprot.writeString(iter20.encode('utf-8')) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.direct is not None: |
| oprot.writeFieldBegin('direct', TType.BOOL, 2) |
| oprot.writeBool(self.direct) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.output_fields is None: |
| raise TProtocol.TProtocolException(message='Required field output_fields is unset!') |
| if self.direct is None: |
| raise TProtocol.TProtocolException(message='Required field direct is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class ShellComponent: |
| """ |
| Attributes: |
| - execution_command |
| - script |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'execution_command', None, None, ), # 1 |
| (2, TType.STRING, 'script', None, None, ), # 2 |
| ) |
| |
| def __init__(self, execution_command=None, script=None,): |
| self.execution_command = execution_command |
| self.script = script |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.execution_command = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.script = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('ShellComponent') |
| if self.execution_command is not None: |
| oprot.writeFieldBegin('execution_command', TType.STRING, 1) |
| oprot.writeString(self.execution_command.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.script is not None: |
| oprot.writeFieldBegin('script', TType.STRING, 2) |
| oprot.writeString(self.script.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class ComponentObject: |
| """ |
| Attributes: |
| - serialized_java |
| - shell |
| - java_object |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'serialized_java', None, None, ), # 1 |
| (2, TType.STRUCT, 'shell', (ShellComponent, ShellComponent.thrift_spec), None, ), # 2 |
| (3, TType.STRUCT, 'java_object', (JavaObject, JavaObject.thrift_spec), None, ), # 3 |
| ) |
| |
| def __init__(self, serialized_java=None, shell=None, java_object=None,): |
| self.serialized_java = serialized_java |
| self.shell = shell |
| self.java_object = java_object |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.serialized_java = iprot.readString(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.shell = ShellComponent() |
| self.shell.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRUCT: |
| self.java_object = JavaObject() |
| self.java_object.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('ComponentObject') |
| if self.serialized_java is not None: |
| oprot.writeFieldBegin('serialized_java', TType.STRING, 1) |
| oprot.writeString(self.serialized_java) |
| oprot.writeFieldEnd() |
| if self.shell is not None: |
| oprot.writeFieldBegin('shell', TType.STRUCT, 2) |
| self.shell.write(oprot) |
| oprot.writeFieldEnd() |
| if self.java_object is not None: |
| oprot.writeFieldBegin('java_object', TType.STRUCT, 3) |
| self.java_object.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class ComponentCommon: |
| """ |
| Attributes: |
| - inputs |
| - streams |
| - parallelism_hint |
| - json_conf |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.MAP, 'inputs', (TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.STRUCT,(Grouping, Grouping.thrift_spec)), None, ), # 1 |
| (2, TType.MAP, 'streams', (TType.STRING,None,TType.STRUCT,(StreamInfo, StreamInfo.thrift_spec)), None, ), # 2 |
| (3, TType.I32, 'parallelism_hint', None, None, ), # 3 |
| (4, TType.STRING, 'json_conf', None, None, ), # 4 |
| ) |
| |
| def __init__(self, inputs=None, streams=None, parallelism_hint=None, json_conf=None,): |
| self.inputs = inputs |
| self.streams = streams |
| self.parallelism_hint = parallelism_hint |
| self.json_conf = json_conf |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.MAP: |
| self.inputs = {} |
| (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() |
| for _i25 in xrange(_size21): |
| _key26 = GlobalStreamId() |
| _key26.read(iprot) |
| _val27 = Grouping() |
| _val27.read(iprot) |
| self.inputs[_key26] = _val27 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.MAP: |
| self.streams = {} |
| (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() |
| for _i32 in xrange(_size28): |
| _key33 = iprot.readString().decode('utf-8') |
| _val34 = StreamInfo() |
| _val34.read(iprot) |
| self.streams[_key33] = _val34 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.I32: |
| self.parallelism_hint = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.STRING: |
| self.json_conf = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('ComponentCommon') |
| if self.inputs is not None: |
| oprot.writeFieldBegin('inputs', TType.MAP, 1) |
| oprot.writeMapBegin(TType.STRUCT, TType.STRUCT, len(self.inputs)) |
| for kiter35,viter36 in self.inputs.items(): |
| kiter35.write(oprot) |
| viter36.write(oprot) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.streams is not None: |
| oprot.writeFieldBegin('streams', TType.MAP, 2) |
| oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.streams)) |
| for kiter37,viter38 in self.streams.items(): |
| oprot.writeString(kiter37.encode('utf-8')) |
| viter38.write(oprot) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.parallelism_hint is not None: |
| oprot.writeFieldBegin('parallelism_hint', TType.I32, 3) |
| oprot.writeI32(self.parallelism_hint) |
| oprot.writeFieldEnd() |
| if self.json_conf is not None: |
| oprot.writeFieldBegin('json_conf', TType.STRING, 4) |
| oprot.writeString(self.json_conf.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.inputs is None: |
| raise TProtocol.TProtocolException(message='Required field inputs is unset!') |
| if self.streams is None: |
| raise TProtocol.TProtocolException(message='Required field streams is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class SpoutSpec: |
| """ |
| Attributes: |
| - spout_object |
| - common |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 |
| (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 |
| ) |
| |
| def __init__(self, spout_object=None, common=None,): |
| self.spout_object = spout_object |
| self.common = common |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRUCT: |
| self.spout_object = ComponentObject() |
| self.spout_object.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.common = ComponentCommon() |
| self.common.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('SpoutSpec') |
| if self.spout_object is not None: |
| oprot.writeFieldBegin('spout_object', TType.STRUCT, 1) |
| self.spout_object.write(oprot) |
| oprot.writeFieldEnd() |
| if self.common is not None: |
| oprot.writeFieldBegin('common', TType.STRUCT, 2) |
| self.common.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.spout_object is None: |
| raise TProtocol.TProtocolException(message='Required field spout_object is unset!') |
| if self.common is None: |
| raise TProtocol.TProtocolException(message='Required field common is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class Bolt: |
| """ |
| Attributes: |
| - bolt_object |
| - common |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'bolt_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 |
| (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 |
| ) |
| |
| def __init__(self, bolt_object=None, common=None,): |
| self.bolt_object = bolt_object |
| self.common = common |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRUCT: |
| self.bolt_object = ComponentObject() |
| self.bolt_object.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.common = ComponentCommon() |
| self.common.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('Bolt') |
| if self.bolt_object is not None: |
| oprot.writeFieldBegin('bolt_object', TType.STRUCT, 1) |
| self.bolt_object.write(oprot) |
| oprot.writeFieldEnd() |
| if self.common is not None: |
| oprot.writeFieldBegin('common', TType.STRUCT, 2) |
| self.common.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.bolt_object is None: |
| raise TProtocol.TProtocolException(message='Required field bolt_object is unset!') |
| if self.common is None: |
| raise TProtocol.TProtocolException(message='Required field common is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class StateSpoutSpec: |
| """ |
| Attributes: |
| - state_spout_object |
| - common |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'state_spout_object', (ComponentObject, ComponentObject.thrift_spec), None, ), # 1 |
| (2, TType.STRUCT, 'common', (ComponentCommon, ComponentCommon.thrift_spec), None, ), # 2 |
| ) |
| |
| def __init__(self, state_spout_object=None, common=None,): |
| self.state_spout_object = state_spout_object |
| self.common = common |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRUCT: |
| self.state_spout_object = ComponentObject() |
| self.state_spout_object.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.common = ComponentCommon() |
| self.common.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('StateSpoutSpec') |
| if self.state_spout_object is not None: |
| oprot.writeFieldBegin('state_spout_object', TType.STRUCT, 1) |
| self.state_spout_object.write(oprot) |
| oprot.writeFieldEnd() |
| if self.common is not None: |
| oprot.writeFieldBegin('common', TType.STRUCT, 2) |
| self.common.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.state_spout_object is None: |
| raise TProtocol.TProtocolException(message='Required field state_spout_object is unset!') |
| if self.common is None: |
| raise TProtocol.TProtocolException(message='Required field common is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class StormTopology: |
| """ |
| Attributes: |
| - spouts |
| - bolts |
| - state_spouts |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.MAP, 'spouts', (TType.STRING,None,TType.STRUCT,(SpoutSpec, SpoutSpec.thrift_spec)), None, ), # 1 |
| (2, TType.MAP, 'bolts', (TType.STRING,None,TType.STRUCT,(Bolt, Bolt.thrift_spec)), None, ), # 2 |
| (3, TType.MAP, 'state_spouts', (TType.STRING,None,TType.STRUCT,(StateSpoutSpec, StateSpoutSpec.thrift_spec)), None, ), # 3 |
| ) |
| |
| def __init__(self, spouts=None, bolts=None, state_spouts=None,): |
| self.spouts = spouts |
| self.bolts = bolts |
| self.state_spouts = state_spouts |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.MAP: |
| self.spouts = {} |
| (_ktype40, _vtype41, _size39 ) = iprot.readMapBegin() |
| for _i43 in xrange(_size39): |
| _key44 = iprot.readString().decode('utf-8') |
| _val45 = SpoutSpec() |
| _val45.read(iprot) |
| self.spouts[_key44] = _val45 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.MAP: |
| self.bolts = {} |
| (_ktype47, _vtype48, _size46 ) = iprot.readMapBegin() |
| for _i50 in xrange(_size46): |
| _key51 = iprot.readString().decode('utf-8') |
| _val52 = Bolt() |
| _val52.read(iprot) |
| self.bolts[_key51] = _val52 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.MAP: |
| self.state_spouts = {} |
| (_ktype54, _vtype55, _size53 ) = iprot.readMapBegin() |
| for _i57 in xrange(_size53): |
| _key58 = iprot.readString().decode('utf-8') |
| _val59 = StateSpoutSpec() |
| _val59.read(iprot) |
| self.state_spouts[_key58] = _val59 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('StormTopology') |
| if self.spouts is not None: |
| oprot.writeFieldBegin('spouts', TType.MAP, 1) |
| oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.spouts)) |
| for kiter60,viter61 in self.spouts.items(): |
| oprot.writeString(kiter60.encode('utf-8')) |
| viter61.write(oprot) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.bolts is not None: |
| oprot.writeFieldBegin('bolts', TType.MAP, 2) |
| oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.bolts)) |
| for kiter62,viter63 in self.bolts.items(): |
| oprot.writeString(kiter62.encode('utf-8')) |
| viter63.write(oprot) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.state_spouts is not None: |
| oprot.writeFieldBegin('state_spouts', TType.MAP, 3) |
| oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.state_spouts)) |
| for kiter64,viter65 in self.state_spouts.items(): |
| oprot.writeString(kiter64.encode('utf-8')) |
| viter65.write(oprot) |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.spouts is None: |
| raise TProtocol.TProtocolException(message='Required field spouts is unset!') |
| if self.bolts is None: |
| raise TProtocol.TProtocolException(message='Required field bolts is unset!') |
| if self.state_spouts is None: |
| raise TProtocol.TProtocolException(message='Required field state_spouts is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class AlreadyAliveException(Exception): |
| """ |
| Attributes: |
| - msg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'msg', None, None, ), # 1 |
| ) |
| |
| def __init__(self, msg=None,): |
| self.msg = msg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.msg = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('AlreadyAliveException') |
| if self.msg is not None: |
| oprot.writeFieldBegin('msg', TType.STRING, 1) |
| oprot.writeString(self.msg.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.msg is None: |
| raise TProtocol.TProtocolException(message='Required field msg is unset!') |
| return |
| |
| |
| def __str__(self): |
| return repr(self) |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class NotAliveException(Exception): |
| """ |
| Attributes: |
| - msg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'msg', None, None, ), # 1 |
| ) |
| |
| def __init__(self, msg=None,): |
| self.msg = msg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.msg = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('NotAliveException') |
| if self.msg is not None: |
| oprot.writeFieldBegin('msg', TType.STRING, 1) |
| oprot.writeString(self.msg.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.msg is None: |
| raise TProtocol.TProtocolException(message='Required field msg is unset!') |
| return |
| |
| |
| def __str__(self): |
| return repr(self) |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class InvalidTopologyException(Exception): |
| """ |
| Attributes: |
| - msg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'msg', None, None, ), # 1 |
| ) |
| |
| def __init__(self, msg=None,): |
| self.msg = msg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.msg = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('InvalidTopologyException') |
| if self.msg is not None: |
| oprot.writeFieldBegin('msg', TType.STRING, 1) |
| oprot.writeString(self.msg.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.msg is None: |
| raise TProtocol.TProtocolException(message='Required field msg is unset!') |
| return |
| |
| |
| def __str__(self): |
| return repr(self) |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class TopologySummary: |
| """ |
| Attributes: |
| - id |
| - name |
| - num_tasks |
| - num_workers |
| - uptime_secs |
| - status |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'id', None, None, ), # 1 |
| (2, TType.STRING, 'name', None, None, ), # 2 |
| (3, TType.I32, 'num_tasks', None, None, ), # 3 |
| (4, TType.I32, 'num_workers', None, None, ), # 4 |
| (5, TType.I32, 'uptime_secs', None, None, ), # 5 |
| (6, TType.STRING, 'status', None, None, ), # 6 |
| ) |
| |
| def __init__(self, id=None, name=None, num_tasks=None, num_workers=None, uptime_secs=None, status=None,): |
| self.id = id |
| self.name = name |
| self.num_tasks = num_tasks |
| self.num_workers = num_workers |
| self.uptime_secs = uptime_secs |
| self.status = status |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.id = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.name = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.I32: |
| self.num_tasks = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.I32: |
| self.num_workers = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.I32: |
| self.uptime_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.STRING: |
| self.status = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('TopologySummary') |
| if self.id is not None: |
| oprot.writeFieldBegin('id', TType.STRING, 1) |
| oprot.writeString(self.id.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.name is not None: |
| oprot.writeFieldBegin('name', TType.STRING, 2) |
| oprot.writeString(self.name.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.num_tasks is not None: |
| oprot.writeFieldBegin('num_tasks', TType.I32, 3) |
| oprot.writeI32(self.num_tasks) |
| oprot.writeFieldEnd() |
| if self.num_workers is not None: |
| oprot.writeFieldBegin('num_workers', TType.I32, 4) |
| oprot.writeI32(self.num_workers) |
| oprot.writeFieldEnd() |
| if self.uptime_secs is not None: |
| oprot.writeFieldBegin('uptime_secs', TType.I32, 5) |
| oprot.writeI32(self.uptime_secs) |
| oprot.writeFieldEnd() |
| if self.status is not None: |
| oprot.writeFieldBegin('status', TType.STRING, 6) |
| oprot.writeString(self.status.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.id is None: |
| raise TProtocol.TProtocolException(message='Required field id is unset!') |
| if self.name is None: |
| raise TProtocol.TProtocolException(message='Required field name is unset!') |
| if self.num_tasks is None: |
| raise TProtocol.TProtocolException(message='Required field num_tasks is unset!') |
| if self.num_workers is None: |
| raise TProtocol.TProtocolException(message='Required field num_workers is unset!') |
| if self.uptime_secs is None: |
| raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') |
| if self.status is None: |
| raise TProtocol.TProtocolException(message='Required field status is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class SupervisorSummary: |
| """ |
| Attributes: |
| - host |
| - uptime_secs |
| - num_workers |
| - num_used_workers |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'host', None, None, ), # 1 |
| (2, TType.I32, 'uptime_secs', None, None, ), # 2 |
| (3, TType.I32, 'num_workers', None, None, ), # 3 |
| (4, TType.I32, 'num_used_workers', None, None, ), # 4 |
| ) |
| |
| def __init__(self, host=None, uptime_secs=None, num_workers=None, num_used_workers=None,): |
| self.host = host |
| self.uptime_secs = uptime_secs |
| self.num_workers = num_workers |
| self.num_used_workers = num_used_workers |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.host = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I32: |
| self.uptime_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.I32: |
| self.num_workers = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.I32: |
| self.num_used_workers = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('SupervisorSummary') |
| if self.host is not None: |
| oprot.writeFieldBegin('host', TType.STRING, 1) |
| oprot.writeString(self.host.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.uptime_secs is not None: |
| oprot.writeFieldBegin('uptime_secs', TType.I32, 2) |
| oprot.writeI32(self.uptime_secs) |
| oprot.writeFieldEnd() |
| if self.num_workers is not None: |
| oprot.writeFieldBegin('num_workers', TType.I32, 3) |
| oprot.writeI32(self.num_workers) |
| oprot.writeFieldEnd() |
| if self.num_used_workers is not None: |
| oprot.writeFieldBegin('num_used_workers', TType.I32, 4) |
| oprot.writeI32(self.num_used_workers) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.host is None: |
| raise TProtocol.TProtocolException(message='Required field host is unset!') |
| if self.uptime_secs is None: |
| raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') |
| if self.num_workers is None: |
| raise TProtocol.TProtocolException(message='Required field num_workers is unset!') |
| if self.num_used_workers is None: |
| raise TProtocol.TProtocolException(message='Required field num_used_workers is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class ClusterSummary: |
| """ |
| Attributes: |
| - supervisors |
| - nimbus_uptime_secs |
| - topologies |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.LIST, 'supervisors', (TType.STRUCT,(SupervisorSummary, SupervisorSummary.thrift_spec)), None, ), # 1 |
| (2, TType.I32, 'nimbus_uptime_secs', None, None, ), # 2 |
| (3, TType.LIST, 'topologies', (TType.STRUCT,(TopologySummary, TopologySummary.thrift_spec)), None, ), # 3 |
| ) |
| |
| def __init__(self, supervisors=None, nimbus_uptime_secs=None, topologies=None,): |
| self.supervisors = supervisors |
| self.nimbus_uptime_secs = nimbus_uptime_secs |
| self.topologies = topologies |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.LIST: |
| self.supervisors = [] |
| (_etype69, _size66) = iprot.readListBegin() |
| for _i70 in xrange(_size66): |
| _elem71 = SupervisorSummary() |
| _elem71.read(iprot) |
| self.supervisors.append(_elem71) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I32: |
| self.nimbus_uptime_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.LIST: |
| self.topologies = [] |
| (_etype75, _size72) = iprot.readListBegin() |
| for _i76 in xrange(_size72): |
| _elem77 = TopologySummary() |
| _elem77.read(iprot) |
| self.topologies.append(_elem77) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('ClusterSummary') |
| if self.supervisors is not None: |
| oprot.writeFieldBegin('supervisors', TType.LIST, 1) |
| oprot.writeListBegin(TType.STRUCT, len(self.supervisors)) |
| for iter78 in self.supervisors: |
| iter78.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.nimbus_uptime_secs is not None: |
| oprot.writeFieldBegin('nimbus_uptime_secs', TType.I32, 2) |
| oprot.writeI32(self.nimbus_uptime_secs) |
| oprot.writeFieldEnd() |
| if self.topologies is not None: |
| oprot.writeFieldBegin('topologies', TType.LIST, 3) |
| oprot.writeListBegin(TType.STRUCT, len(self.topologies)) |
| for iter79 in self.topologies: |
| iter79.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.supervisors is None: |
| raise TProtocol.TProtocolException(message='Required field supervisors is unset!') |
| if self.nimbus_uptime_secs is None: |
| raise TProtocol.TProtocolException(message='Required field nimbus_uptime_secs is unset!') |
| if self.topologies is None: |
| raise TProtocol.TProtocolException(message='Required field topologies is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class ErrorInfo: |
| """ |
| Attributes: |
| - error |
| - error_time_secs |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'error', None, None, ), # 1 |
| (2, TType.I32, 'error_time_secs', None, None, ), # 2 |
| ) |
| |
| def __init__(self, error=None, error_time_secs=None,): |
| self.error = error |
| self.error_time_secs = error_time_secs |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.error = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.I32: |
| self.error_time_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('ErrorInfo') |
| if self.error is not None: |
| oprot.writeFieldBegin('error', TType.STRING, 1) |
| oprot.writeString(self.error.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.error_time_secs is not None: |
| oprot.writeFieldBegin('error_time_secs', TType.I32, 2) |
| oprot.writeI32(self.error_time_secs) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.error is None: |
| raise TProtocol.TProtocolException(message='Required field error is unset!') |
| if self.error_time_secs is None: |
| raise TProtocol.TProtocolException(message='Required field error_time_secs is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class BoltStats: |
| """ |
| Attributes: |
| - acked |
| - failed |
| - process_ms_avg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.MAP, 'acked', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 1 |
| (2, TType.MAP, 'failed', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.I64,None)), None, ), # 2 |
| (3, TType.MAP, 'process_ms_avg', (TType.STRING,None,TType.MAP,(TType.STRUCT,(GlobalStreamId, GlobalStreamId.thrift_spec),TType.DOUBLE,None)), None, ), # 3 |
| ) |
| |
| def __init__(self, acked=None, failed=None, process_ms_avg=None,): |
| self.acked = acked |
| self.failed = failed |
| self.process_ms_avg = process_ms_avg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.MAP: |
| self.acked = {} |
| (_ktype81, _vtype82, _size80 ) = iprot.readMapBegin() |
| for _i84 in xrange(_size80): |
| _key85 = iprot.readString().decode('utf-8') |
| _val86 = {} |
| (_ktype88, _vtype89, _size87 ) = iprot.readMapBegin() |
| for _i91 in xrange(_size87): |
| _key92 = GlobalStreamId() |
| _key92.read(iprot) |
| _val93 = iprot.readI64(); |
| _val86[_key92] = _val93 |
| iprot.readMapEnd() |
| self.acked[_key85] = _val86 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.MAP: |
| self.failed = {} |
| (_ktype95, _vtype96, _size94 ) = iprot.readMapBegin() |
| for _i98 in xrange(_size94): |
| _key99 = iprot.readString().decode('utf-8') |
| _val100 = {} |
| (_ktype102, _vtype103, _size101 ) = iprot.readMapBegin() |
| for _i105 in xrange(_size101): |
| _key106 = GlobalStreamId() |
| _key106.read(iprot) |
| _val107 = iprot.readI64(); |
| _val100[_key106] = _val107 |
| iprot.readMapEnd() |
| self.failed[_key99] = _val100 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.MAP: |
| self.process_ms_avg = {} |
| (_ktype109, _vtype110, _size108 ) = iprot.readMapBegin() |
| for _i112 in xrange(_size108): |
| _key113 = iprot.readString().decode('utf-8') |
| _val114 = {} |
| (_ktype116, _vtype117, _size115 ) = iprot.readMapBegin() |
| for _i119 in xrange(_size115): |
| _key120 = GlobalStreamId() |
| _key120.read(iprot) |
| _val121 = iprot.readDouble(); |
| _val114[_key120] = _val121 |
| iprot.readMapEnd() |
| self.process_ms_avg[_key113] = _val114 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('BoltStats') |
| if self.acked is not None: |
| oprot.writeFieldBegin('acked', TType.MAP, 1) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.acked)) |
| for kiter122,viter123 in self.acked.items(): |
| oprot.writeString(kiter122.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter123)) |
| for kiter124,viter125 in viter123.items(): |
| kiter124.write(oprot) |
| oprot.writeI64(viter125) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.failed is not None: |
| oprot.writeFieldBegin('failed', TType.MAP, 2) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.failed)) |
| for kiter126,viter127 in self.failed.items(): |
| oprot.writeString(kiter126.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRUCT, TType.I64, len(viter127)) |
| for kiter128,viter129 in viter127.items(): |
| kiter128.write(oprot) |
| oprot.writeI64(viter129) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.process_ms_avg is not None: |
| oprot.writeFieldBegin('process_ms_avg', TType.MAP, 3) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.process_ms_avg)) |
| for kiter130,viter131 in self.process_ms_avg.items(): |
| oprot.writeString(kiter130.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRUCT, TType.DOUBLE, len(viter131)) |
| for kiter132,viter133 in viter131.items(): |
| kiter132.write(oprot) |
| oprot.writeDouble(viter133) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.acked is None: |
| raise TProtocol.TProtocolException(message='Required field acked is unset!') |
| if self.failed is None: |
| raise TProtocol.TProtocolException(message='Required field failed is unset!') |
| if self.process_ms_avg is None: |
| raise TProtocol.TProtocolException(message='Required field process_ms_avg is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class SpoutStats: |
| """ |
| Attributes: |
| - acked |
| - failed |
| - complete_ms_avg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.MAP, 'acked', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 1 |
| (2, TType.MAP, 'failed', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 2 |
| (3, TType.MAP, 'complete_ms_avg', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.DOUBLE,None)), None, ), # 3 |
| ) |
| |
| def __init__(self, acked=None, failed=None, complete_ms_avg=None,): |
| self.acked = acked |
| self.failed = failed |
| self.complete_ms_avg = complete_ms_avg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.MAP: |
| self.acked = {} |
| (_ktype135, _vtype136, _size134 ) = iprot.readMapBegin() |
| for _i138 in xrange(_size134): |
| _key139 = iprot.readString().decode('utf-8') |
| _val140 = {} |
| (_ktype142, _vtype143, _size141 ) = iprot.readMapBegin() |
| for _i145 in xrange(_size141): |
| _key146 = iprot.readString().decode('utf-8') |
| _val147 = iprot.readI64(); |
| _val140[_key146] = _val147 |
| iprot.readMapEnd() |
| self.acked[_key139] = _val140 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.MAP: |
| self.failed = {} |
| (_ktype149, _vtype150, _size148 ) = iprot.readMapBegin() |
| for _i152 in xrange(_size148): |
| _key153 = iprot.readString().decode('utf-8') |
| _val154 = {} |
| (_ktype156, _vtype157, _size155 ) = iprot.readMapBegin() |
| for _i159 in xrange(_size155): |
| _key160 = iprot.readString().decode('utf-8') |
| _val161 = iprot.readI64(); |
| _val154[_key160] = _val161 |
| iprot.readMapEnd() |
| self.failed[_key153] = _val154 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.MAP: |
| self.complete_ms_avg = {} |
| (_ktype163, _vtype164, _size162 ) = iprot.readMapBegin() |
| for _i166 in xrange(_size162): |
| _key167 = iprot.readString().decode('utf-8') |
| _val168 = {} |
| (_ktype170, _vtype171, _size169 ) = iprot.readMapBegin() |
| for _i173 in xrange(_size169): |
| _key174 = iprot.readString().decode('utf-8') |
| _val175 = iprot.readDouble(); |
| _val168[_key174] = _val175 |
| iprot.readMapEnd() |
| self.complete_ms_avg[_key167] = _val168 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('SpoutStats') |
| if self.acked is not None: |
| oprot.writeFieldBegin('acked', TType.MAP, 1) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.acked)) |
| for kiter176,viter177 in self.acked.items(): |
| oprot.writeString(kiter176.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRING, TType.I64, len(viter177)) |
| for kiter178,viter179 in viter177.items(): |
| oprot.writeString(kiter178.encode('utf-8')) |
| oprot.writeI64(viter179) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.failed is not None: |
| oprot.writeFieldBegin('failed', TType.MAP, 2) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.failed)) |
| for kiter180,viter181 in self.failed.items(): |
| oprot.writeString(kiter180.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRING, TType.I64, len(viter181)) |
| for kiter182,viter183 in viter181.items(): |
| oprot.writeString(kiter182.encode('utf-8')) |
| oprot.writeI64(viter183) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.complete_ms_avg is not None: |
| oprot.writeFieldBegin('complete_ms_avg', TType.MAP, 3) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.complete_ms_avg)) |
| for kiter184,viter185 in self.complete_ms_avg.items(): |
| oprot.writeString(kiter184.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(viter185)) |
| for kiter186,viter187 in viter185.items(): |
| oprot.writeString(kiter186.encode('utf-8')) |
| oprot.writeDouble(viter187) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.acked is None: |
| raise TProtocol.TProtocolException(message='Required field acked is unset!') |
| if self.failed is None: |
| raise TProtocol.TProtocolException(message='Required field failed is unset!') |
| if self.complete_ms_avg is None: |
| raise TProtocol.TProtocolException(message='Required field complete_ms_avg is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class TaskSpecificStats: |
| """ |
| Attributes: |
| - bolt |
| - spout |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRUCT, 'bolt', (BoltStats, BoltStats.thrift_spec), None, ), # 1 |
| (2, TType.STRUCT, 'spout', (SpoutStats, SpoutStats.thrift_spec), None, ), # 2 |
| ) |
| |
| def __init__(self, bolt=None, spout=None,): |
| self.bolt = bolt |
| self.spout = spout |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRUCT: |
| self.bolt = BoltStats() |
| self.bolt.read(iprot) |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRUCT: |
| self.spout = SpoutStats() |
| self.spout.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('TaskSpecificStats') |
| if self.bolt is not None: |
| oprot.writeFieldBegin('bolt', TType.STRUCT, 1) |
| self.bolt.write(oprot) |
| oprot.writeFieldEnd() |
| if self.spout is not None: |
| oprot.writeFieldBegin('spout', TType.STRUCT, 2) |
| self.spout.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class TaskStats: |
| """ |
| Attributes: |
| - emitted |
| - transferred |
| - specific |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.MAP, 'emitted', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 1 |
| (2, TType.MAP, 'transferred', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.I64,None)), None, ), # 2 |
| (3, TType.STRUCT, 'specific', (TaskSpecificStats, TaskSpecificStats.thrift_spec), None, ), # 3 |
| ) |
| |
| def __init__(self, emitted=None, transferred=None, specific=None,): |
| self.emitted = emitted |
| self.transferred = transferred |
| self.specific = specific |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.MAP: |
| self.emitted = {} |
| (_ktype189, _vtype190, _size188 ) = iprot.readMapBegin() |
| for _i192 in xrange(_size188): |
| _key193 = iprot.readString().decode('utf-8') |
| _val194 = {} |
| (_ktype196, _vtype197, _size195 ) = iprot.readMapBegin() |
| for _i199 in xrange(_size195): |
| _key200 = iprot.readString().decode('utf-8') |
| _val201 = iprot.readI64(); |
| _val194[_key200] = _val201 |
| iprot.readMapEnd() |
| self.emitted[_key193] = _val194 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.MAP: |
| self.transferred = {} |
| (_ktype203, _vtype204, _size202 ) = iprot.readMapBegin() |
| for _i206 in xrange(_size202): |
| _key207 = iprot.readString().decode('utf-8') |
| _val208 = {} |
| (_ktype210, _vtype211, _size209 ) = iprot.readMapBegin() |
| for _i213 in xrange(_size209): |
| _key214 = iprot.readString().decode('utf-8') |
| _val215 = iprot.readI64(); |
| _val208[_key214] = _val215 |
| iprot.readMapEnd() |
| self.transferred[_key207] = _val208 |
| iprot.readMapEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRUCT: |
| self.specific = TaskSpecificStats() |
| self.specific.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('TaskStats') |
| if self.emitted is not None: |
| oprot.writeFieldBegin('emitted', TType.MAP, 1) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.emitted)) |
| for kiter216,viter217 in self.emitted.items(): |
| oprot.writeString(kiter216.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRING, TType.I64, len(viter217)) |
| for kiter218,viter219 in viter217.items(): |
| oprot.writeString(kiter218.encode('utf-8')) |
| oprot.writeI64(viter219) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.transferred is not None: |
| oprot.writeFieldBegin('transferred', TType.MAP, 2) |
| oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.transferred)) |
| for kiter220,viter221 in self.transferred.items(): |
| oprot.writeString(kiter220.encode('utf-8')) |
| oprot.writeMapBegin(TType.STRING, TType.I64, len(viter221)) |
| for kiter222,viter223 in viter221.items(): |
| oprot.writeString(kiter222.encode('utf-8')) |
| oprot.writeI64(viter223) |
| oprot.writeMapEnd() |
| oprot.writeMapEnd() |
| oprot.writeFieldEnd() |
| if self.specific is not None: |
| oprot.writeFieldBegin('specific', TType.STRUCT, 3) |
| self.specific.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.emitted is None: |
| raise TProtocol.TProtocolException(message='Required field emitted is unset!') |
| if self.transferred is None: |
| raise TProtocol.TProtocolException(message='Required field transferred is unset!') |
| if self.specific is None: |
| raise TProtocol.TProtocolException(message='Required field specific is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class TaskSummary: |
| """ |
| Attributes: |
| - task_id |
| - component_id |
| - host |
| - port |
| - uptime_secs |
| - errors |
| - stats |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'task_id', None, None, ), # 1 |
| (2, TType.STRING, 'component_id', None, None, ), # 2 |
| (3, TType.STRING, 'host', None, None, ), # 3 |
| (4, TType.I32, 'port', None, None, ), # 4 |
| (5, TType.I32, 'uptime_secs', None, None, ), # 5 |
| (6, TType.LIST, 'errors', (TType.STRUCT,(ErrorInfo, ErrorInfo.thrift_spec)), None, ), # 6 |
| (7, TType.STRUCT, 'stats', (TaskStats, TaskStats.thrift_spec), None, ), # 7 |
| ) |
| |
| def __init__(self, task_id=None, component_id=None, host=None, port=None, uptime_secs=None, errors=None, stats=None,): |
| self.task_id = task_id |
| self.component_id = component_id |
| self.host = host |
| self.port = port |
| self.uptime_secs = uptime_secs |
| self.errors = errors |
| self.stats = stats |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.I32: |
| self.task_id = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.component_id = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.STRING: |
| self.host = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.I32: |
| self.port = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.I32: |
| self.uptime_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 6: |
| if ftype == TType.LIST: |
| self.errors = [] |
| (_etype227, _size224) = iprot.readListBegin() |
| for _i228 in xrange(_size224): |
| _elem229 = ErrorInfo() |
| _elem229.read(iprot) |
| self.errors.append(_elem229) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 7: |
| if ftype == TType.STRUCT: |
| self.stats = TaskStats() |
| self.stats.read(iprot) |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('TaskSummary') |
| if self.task_id is not None: |
| oprot.writeFieldBegin('task_id', TType.I32, 1) |
| oprot.writeI32(self.task_id) |
| oprot.writeFieldEnd() |
| if self.component_id is not None: |
| oprot.writeFieldBegin('component_id', TType.STRING, 2) |
| oprot.writeString(self.component_id.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.host is not None: |
| oprot.writeFieldBegin('host', TType.STRING, 3) |
| oprot.writeString(self.host.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.port is not None: |
| oprot.writeFieldBegin('port', TType.I32, 4) |
| oprot.writeI32(self.port) |
| oprot.writeFieldEnd() |
| if self.uptime_secs is not None: |
| oprot.writeFieldBegin('uptime_secs', TType.I32, 5) |
| oprot.writeI32(self.uptime_secs) |
| oprot.writeFieldEnd() |
| if self.errors is not None: |
| oprot.writeFieldBegin('errors', TType.LIST, 6) |
| oprot.writeListBegin(TType.STRUCT, len(self.errors)) |
| for iter230 in self.errors: |
| iter230.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.stats is not None: |
| oprot.writeFieldBegin('stats', TType.STRUCT, 7) |
| self.stats.write(oprot) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.task_id is None: |
| raise TProtocol.TProtocolException(message='Required field task_id is unset!') |
| if self.component_id is None: |
| raise TProtocol.TProtocolException(message='Required field component_id is unset!') |
| if self.host is None: |
| raise TProtocol.TProtocolException(message='Required field host is unset!') |
| if self.port is None: |
| raise TProtocol.TProtocolException(message='Required field port is unset!') |
| if self.uptime_secs is None: |
| raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') |
| if self.errors is None: |
| raise TProtocol.TProtocolException(message='Required field errors is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class TopologyInfo: |
| """ |
| Attributes: |
| - id |
| - name |
| - uptime_secs |
| - tasks |
| - status |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'id', None, None, ), # 1 |
| (2, TType.STRING, 'name', None, None, ), # 2 |
| (3, TType.I32, 'uptime_secs', None, None, ), # 3 |
| (4, TType.LIST, 'tasks', (TType.STRUCT,(TaskSummary, TaskSummary.thrift_spec)), None, ), # 4 |
| (5, TType.STRING, 'status', None, None, ), # 5 |
| ) |
| |
| def __init__(self, id=None, name=None, uptime_secs=None, tasks=None, status=None,): |
| self.id = id |
| self.name = name |
| self.uptime_secs = uptime_secs |
| self.tasks = tasks |
| self.status = status |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.id = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.name = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 3: |
| if ftype == TType.I32: |
| self.uptime_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| elif fid == 4: |
| if ftype == TType.LIST: |
| self.tasks = [] |
| (_etype234, _size231) = iprot.readListBegin() |
| for _i235 in xrange(_size231): |
| _elem236 = TaskSummary() |
| _elem236.read(iprot) |
| self.tasks.append(_elem236) |
| iprot.readListEnd() |
| else: |
| iprot.skip(ftype) |
| elif fid == 5: |
| if ftype == TType.STRING: |
| self.status = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('TopologyInfo') |
| if self.id is not None: |
| oprot.writeFieldBegin('id', TType.STRING, 1) |
| oprot.writeString(self.id.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.name is not None: |
| oprot.writeFieldBegin('name', TType.STRING, 2) |
| oprot.writeString(self.name.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.uptime_secs is not None: |
| oprot.writeFieldBegin('uptime_secs', TType.I32, 3) |
| oprot.writeI32(self.uptime_secs) |
| oprot.writeFieldEnd() |
| if self.tasks is not None: |
| oprot.writeFieldBegin('tasks', TType.LIST, 4) |
| oprot.writeListBegin(TType.STRUCT, len(self.tasks)) |
| for iter237 in self.tasks: |
| iter237.write(oprot) |
| oprot.writeListEnd() |
| oprot.writeFieldEnd() |
| if self.status is not None: |
| oprot.writeFieldBegin('status', TType.STRING, 5) |
| oprot.writeString(self.status.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.id is None: |
| raise TProtocol.TProtocolException(message='Required field id is unset!') |
| if self.name is None: |
| raise TProtocol.TProtocolException(message='Required field name is unset!') |
| if self.uptime_secs is None: |
| raise TProtocol.TProtocolException(message='Required field uptime_secs is unset!') |
| if self.tasks is None: |
| raise TProtocol.TProtocolException(message='Required field tasks is unset!') |
| if self.status is None: |
| raise TProtocol.TProtocolException(message='Required field status is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class KillOptions: |
| """ |
| Attributes: |
| - wait_secs |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'wait_secs', None, None, ), # 1 |
| ) |
| |
| def __init__(self, wait_secs=None,): |
| self.wait_secs = wait_secs |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.I32: |
| self.wait_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('KillOptions') |
| if self.wait_secs is not None: |
| oprot.writeFieldBegin('wait_secs', TType.I32, 1) |
| oprot.writeI32(self.wait_secs) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class RebalanceOptions: |
| """ |
| Attributes: |
| - wait_secs |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.I32, 'wait_secs', None, None, ), # 1 |
| ) |
| |
| def __init__(self, wait_secs=None,): |
| self.wait_secs = wait_secs |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.I32: |
| self.wait_secs = iprot.readI32(); |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('RebalanceOptions') |
| if self.wait_secs is not None: |
| oprot.writeFieldBegin('wait_secs', TType.I32, 1) |
| oprot.writeI32(self.wait_secs) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class DRPCRequest: |
| """ |
| Attributes: |
| - func_args |
| - request_id |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'func_args', None, None, ), # 1 |
| (2, TType.STRING, 'request_id', None, None, ), # 2 |
| ) |
| |
| def __init__(self, func_args=None, request_id=None,): |
| self.func_args = func_args |
| self.request_id = request_id |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.func_args = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| elif fid == 2: |
| if ftype == TType.STRING: |
| self.request_id = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('DRPCRequest') |
| if self.func_args is not None: |
| oprot.writeFieldBegin('func_args', TType.STRING, 1) |
| oprot.writeString(self.func_args.encode('utf-8')) |
| oprot.writeFieldEnd() |
| if self.request_id is not None: |
| oprot.writeFieldBegin('request_id', TType.STRING, 2) |
| oprot.writeString(self.request_id.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.func_args is None: |
| raise TProtocol.TProtocolException(message='Required field func_args is unset!') |
| if self.request_id is None: |
| raise TProtocol.TProtocolException(message='Required field request_id is unset!') |
| return |
| |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |
| |
| class DRPCExecutionException(Exception): |
| """ |
| Attributes: |
| - msg |
| """ |
| |
| thrift_spec = ( |
| None, # 0 |
| (1, TType.STRING, 'msg', None, None, ), # 1 |
| ) |
| |
| def __init__(self, msg=None,): |
| self.msg = msg |
| |
| def read(self, iprot): |
| if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: |
| fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) |
| return |
| iprot.readStructBegin() |
| while True: |
| (fname, ftype, fid) = iprot.readFieldBegin() |
| if ftype == TType.STOP: |
| break |
| if fid == 1: |
| if ftype == TType.STRING: |
| self.msg = iprot.readString().decode('utf-8') |
| else: |
| iprot.skip(ftype) |
| else: |
| iprot.skip(ftype) |
| iprot.readFieldEnd() |
| iprot.readStructEnd() |
| |
| def write(self, oprot): |
| if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: |
| oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) |
| return |
| oprot.writeStructBegin('DRPCExecutionException') |
| if self.msg is not None: |
| oprot.writeFieldBegin('msg', TType.STRING, 1) |
| oprot.writeString(self.msg.encode('utf-8')) |
| oprot.writeFieldEnd() |
| oprot.writeFieldStop() |
| oprot.writeStructEnd() |
| |
| def validate(self): |
| if self.msg is None: |
| raise TProtocol.TProtocolException(message='Required field msg is unset!') |
| return |
| |
| |
| def __str__(self): |
| return repr(self) |
| |
| def __repr__(self): |
| L = ['%s=%r' % (key, value) |
| for key, value in self.__dict__.iteritems()] |
| return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) |
| |
| def __eq__(self, other): |
| return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ |
| |
| def __ne__(self, other): |
| return not (self == other) |