本文整理匯總了Python中thrift.Thrift.TType.LIST屬性的典型用法代碼示例。如果您正苦於以下問題:Python TType.LIST屬性的具體用法?Python TType.LIST怎麽用?Python TType.LIST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類thrift.Thrift.TType
的用法示例。
在下文中一共展示了TType.LIST屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: write
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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('TIDEPacket')
if self.start_range is not None:
oprot.writeFieldBegin('start_range', TType.STRUCT, 1)
self.start_range.write(oprot)
oprot.writeFieldEnd()
if self.end_range is not None:
oprot.writeFieldBegin('end_range', TType.STRUCT, 2)
self.end_range.write(oprot)
oprot.writeFieldEnd()
if self.headers is not None:
oprot.writeFieldBegin('headers', TType.LIST, 3)
oprot.writeListBegin(TType.STRUCT, len(self.headers))
for iter6 in self.headers:
iter6.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
示例2: write
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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('SuperColumn')
if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeBinary(self.name)
oprot.writeFieldEnd()
if self.columns is not None:
oprot.writeFieldBegin('columns', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.columns))
for iter6 in self.columns:
iter6.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
示例3: write
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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('SuperColumn')
if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeString(self.name)
oprot.writeFieldEnd()
if self.columns is not None:
oprot.writeFieldBegin('columns', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.columns))
for iter6 in self.columns:
iter6.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
示例4: write
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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('EMRUser')
if self.developerId is not None:
oprot.writeFieldBegin('developerId', TType.STRING, 1)
oprot.writeString(self.developerId)
oprot.writeFieldEnd()
if self.clusterIds is not None:
oprot.writeFieldBegin('clusterIds', TType.LIST, 2)
oprot.writeListBegin(TType.STRING, len(self.clusterIds))
for iter6 in self.clusterIds:
oprot.writeString(iter6)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
示例5: read
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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.instanceGroups = []
(_etype91, _size88) = iprot.readListBegin()
for _i92 in xrange(_size88):
_elem93 = AddInstanceGroupRequest()
_elem93.read(iprot)
self.instanceGroups.append(_elem93)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
示例6: read
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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.metricDataList = []
(_etype21, _size18) = iprot.readListBegin()
for _i22 in xrange(_size18):
_elem23 = MetricData()
_elem23.read(iprot)
self.metricDataList.append(_elem23)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
示例7: write
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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('StreamCheckpoint')
if self.timestamp is not None:
oprot.writeFieldBegin('timestamp', TType.I64, 1)
oprot.writeI64(self.timestamp)
oprot.writeFieldEnd()
if self.topicName is not None:
oprot.writeFieldBegin('topicName', TType.STRING, 2)
oprot.writeString(self.topicName)
oprot.writeFieldEnd()
if self.partitionStates is not None:
oprot.writeFieldBegin('partitionStates', TType.LIST, 3)
oprot.writeListBegin(TType.STRUCT, len(self.partitionStates))
for iter61 in self.partitionStates:
iter61.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
示例8: read
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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.STRUCT:
self.start_range = TIEID()
self.start_range.read(iprot)
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
self.end_range = TIEID()
self.end_range.read(iprot)
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.LIST:
self.headers = []
(_etype3, _size0) = iprot.readListBegin()
for _i4 in range(_size0):
_elem5 = TIEHeaderWithLifeTime()
_elem5.read(iprot)
self.headers.append(_elem5)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
示例9: read
# 需要導入模塊: from thrift.Thrift import TType [as 別名]
# 或者: from thrift.Thrift.TType import LIST [as 別名]
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.readBinary()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.LIST:
self.columns = []
(_etype3, _size0) = iprot.readListBegin()
for _i4 in range(_size0):
_elem5 = Column()
_elem5.read(iprot)
self.columns.append(_elem5)
iprot.readListEnd()
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()