Python thrift.Thrift.TType.DOUBLE Examples

The following are 20 code examples of thrift.Thrift.TType.DOUBLE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module thrift.Thrift.TType , or try the search function .
Example #1
Source File: ttypes.py    From galaxy-sdk-python with Apache License 2.0 6 votes vote down vote up
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('AlertPolicy')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.measurement is not None:
      oprot.writeFieldBegin('measurement', TType.I32, 2)
      oprot.writeI32(self.measurement)
      oprot.writeFieldEnd()
    if self.threshold is not None:
      oprot.writeFieldBegin('threshold', TType.DOUBLE, 3)
      oprot.writeDouble(self.threshold)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
Example #2
Source File: ttypes.py    From lightstep-tracer-python with MIT License 6 votes vote down vote up
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('MetricsSample')
        if self.name is not None:
            oprot.writeFieldBegin('name', TType.STRING, 1)
            oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
            oprot.writeFieldEnd()
        if self.int64_value is not None:
            oprot.writeFieldBegin('int64_value', TType.I64, 2)
            oprot.writeI64(self.int64_value)
            oprot.writeFieldEnd()
        if self.double_value is not None:
            oprot.writeFieldBegin('double_value', TType.DOUBLE, 3)
            oprot.writeDouble(self.double_value)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
Example #3
Source File: ttypes.py    From jaeger-client-python with Apache License 2.0 6 votes vote down vote up
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.DOUBLE:
          self.samplingRate = iprot.readDouble()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
Example #4
Source File: ttypes.py    From cjworkbench with GNU Affero General Public License v3.0 6 votes vote down vote up
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('I18nArgument')
        if self.string_value is not None:
            oprot.writeFieldBegin('string_value', TType.STRING, 1)
            oprot.writeString(self.string_value.encode('utf-8') if sys.version_info[0] == 2 else self.string_value)
            oprot.writeFieldEnd()
        if self.i32_value is not None:
            oprot.writeFieldBegin('i32_value', TType.I32, 2)
            oprot.writeI32(self.i32_value)
            oprot.writeFieldEnd()
        if self.double_value is not None:
            oprot.writeFieldBegin('double_value', TType.DOUBLE, 3)
            oprot.writeDouble(self.double_value)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
Example #5
Source File: ttypes.py    From galaxy-sdk-python with Apache License 2.0 5 votes vote down vote up
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('TimeSeriesData')
    if self.metric is not None:
      oprot.writeFieldBegin('metric', TType.STRING, 1)
      oprot.writeString(self.metric)
      oprot.writeFieldEnd()
    if self.tags is not None:
      oprot.writeFieldBegin('tags', TType.MAP, 2)
      oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.tags))
      for kiter87,viter88 in self.tags.items():
        oprot.writeString(kiter87)
        oprot.writeString(viter88)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.MAP, 3)
      oprot.writeMapBegin(TType.I64, TType.DOUBLE, len(self.data))
      for kiter89,viter90 in self.data.items():
        oprot.writeI64(kiter89)
        oprot.writeDouble(viter90)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
Example #6
Source File: ttypes.py    From jaeger-client-python with Apache License 2.0 5 votes vote down vote up
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('PerOperationSamplingStrategies')
    if self.defaultSamplingProbability is not None:
      oprot.writeFieldBegin('defaultSamplingProbability', TType.DOUBLE, 1)
      oprot.writeDouble(self.defaultSamplingProbability)
      oprot.writeFieldEnd()
    if self.defaultLowerBoundTracesPerSecond is not None:
      oprot.writeFieldBegin('defaultLowerBoundTracesPerSecond', TType.DOUBLE, 2)
      oprot.writeDouble(self.defaultLowerBoundTracesPerSecond)
      oprot.writeFieldEnd()
    if self.perOperationStrategies is not None:
      oprot.writeFieldBegin('perOperationStrategies', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.perOperationStrategies))
      for iter6 in self.perOperationStrategies:
        iter6.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.defaultUpperBoundTracesPerSecond is not None:
      oprot.writeFieldBegin('defaultUpperBoundTracesPerSecond', TType.DOUBLE, 4)
      oprot.writeDouble(self.defaultUpperBoundTracesPerSecond)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
