Repository: storm Updated Branches: refs/heads/master 93ed60142 -> 9e97a0758
http://git-wip-us.apache.org/repos/asf/storm/blob/1fd1e17f/storm-client/src/py/storm/ttypes.py ---------------------------------------------------------------------- diff --git a/storm-client/src/py/storm/ttypes.py b/storm-client/src/py/storm/ttypes.py index f6c98b0..48d2886 100644 --- a/storm-client/src/py/storm/ttypes.py +++ b/storm-client/src/py/storm/ttypes.py @@ -17,13509 +17,12858 @@ # limitations under the License. # -# Autogenerated by Thrift Compiler (0.9.3) +# Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:utf8strings # -from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys from thrift.transport import TTransport -from thrift.protocol import TBinaryProtocol, TProtocol -try: - from thrift.protocol import fastbinary -except: - fastbinary = None - - -class ComponentType: - BOLT = 1 - SPOUT = 2 - - _VALUES_TO_NAMES = { - 1: "BOLT", - 2: "SPOUT", - } - - _NAMES_TO_VALUES = { - "BOLT": 1, - "SPOUT": 2, - } - -class TopologyInitialStatus: - ACTIVE = 1 - INACTIVE = 2 - - _VALUES_TO_NAMES = { - 1: "ACTIVE", - 2: "INACTIVE", - } - - _NAMES_TO_VALUES = { - "ACTIVE": 1, - "INACTIVE": 2, - } - -class AccessControlType: - OTHER = 1 - USER = 2 - - _VALUES_TO_NAMES = { - 1: "OTHER", - 2: "USER", - } - - _NAMES_TO_VALUES = { - "OTHER": 1, - "USER": 2, - } - -class TopologyStatus: - ACTIVE = 1 - INACTIVE = 2 - REBALANCING = 3 - KILLED = 4 - - _VALUES_TO_NAMES = { - 1: "ACTIVE", - 2: "INACTIVE", - 3: "REBALANCING", - 4: "KILLED", - } - - _NAMES_TO_VALUES = { - "ACTIVE": 1, - "INACTIVE": 2, - "REBALANCING": 3, - "KILLED": 4, - } - -class NumErrorsChoice: - ALL = 0 - NONE = 1 - ONE = 2 - - _VALUES_TO_NAMES = { - 0: "ALL", - 1: "NONE", - 2: "ONE", - } - - _NAMES_TO_VALUES = { - "ALL": 0, - "NONE": 1, - "ONE": 2, - } - -class ProfileAction: - JPROFILE_STOP = 0 - JPROFILE_START = 1 - JPROFILE_DUMP = 2 - JMAP_DUMP = 3 - JSTACK_DUMP = 4 - JVM_RESTART = 5 - - _VALUES_TO_NAMES = { - 0: "JPROFILE_STOP", - 1: "JPROFILE_START", - 2: "JPROFILE_DUMP", - 3: "JMAP_DUMP", - 4: "JSTACK_DUMP", - 5: "JVM_RESTART", - } - - _NAMES_TO_VALUES = { - "JPROFILE_STOP": 0, - "JPROFILE_START": 1, - "JPROFILE_DUMP": 2, - "JMAP_DUMP": 3, - "JSTACK_DUMP": 4, - "JVM_RESTART": 5, - } - -class LogLevelAction: - UNCHANGED = 1 - UPDATE = 2 - REMOVE = 3 - - _VALUES_TO_NAMES = { - 1: "UNCHANGED", - 2: "UPDATE", - 3: "REMOVE", - } - - _NAMES_TO_VALUES = { - "UNCHANGED": 1, - "UPDATE": 2, - "REMOVE": 3, - } - -class DRPCExceptionType: - INTERNAL_ERROR = 0 - SERVER_SHUTDOWN = 1 - SERVER_TIMEOUT = 2 - FAILED_REQUEST = 3 - - _VALUES_TO_NAMES = { - 0: "INTERNAL_ERROR", - 1: "SERVER_SHUTDOWN", - 2: "SERVER_TIMEOUT", - 3: "FAILED_REQUEST", - } - - _NAMES_TO_VALUES = { - "INTERNAL_ERROR": 0, - "SERVER_SHUTDOWN": 1, - "SERVER_TIMEOUT": 2, - "FAILED_REQUEST": 3, - } - -class HBServerMessageType: - CREATE_PATH = 0 - CREATE_PATH_RESPONSE = 1 - EXISTS = 2 - EXISTS_RESPONSE = 3 - SEND_PULSE = 4 - SEND_PULSE_RESPONSE = 5 - GET_ALL_PULSE_FOR_PATH = 6 - GET_ALL_PULSE_FOR_PATH_RESPONSE = 7 - GET_ALL_NODES_FOR_PATH = 8 - GET_ALL_NODES_FOR_PATH_RESPONSE = 9 - GET_PULSE = 10 - GET_PULSE_RESPONSE = 11 - DELETE_PATH = 12 - DELETE_PATH_RESPONSE = 13 - DELETE_PULSE_ID = 14 - DELETE_PULSE_ID_RESPONSE = 15 - CONTROL_MESSAGE = 16 - SASL_MESSAGE_TOKEN = 17 - NOT_AUTHORIZED = 18 - - _VALUES_TO_NAMES = { - 0: "CREATE_PATH", - 1: "CREATE_PATH_RESPONSE", - 2: "EXISTS", - 3: "EXISTS_RESPONSE", - 4: "SEND_PULSE", - 5: "SEND_PULSE_RESPONSE", - 6: "GET_ALL_PULSE_FOR_PATH", - 7: "GET_ALL_PULSE_FOR_PATH_RESPONSE", - 8: "GET_ALL_NODES_FOR_PATH", - 9: "GET_ALL_NODES_FOR_PATH_RESPONSE", - 10: "GET_PULSE", - 11: "GET_PULSE_RESPONSE", - 12: "DELETE_PATH", - 13: "DELETE_PATH_RESPONSE", - 14: "DELETE_PULSE_ID", - 15: "DELETE_PULSE_ID_RESPONSE", - 16: "CONTROL_MESSAGE", - 17: "SASL_MESSAGE_TOKEN", - 18: "NOT_AUTHORIZED", - } - - _NAMES_TO_VALUES = { - "CREATE_PATH": 0, - "CREATE_PATH_RESPONSE": 1, - "EXISTS": 2, - "EXISTS_RESPONSE": 3, - "SEND_PULSE": 4, - "SEND_PULSE_RESPONSE": 5, - "GET_ALL_PULSE_FOR_PATH": 6, - "GET_ALL_PULSE_FOR_PATH_RESPONSE": 7, - "GET_ALL_NODES_FOR_PATH": 8, - "GET_ALL_NODES_FOR_PATH_RESPONSE": 9, - "GET_PULSE": 10, - "GET_PULSE_RESPONSE": 11, - "DELETE_PATH": 12, - "DELETE_PATH_RESPONSE": 13, - "DELETE_PULSE_ID": 14, - "DELETE_PULSE_ID_RESPONSE": 15, - "CONTROL_MESSAGE": 16, - "SASL_MESSAGE_TOKEN": 17, - "NOT_AUTHORIZED": 18, - } - -class WorkerTokenServiceType: - NIMBUS = 0 - DRPC = 1 - SUPERVISOR = 2 - - _VALUES_TO_NAMES = { - 0: "NIMBUS", - 1: "DRPC", - 2: "SUPERVISOR", - } - - _NAMES_TO_VALUES = { - "NIMBUS": 0, - "DRPC": 1, - "SUPERVISOR": 2, - } - - -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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.int_arg) - value = (value * 31) ^ hash(self.long_arg) - value = (value * 31) ^ hash(self.string_arg) - value = (value * 31) ^ hash(self.bool_arg) - value = (value * 31) ^ hash(self.binary_arg) - value = (value * 31) ^ hash(self.double_arg) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.full_class_name) - value = (value * 31) ^ hash(self.args_list) - return value - - 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 __hash__(self): - value = 17 - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.componentId) - value = (value * 31) ^ hash(self.streamId) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.fields) - value = (value * 31) ^ hash(self.shuffle) - value = (value * 31) ^ hash(self.all) - value = (value * 31) ^ hash(self.none) - value = (value * 31) ^ hash(self.direct) - value = (value * 31) ^ hash(self.custom_object) - value = (value * 31) ^ hash(self.custom_serialized) - value = (value * 31) ^ hash(self.local_or_shuffle) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.output_fields) - value = (value * 31) ^ hash(self.direct) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.execution_command) - value = (value * 31) ^ hash(self.script) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.serialized_java) - value = (value * 31) ^ hash(self.shell) - value = (value * 31) ^ hash(self.java_object) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.inputs) - value = (value * 31) ^ hash(self.streams) - value = (value * 31) ^ hash(self.parallelism_hint) - value = (value * 31) ^ hash(self.json_conf) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.spout_object) - value = (value * 31) ^ hash(self.common) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.bolt_object) - value = (value * 31) ^ hash(self.common) - return value - - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.state_spout_object) - value = (value * 31) ^ hash(self.common) - return value - - 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 SharedMemory: - """ - Attributes: - - name - - on_heap - - off_heap_worker - - off_heap_node - """ - - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', None, None, ), # 1 - (2, TType.DOUBLE, 'on_heap', None, None, ), # 2 - (3, TType.DOUBLE, 'off_heap_worker', None, None, ), # 3 - (4, TType.DOUBLE, 'off_heap_node', None, None, ), # 4 - ) - - def __init__(self, name=None, on_heap=None, off_heap_worker=None, off_heap_node=None,): - self.name = name - self.on_heap = on_heap - self.off_heap_worker = off_heap_worker - self.off_heap_node = off_heap_node - - 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.name = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.DOUBLE: - self.on_heap = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.DOUBLE: - self.off_heap_worker = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.DOUBLE: - self.off_heap_node = 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('SharedMemory') - if self.name is not None: - oprot.writeFieldBegin('name', TType.STRING, 1) - oprot.writeString(self.name.encode('utf-8')) - oprot.writeFieldEnd() - if self.on_heap is not None: - oprot.writeFieldBegin('on_heap', TType.DOUBLE, 2) - oprot.writeDouble(self.on_heap) - oprot.writeFieldEnd() - if self.off_heap_worker is not None: - oprot.writeFieldBegin('off_heap_worker', TType.DOUBLE, 3) - oprot.writeDouble(self.off_heap_worker) - oprot.writeFieldEnd() - if self.off_heap_node is not None: - oprot.writeFieldBegin('off_heap_node', TType.DOUBLE, 4) - oprot.writeDouble(self.off_heap_node) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.name is None: - raise TProtocol.TProtocolException(message='Required field name is unset!') - return - - - def __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.name) - value = (value * 31) ^ hash(self.on_heap) - value = (value * 31) ^ hash(self.off_heap_worker) - value = (value * 31) ^ hash(self.off_heap_node) - return value - - 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 - - worker_hooks - - dependency_jars - - dependency_artifacts - - storm_version - - jdk_version - - component_to_shared_memory - - shared_memory - """ - - 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 - (4, TType.LIST, 'worker_hooks', (TType.STRING,None), None, ), # 4 - (5, TType.LIST, 'dependency_jars', (TType.STRING,None), None, ), # 5 - (6, TType.LIST, 'dependency_artifacts', (TType.STRING,None), None, ), # 6 - (7, TType.STRING, 'storm_version', None, None, ), # 7 - (8, TType.STRING, 'jdk_version', None, None, ), # 8 - (9, TType.MAP, 'component_to_shared_memory', (TType.STRING,None,TType.SET,(TType.STRING,None)), None, ), # 9 - (10, TType.MAP, 'shared_memory', (TType.STRING,None,TType.STRUCT,(SharedMemory, SharedMemory.thrift_spec)), None, ), # 10 - ) - - def __init__(self, spouts=None, bolts=None, state_spouts=None, worker_hooks=None, dependency_jars=None, dependency_artifacts=None, storm_version=None, jdk_version=None, component_to_shared_memory=None, shared_memory=None,): - self.spouts = spouts - self.bolts = bolts - self.state_spouts = state_spouts - self.worker_hooks = worker_hooks - self.dependency_jars = dependency_jars - self.dependency_artifacts = dependency_artifacts - self.storm_version = storm_version - self.jdk_version = jdk_version - self.component_to_shared_memory = component_to_shared_memory - self.shared_memory = shared_memory - - 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) - elif fid == 4: - if ftype == TType.LIST: - self.worker_hooks = [] - (_etype63, _size60) = iprot.readListBegin() - for _i64 in xrange(_size60): - _elem65 = iprot.readString() - self.worker_hooks.append(_elem65) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.LIST: - self.dependency_jars = [] - (_etype69, _size66) = iprot.readListBegin() - for _i70 in xrange(_size66): - _elem71 = iprot.readString().decode('utf-8') - self.dependency_jars.append(_elem71) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.LIST: - self.dependency_artifacts = [] - (_etype75, _size72) = iprot.readListBegin() - for _i76 in xrange(_size72): - _elem77 = iprot.readString().decode('utf-8') - self.dependency_artifacts.append(_elem77) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.storm_version = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRING: - self.jdk_version = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.MAP: - self.component_to_shared_memory = {} - (_ktype79, _vtype80, _size78 ) = iprot.readMapBegin() - for _i82 in xrange(_size78): - _key83 = iprot.readString().decode('utf-8') - _val84 = set() - (_etype88, _size85) = iprot.readSetBegin() - for _i89 in xrange(_size85): - _elem90 = iprot.readString().decode('utf-8') - _val84.add(_elem90) - iprot.readSetEnd() - self.component_to_shared_memory[_key83] = _val84 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.MAP: - self.shared_memory = {} - (_ktype92, _vtype93, _size91 ) = iprot.readMapBegin() - for _i95 in xrange(_size91): - _key96 = iprot.readString().decode('utf-8') - _val97 = SharedMemory() - _val97.read(iprot) - self.shared_memory[_key96] = _val97 - 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 kiter98,viter99 in self.spouts.items(): - oprot.writeString(kiter98.encode('utf-8')) - viter99.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 kiter100,viter101 in self.bolts.items(): - oprot.writeString(kiter100.encode('utf-8')) - viter101.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 kiter102,viter103 in self.state_spouts.items(): - oprot.writeString(kiter102.encode('utf-8')) - viter103.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.worker_hooks is not None: - oprot.writeFieldBegin('worker_hooks', TType.LIST, 4) - oprot.writeListBegin(TType.STRING, len(self.worker_hooks)) - for iter104 in self.worker_hooks: - oprot.writeString(iter104) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.dependency_jars is not None: - oprot.writeFieldBegin('dependency_jars', TType.LIST, 5) - oprot.writeListBegin(TType.STRING, len(self.dependency_jars)) - for iter105 in self.dependency_jars: - oprot.writeString(iter105.encode('utf-8')) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.dependency_artifacts is not None: - oprot.writeFieldBegin('dependency_artifacts', TType.LIST, 6) - oprot.writeListBegin(TType.STRING, len(self.dependency_artifacts)) - for iter106 in self.dependency_artifacts: - oprot.writeString(iter106.encode('utf-8')) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.storm_version is not None: - oprot.writeFieldBegin('storm_version', TType.STRING, 7) - oprot.writeString(self.storm_version.encode('utf-8')) - oprot.writeFieldEnd() - if self.jdk_version is not None: - oprot.writeFieldBegin('jdk_version', TType.STRING, 8) - oprot.writeString(self.jdk_version.encode('utf-8')) - oprot.writeFieldEnd() - if self.component_to_shared_memory is not None: - oprot.writeFieldBegin('component_to_shared_memory', TType.MAP, 9) - oprot.writeMapBegin(TType.STRING, TType.SET, len(self.component_to_shared_memory)) - for kiter107,viter108 in self.component_to_shared_memory.items(): - oprot.writeString(kiter107.encode('utf-8')) - oprot.writeSetBegin(TType.STRING, len(viter108)) - for iter109 in viter108: - oprot.writeString(iter109.encode('utf-8')) - oprot.writeSetEnd() - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.shared_memory is not None: - oprot.writeFieldBegin('shared_memory', TType.MAP, 10) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.shared_memory)) - for kiter110,viter111 in self.shared_memory.items(): - oprot.writeString(kiter110.encode('utf-8')) - viter111.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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.spouts) - value = (value * 31) ^ hash(self.bolts) - value = (value * 31) ^ hash(self.state_spouts) - value = (value * 31) ^ hash(self.worker_hooks) - value = (value * 31) ^ hash(self.dependency_jars) - value = (value * 31) ^ hash(self.dependency_artifacts) - value = (value * 31) ^ hash(self.storm_version) - value = (value * 31) ^ hash(self.jdk_version) - value = (value * 31) ^ hash(self.component_to_shared_memory) - value = (value * 31) ^ hash(self.shared_memory) - return value - - 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) +all_structs = [] -class AlreadyAliveException(TException): - """ - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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(TException): - """ - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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 ComponentType(object): + BOLT = 1 + SPOUT = 2 -class AuthorizationException(TException): - """ - 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('AuthorizationException') - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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) + _VALUES_TO_NAMES = { + 1: "BOLT", + 2: "SPOUT", + } -class InvalidTopologyException(TException): - """ - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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) + _NAMES_TO_VALUES = { + "BOLT": 1, + "SPOUT": 2, + } -class KeyNotFoundException(TException): - """ - 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('KeyNotFoundException') - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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 KeyAlreadyExistsException(TException): - """ - 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('KeyAlreadyExistsException') - 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 __hash__(self): - value = 17 - value = (value * 31) ^ hash(self.msg) - return value - - 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_executors - - num_workers - - uptime_secs - - status - - storm_version - - topology_version - - sched_status - - owner - - replication_count - - requested_memonheap - - requested_memoffheap - - requested_cpu - - assigned_memonheap - - assigned_memoffheap - - assigned_cpu - """ - - 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_executors', None, None, ), # 4 - (5, TType.I32, 'num_workers', None, None, ), # 5 - (6, TType.I32, 'uptime_secs', None, None, ), # 6 - (7, TType.STRING, 'status', None, None, ), # 7 - (8, TType.STRING, 'storm_version', None, None, ), # 8 - (9, TType.STRING, 'topology_version', None, None, ), # 9 - None, # 10 - None, # 11 - None, # 12 - None, # 13 - None, # 14 - None, # 15 - None, # 16 - None, # 17 - None, # 18 - None, # 19 - None, # 20 - None, # 21 - None, # 22 - None, # 23 - None, # 24 - None, # 25 - None, # 26 - None, # 27 - None, # 28 - None, # 29 - None, # 30 - None, # 31 - None, # 32 - None, # 33 - None, # 34 - None, # 35 - None, # 36 - None, # 37 - None, # 38 - None, # 39 - None, # 40 - None, # 41 - None, # 42 - None, # 43 - None, # 44 - None, # 45 - None, # 46 - None, # 47 - None, # 48 - None, # 49 - None, # 50 - None, # 51 - None, # 52 - None, # 53 - None, # 54 - None, # 55 - None, # 56 - None, # 57 - None, # 58 - None, # 59 - None, # 60 - None, # 61 - None, # 62 - None, # 63 - None, # 64 - None, # 65 - None, # 66 - None, # 67 - None, # 68 - None, # 69 - None, # 70 - None, # 71 - None, # 72 - None, # 73 - None, # 74 - None, # 75 - None, # 76 - None, # 77 - None, # 78 - None, # 79 - None, # 80 - None, # 81 - None, # 82 - None, # 83 - None, # 84 - None, # 85 - None, # 86 - None, # 87 - None, # 88 - None, # 89 - None, # 90 - None, # 91 - None, # 92 - None, # 93 - None, # 94 - None, # 95 - None, # 96 - None, # 97 - None, # 98 - None, # 99 - None, # 100 - None, # 101 - None, # 102 - None, # 103 - None, # 104 - None, # 105 - None, # 106 - None, # 107 - None, # 108 - None, # 109 - None, # 110 - None, # 111 - None, # 112 - None, # 113 - None, # 114 - None, # 115 - None, # 116 - None, # 117 - None, # 118 - None, # 119 - None, # 120 - None, # 121 - None, # 122 - None, # 123 - None, # 124 - None, # 125 - None, # 126 - None, # 127 - None, # 128 - None, # 129 - None, # 130 - None, # 131 - None, # 132 - None, # 133 - None, # 134 - None, # 135 - None, # 136 - None, # 137 - None, # 138 - None, # 139 - None, # 140 - None, # 141 - None, # 142 - None, # 143 - None, # 144 - None, # 145 - None, # 146 - None, # 147 - None, # 148 - None, # 149 - None, # 150 - None, # 151 - None, # 152 - None, # 153 - None, # 154 - None, # 155 - None, # 156 - None, # 157 - None, # 158 - None, # 159 - None, # 160 - None, # 161 - None, # 162 - None, # 163 - None, # 164 - None, # 165 - None, # 166 - None, # 167 - None, # 168 - None, # 169 - None, # 170 - None, # 171 - None, # 172 - None, # 173 - None, # 174 - None, # 175 - None, # 176 - None, # 177 - None, # 178 - None, # 179 - None, # 180 - None, # 181 - None, # 182 - None, # 183 - None, # 184 - None, # 185 - None, # 186 - None, # 187 - None, # 188 - None, # 189 - None, # 190 - None, # 191 - None, # 192 - None, # 193 - None, # 194 - None, # 195 - None, # 196 - None, # 197 - None, # 198 - None, # 199 - None, # 200 - None, # 201 - None, # 202 - None, # 203 - None, # 204 - None, # 205 - None, # 206 - None, # 207 - None, # 208 - None, # 209 - None, # 210 - None, # 211 - None, # 212 - None, # 213 - None, # 214 - None, # 215 - None, # 216 - None, # 217 - None, # 218 - None, # 219 - None, # 220 - None, # 221 - None, # 222 - None, # 223 - None, # 224 - None, # 225 - None, # 226 - None, # 227 - None, # 228 - None, # 229 - None, # 230 - None, # 231 - None, # 232 - None, # 233 - None, # 234 - None, # 235 - None, # 236 - None, # 237 - None, # 238 - None, # 239 - None, # 240 - None, # 241 - None, # 242 - None, # 243 - None, # 244 - None, # 245 - None, # 246 - None, # 247 - None, # 248 - None, # 249 - None, # 250 - None, # 251 - None, # 252 - None, # 253 - None, # 254 - None, # 255 - None, # 256 - None, # 257 - None, # 258 - None, # 259 - None, # 260 - None, # 261 - None, # 262 - None, # 263 - None, # 264 - None, # 265 - None, # 266 - None, # 267 - None, # 268 - None, # 269 - None, # 270 - None, # 271 - None, # 272 - None, # 273 - None, # 274 - None, # 275 - None, # 276 - None, # 277 - None, # 278 - None, # 279 - None, # 280 - None, # 281 - None, # 282 - None, # 283 - None, # 284 - None, # 285 - None, # 286 - None, # 287 - None, # 288 - None, # 289 - None, # 290 - None, # 291 - None, # 292 - None, # 293 - None, # 294 - None, # 295 - None, # 296 - None, # 297 - None, # 298 - None, # 299 - None, # 300 - None, # 301 - None, # 302 - None, # 303 - None, # 304 - None, # 305 - None, # 306 - None, # 307 - None, # 308 - None, # 309 - None, # 310 - None, # 311 - None, # 312 - None, # 313 - None, # 314 - None, # 315 - None, # 316 - None, # 317 - None, # 318 - None, # 319 - None, # 320 - None, # 321 - None, # 322 - None, # 323 - None, # 324 - None, # 325 - None, # 326 - None, # 327 - None, # 328 - None, # 329 - None, # 330 - None, # 331 - None, # 332 - None, # 333 - None, # 334 - None, # 335 - None, # 336 - None, # 337 - None, # 338 - None, # 339 - None, # 340 - None, # 341 - None, # 342 - None, # 343 - None, # 344 - None, # 345 - None, # 346 - None, # 347 - None, # 348 - None, # 349 - None, # 350 - None, # 351 - None, # 352 - None, # 353 - None, # 354 - None, # 355 - None, # 356 - None, # 357 - None, # 358 - None, # 359 - None, # 360 - None, # 361 - None, # 362 - None, # 363 - None, # 364 - None, # 365 - None, # 366 - None, # 367 - None, # 368 - None, # 369 - None, # 370 - None, # 371 - None, # 372 - None, # 373 - None, # 374 - None, # 375 - None, # 376 - None, # 377 - None, # 378 - None, # 379 - None, # 380 - None, # 381 - None, # 382 - None, # 383 - None, # 384 - None, # 385 - None, # 386 - None, # 387 - None, # 388 - None, # 389 - None, # 390 - None, # 391 - None, # 392 - None, # 393 - None, # 394 - None, # 395 - None, # 396 - None, # 397 - None, # 398 - None, # 399 - None, # 400 - None, # 401 - None, # 402 - None, # 403 - None, # 404 - None, # 405 - None, # 406 - None, # 407 - None, # 408 - None, # 409 - None, # 410 - None, # 411 - None, # 412 - None, # 413 - None, # 414 - None, # 415 - None, # 416 - None, # 417 - None, # 418 - None, # 419 - None, # 420 - None, # 421 - None, # 422 - None, # 423 - None, # 424 - None, # 425 - None, # 426 - None, # 427 - None, # 428 - None, # 429 - None, # 430 - None, # 431 - None, # 432 - None, # 433 - None, # 434 - None, # 435 - None, # 436 - None, # 437 - None, # 438 - None, # 439 - None, # 440 - None, # 441 - None, # 442 - None, # 443 - None, # 444 - None, # 445 - None, # 446 - None, # 447 - None, # 448 - None, # 449 - None, # 450 - None, # 451 - None, # 452 - None, # 453 - None, # 454 - None, # 455 - None, # 456 - None, # 457 - None, # 458 - None, # 459 - None, # 460 - None, # 461 - None, # 462 - None, # 463 - None, # 464 - None, # 465 - None, # 466 - None, # 467 - None, # 468 - None, # 469 - None, # 470 - None, # 471 - None, # 472 - None, # 473 - None, # 474 - None, # 475 - None, # 476 - None, # 477 - None, # 478 - None, # 479 - None, # 480 - None, # 481 - None, # 482 - None, # 483 - None, # 484 - None, # 485 - None, # 486 - None, # 487 - None, # 488 - None, # 489 - None, # 490 - None, # 491 - None, # 492 - None, # 493 - None, # 494 - None, # 495 - None, # 496 - None, # 497 - None, # 498 - None, # 499 - None, # 500 - None, # 501 - None, # 502 - None, # 503 - None, # 504 - None, # 505 - None, # 506 - None, # 507 - None, # 508 - None, # 509 - None, # 510 - None, # 511 - None, # 512 - (513, TType.STRING, 'sched_status', None, None, ), # 513 - (514, TType.STRING, 'owner', None, None, ), # 514 - (515, TType.I32, 'replication_count', None, None, ), # 515 - None, # 516 - None, # 517 - None, # 518 - None, # 519 - None, # 520 - (521, TType.DOUBLE, 'requested_memonheap', None, None, ), # 521 - (522, TType.DOUBLE, 'requested_memoffheap', None, None, ), # 522 - (523, TType.DOUBLE, 'requested_cpu', None, None, ), # 523 - (524, TType.DOUBLE, 'assigned_memonheap', None, None, ), # 524 - (525, TType.DOUBLE, 'assigned_memoffheap', None, None, ), # 525 - (526, TType.DOUBLE, 'assigned_cpu', None, None, ), # 526 - ) - - def __init__(self, id=None, name=None, num_tasks=None, num_executors=None, num_workers=None, uptime_secs=None, status=None, storm_version=None, topology_version=None, sched_status=None, owner=None, replication_count=None, requested_memonheap=None, requested_memoffheap=None, requested_cpu=None, assigned_memonheap=None, assigned_memoffheap=None, assigned_cpu=None,): - self.id = id - self.name = name - self.num_tasks = num_tasks - self.num_executors = num_executors - self.num_workers = num_workers - self.uptime_secs = uptime_secs - self.status = status - self.storm_version = storm_version - self.topology_version = topology_version - self.sched_status = sched_status - self.owner = owner - self.replication_count = replication_count - self.requested_memonheap = requested_memonheap - self.requested_memoffheap = requested_memoffheap - self.requested_cpu = requested_cpu - self.assigned_memonheap = assigned_memonheap - self.assigned_memoffheap = assigned_memoffheap - self.assigned_cpu = assigned_cpu - - 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_executors = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.num_workers = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.I32: - self.uptime_secs = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.status = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRING: - self.storm_version = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.STRING: - self.topology_version = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 513: - if ftype == TType.STRING: - self.sched_status = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 514: - if ftype == TType.STRING: - self.owner = iprot.readString().decode('utf-8') - else: - iprot.skip(ftype) - elif fid == 515: - if ftype == TType.I32: - self.replication_count = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 521: - if ftype == TType.DOUBLE: - self.requested_memonheap = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 522: - if ftype == TType.DOUBLE: - self.requested_memoffheap = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 523: - if ftype == TType.DOUBLE: - self.requested_cpu = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 524: - if ftype == TType.DOUBLE: - self.assigned_memonheap = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 525: - if ftype == TType.DOUBLE: - self.assigned_memoffheap = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 526: - if ftype == TType.DOUBLE: - self.assigned_cpu = 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('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_executors is not None: - oprot.writeFieldBegin('num_executors', TType.I32, 4) - oprot.writeI32(self.num_executors) - oprot.writeFieldEnd() - if self.num_workers is not None: - oprot.writeFieldBegin('num_workers', TType.I32, 5) - oprot.writeI32(self.num_workers) - oprot.writeFieldEnd() - if self.uptime_secs is not None: - oprot.writeFieldBegin('uptime_secs', TType.I32, 6) - oprot.writeI32(self.uptime_secs) - oprot.writeFieldEnd() - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRING, 7) - oprot.writeString(self.status.encode('utf-8')) - oprot.writeFieldEnd() - if self.storm_version is not None: - oprot.writeFieldBegin('storm_version', TType.STRING, 8) - oprot.writeString(self.storm_version.encode('utf-8')) - oprot.writeFieldEnd() - if self.topology_version is not None: - oprot.writeFieldBegin('topology_version', TType.STRING, 9) - oprot.writeString(self.topology_version.encode('utf-8')) - oprot.writeFieldEnd() - if self.sched_status is not None: - oprot.writeFieldBegin('sched_status', TType.STRING, 513) - oprot.writeString(self.sched_status.encode('utf-8')) - oprot.writeF <TRUNCATED>