Example #7
Source File: ttypes.py    From jaeger-client-python with Apache License 2.0 5 votes vote down vote up
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.DOUBLE:
          self.defaultSamplingProbability = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.defaultLowerBoundTracesPerSecond = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.perOperationStrategies = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = OperationSamplingStrategy()
            _elem5.read(iprot)
            self.perOperationStrategies.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.defaultUpperBoundTracesPerSecond = iprot.readDouble()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
Example #8
Source File: ttypes.py    From jaeger-client-python with Apache License 2.0 5 votes vote down vote up
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('ProbabilisticSamplingStrategy')
    if self.samplingRate is not None:
      oprot.writeFieldBegin('samplingRate', TType.DOUBLE, 1)
      oprot.writeDouble(self.samplingRate)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
Example #9
Source File: ttypes.py    From cjworkbench with GNU Affero General Public License v3.0 5 votes vote down vote up
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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.string_value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.i32_value = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.DOUBLE:
                    self.double_value = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
Example #10
Source File: thrift_struct.py    From thrift-tools with Apache License 2.0 5 votes vote down vote up
def field_type_to_str(ftype):
        if ftype == TType.STOP:
            return 'stop'
        elif ftype == TType.VOID:
            return 'void'
        elif ftype == TType.BOOL:
            return 'bool'
        elif ftype == TType.BYTE:
            return 'byte'
        elif ftype == TType.I08:
            return 'i08'
        elif ftype == TType.DOUBLE:
            return 'double'
        elif ftype == TType.I16:
            return 'i16'
        elif ftype == TType.I32:
            return 'i32'
        elif ftype == TType.I64:
            return 'i64'
        elif ftype == TType.STRING:
            return 'string'
        elif ftype == TType.UTF7:
            return 'utf7'
        elif ftype == TType.STRUCT:
            return 'struct'
        elif ftype == TType.MAP:
            return 'map'
        elif ftype == TType.SET:
            return 'set'
        elif ftype == TType.LIST:
            return 'list'
        elif ftype == TType.UTF8:
            return 'utf8'
        elif ftype == TType.UTF16:
            return 'utf16'
        else:
            raise ValueError('Unknown type: %s' % ftype) 
Example #11
Source File: ttypes.py    From opentelemetry-python with Apache License 2.0 5 votes vote down vote up
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec)))
            return
        oprot.writeStructBegin('Tag')
        if self.key is not None:
            oprot.writeFieldBegin('key', TType.STRING, 1)
            oprot.writeString(self.key.encode('utf-8') if sys.version_info[0] == 2 else self.key)
            oprot.writeFieldEnd()
        if self.vType is not None:
            oprot.writeFieldBegin('vType', TType.I32, 2)
            oprot.writeI32(self.vType)
            oprot.writeFieldEnd()
        if self.vStr is not None:
            oprot.writeFieldBegin('vStr', TType.STRING, 3)
            oprot.writeString(self.vStr.encode('utf-8') if sys.version_info[0] == 2 else self.vStr)
            oprot.writeFieldEnd()
        if self.vDouble is not None:
            oprot.writeFieldBegin('vDouble', TType.DOUBLE, 4)
            oprot.writeDouble(self.vDouble)
            oprot.writeFieldEnd()
        if self.vBool is not None:
            oprot.writeFieldBegin('vBool', TType.BOOL, 5)
            oprot.writeBool(self.vBool)
            oprot.writeFieldEnd()
        if self.vLong is not None:
            oprot.writeFieldBegin('vLong', TType.I64, 6)
            oprot.writeI64(self.vLong)
            oprot.writeFieldEnd()
        if self.vBinary is not None:
            oprot.writeFieldBegin('vBinary', TType.STRING, 7)
            oprot.writeBinary(self.vBinary)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
Example #12
Source File: ttypes.py    From lightstep-tracer-python with MIT License 5 votes vote down vote up
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, [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') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I64:
                    self.int64_value = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.DOUBLE:
                    self.double_value = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
Example #13
Source File: ttypes.py    From galaxy-sdk-python with Apache License 2.0 5 votes vote down vote up
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.type = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.measurement = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.threshold = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd() 
Example #14
Source File: ttypes.py    From galaxy-sdk-python with Apache License 2.0 5 votes vote down vote up
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('TimeSeriesData')
    if self.tableName is not None:
      oprot.writeFieldBegin('tableName', TType.STRING, 1)
      oprot.writeString(self.tableName)
      oprot.writeFieldEnd()
    if self.metricKey is not None:
      oprot.writeFieldBegin('metricKey', TType.I32, 2)
      oprot.writeI32(self.metricKey)
      oprot.writeFieldEnd()
    if self.metricType is not None:
      oprot.writeFieldBegin('metricType', TType.I32, 3)
      oprot.writeI32(self.metricType)
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.MAP, 4)
      oprot.writeMapBegin(TType.I64, TType.DOUBLE, len(self.data))
      for kiter32,viter33 in self.data.items():
        oprot.writeI64(kiter32)
        oprot.writeDouble(viter33)
      oprot.writeMapEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd() 
Example #15
Source File: ttypes.py    From opentelemetry-python with Apache License 2.0 4 votes vote down vote up
def read(self, iprot):
        if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
            iprot._fast_decode(self, iprot, (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.key = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I32:
                    self.vType = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.vStr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.DOUBLE:
                    self.vDouble = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.vBool = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 6:
                if ftype == TType.I64:
                    self.vLong = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 7:
                if ftype == TType.STRING:
                    self.vBinary = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd() 
Example #16
Source File: ttypes.py    From cjworkbench with GNU Affero General Public License v3.0 4 votes vote down vote up
def write(self, oprot):
        if oprot._fast_encode is not None and self.thrift_spec is not None:
            oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
            return
        oprot.writeStructBegin('ParamValue')
        if self.string_value is not None:
            oprot.writeFieldBegin('string_value', TType.STRING, 1)
            oprot.writeString(self.string_value.encode('utf-8') if sys.version_info[0] == 2 else self.string_value)
            oprot.writeFieldEnd()
        if self.integer_value is not None:
            oprot.writeFieldBegin('integer_value', TType.I64, 2)
            oprot.writeI64(self.integer_value)
            oprot.writeFieldEnd()
        if self.float_value is not None:
            oprot.writeFieldBegin('float_value', TType.DOUBLE, 3)
            oprot.writeDouble(self.float_value)
            oprot.writeFieldEnd()
        if self.boolean_value is not None:
            oprot.writeFieldBegin('boolean_value', TType.BOOL, 4)
            oprot.writeBool(self.boolean_value)
            oprot.writeFieldEnd()
        if self.column_value is not None:
            oprot.writeFieldBegin('column_value', TType.STRUCT, 5)
            self.column_value.write(oprot)
            oprot.writeFieldEnd()
        if self.tab_value is not None:
            oprot.writeFieldBegin('tab_value', TType.STRUCT, 6)
            self.tab_value.write(oprot)
            oprot.writeFieldEnd()
        if self.list_value is not None:
            oprot.writeFieldBegin('list_value', TType.LIST, 7)
            oprot.writeListBegin(TType.STRUCT, len(self.list_value))
            for iter20 in self.list_value:
                iter20.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.map_value is not None:
            oprot.writeFieldBegin('map_value', TType.MAP, 8)
            oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.map_value))
            for kiter21, viter22 in self.map_value.items():
                oprot.writeString(kiter21.encode('utf-8') if sys.version_info[0] == 2 else kiter21)
                viter22.write(oprot)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.filename_value is not None:
            oprot.writeFieldBegin('filename_value', TType.STRING, 9)
            oprot.writeString(self.filename_value.encode('utf-8') if sys.version_info[0] == 2 else self.filename_value)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd() 
Example #17
Source File: TProtocol.py    From ajs2 with GNU General Public License v3.0 4 votes vote down vote up
def skip(self, ttype):
        if ttype == TType.STOP:
            return
        elif ttype == TType.BOOL:
            self.readBool()
        elif ttype == TType.BYTE:
            self.readByte()
        elif ttype == TType.I16:
            self.readI16()
        elif ttype == TType.I32:
            self.readI32()
        elif ttype == TType.I64:
            self.readI64()
        elif ttype == TType.DOUBLE:
            self.readDouble()
        elif ttype == TType.STRING:
            self.readString()
        elif ttype == TType.STRUCT:
            name = self.readStructBegin()
            while True:
                (name, ttype, id) = self.readFieldBegin()
                if ttype == TType.STOP:
                    break
                self.skip(ttype)
                self.readFieldEnd()
            self.readStructEnd()
        elif ttype == TType.MAP:
            (ktype, vtype, size) = self.readMapBegin()
            for i in range(size):
                self.skip(ktype)
                self.skip(vtype)
            self.readMapEnd()
        elif ttype == TType.SET:
            (etype, size) = self.readSetBegin()
            for i in range(size):
                self.skip(etype)
            self.readSetEnd()
        elif ttype == TType.LIST:
            (etype, size) = self.readListBegin()
            for i in range(size):
                self.skip(etype)
            self.readListEnd()

    # tuple of: ( 'reader method' name, is_container bool, 'writer_method' name ) 
Example #18
Source File: TProtocol.py    From Aditmadzs2 with GNU General Public License v3.0 4 votes vote down vote up
def skip(self, ttype):
        if ttype == TType.STOP:
            return
        elif ttype == TType.BOOL:
            self.readBool()
        elif ttype == TType.BYTE:
            self.readByte()
        elif ttype == TType.I16:
            self.readI16()
        elif ttype == TType.I32:
            self.readI32()
        elif ttype == TType.I64:
            self.readI64()
        elif ttype == TType.DOUBLE:
            self.readDouble()
        elif ttype == TType.STRING:
            self.readString()
        elif ttype == TType.STRUCT:
            name = self.readStructBegin()
            while True:
                (name, ttype, id) = self.readFieldBegin()
                if ttype == TType.STOP:
                    break
                self.skip(ttype)
                self.readFieldEnd()
            self.readStructEnd()
        elif ttype == TType.MAP:
            (ktype, vtype, size) = self.readMapBegin()
            for i in range(size):
                self.skip(ktype)
                self.skip(vtype)
            self.readMapEnd()
        elif ttype == TType.SET:
            (etype, size) = self.readSetBegin()
            for i in range(size):
                self.skip(etype)
            self.readSetEnd()
        elif ttype == TType.LIST:
            (etype, size) = self.readListBegin()
            for i in range(size):
                self.skip(etype)
            self.readListEnd()

    # tuple of: ( 'reader method' name, is_container bool, 'writer_method' name ) 
Example #19
Source File: TProtocol.py    From Protect4 with GNU General Public License v3.0 4 votes vote down vote up
def skip(self, ttype):
        if ttype == TType.STOP:
            return
        elif ttype == TType.BOOL:
            self.readBool()
        elif ttype == TType.BYTE:
            self.readByte()
        elif ttype == TType.I16:
            self.readI16()
        elif ttype == TType.I32:
            self.readI32()
        elif ttype == TType.I64:
            self.readI64()
        elif ttype == TType.DOUBLE:
            self.readDouble()
        elif ttype == TType.STRING:
            self.readString()
        elif ttype == TType.STRUCT:
            name = self.readStructBegin()
            while True:
                (name, ttype, id) = self.readFieldBegin()
                if ttype == TType.STOP:
                    break
                self.skip(ttype)
                self.readFieldEnd()
            self.readStructEnd()
        elif ttype == TType.MAP:
            (ktype, vtype, size) = self.readMapBegin()
            for i in range(size):
                self.skip(ktype)
                self.skip(vtype)
            self.readMapEnd()
        elif ttype == TType.SET:
            (etype, size) = self.readSetBegin()
            for i in range(size):
                self.skip(etype)
            self.readSetEnd()
        elif ttype == TType.LIST:
            (etype, size) = self.readListBegin()
            for i in range(size):
                self.skip(etype)
            self.readListEnd()

    # tuple of: ( 'reader method' name, is_container bool, 'writer_method' name ) 
Example #20
Source File: ttypes.py    From jaeger-client-python with Apache License 2.0 4 votes vote down vote up
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.key = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.vType = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.vStr = iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.vDouble = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.BOOL:
          self.vBool = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.vLong = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.vBinary = iprot.readString()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()