当前位置: 首页>>代码示例>>Python>>正文


Python fastbinary.encode_binary函数代码示例

本文整理汇总了Python中thrift.protocol.fastbinary.encode_binary函数的典型用法代码示例。如果您正苦于以下问题:Python encode_binary函数的具体用法?Python encode_binary怎么用?Python encode_binary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了encode_binary函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: write

 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('Span')
   if self.timestamp is not None:
     oprot.writeFieldBegin('timestamp', TType.I64, 1)
     oprot.writeI64(self.timestamp)
     oprot.writeFieldEnd()
   if self.trace_id is not None:
     oprot.writeFieldBegin('trace_id', TType.I64, 2)
     oprot.writeI64(self.trace_id)
     oprot.writeFieldEnd()
   if self.name is not None:
     oprot.writeFieldBegin('name', TType.STRING, 3)
     oprot.writeString(self.name)
     oprot.writeFieldEnd()
   if self.id is not None:
     oprot.writeFieldBegin('id', TType.I64, 4)
     oprot.writeI64(self.id)
     oprot.writeFieldEnd()
   if self.parent_id is not None:
     oprot.writeFieldBegin('parent_id', TType.I64, 5)
     oprot.writeI64(self.parent_id)
     oprot.writeFieldEnd()
   if self.duration is not None:
     oprot.writeFieldBegin('duration', TType.I32, 6)
     oprot.writeI32(self.duration)
     oprot.writeFieldEnd()
   if self.host is not None:
     oprot.writeFieldBegin('host', TType.STRING, 7)
     oprot.writeString(self.host)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:yancl,项目名称:collectd,代码行数:35,代码来源:ttypes.py

示例2: write

 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('HqlResult')
   if self.results != None:
     oprot.writeFieldBegin('results', TType.LIST, 1)
     oprot.writeListBegin(TType.STRING, len(self.results))
     for iter12 in self.results:
       oprot.writeString(iter12)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.cells != None:
     oprot.writeFieldBegin('cells', TType.LIST, 2)
     oprot.writeListBegin(TType.STRUCT, len(self.cells))
     for iter13 in self.cells:
       iter13.write(oprot)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.scanner != None:
     oprot.writeFieldBegin('scanner', TType.I64, 3)
     oprot.writeI64(self.scanner)
     oprot.writeFieldEnd()
   if self.mutator != None:
     oprot.writeFieldBegin('mutator', TType.I64, 4)
     oprot.writeI64(self.mutator)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:soker,项目名称:hypertable,代码行数:29,代码来源:ttypes.py

示例3: write

 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('ThriftFlumeReport')
   if self.stringMetrics != None:
     oprot.writeFieldBegin('stringMetrics', TType.MAP, 3)
     oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.stringMetrics))
     for kiter21,viter22 in self.stringMetrics.items():
       oprot.writeString(kiter21)
       oprot.writeString(viter22)
     oprot.writeMapEnd()
     oprot.writeFieldEnd()
   if self.longMetrics != None:
     oprot.writeFieldBegin('longMetrics', TType.MAP, 4)
     oprot.writeMapBegin(TType.STRING, TType.I64, len(self.longMetrics))
     for kiter23,viter24 in self.longMetrics.items():
       oprot.writeString(kiter23)
       oprot.writeI64(viter24)
     oprot.writeMapEnd()
     oprot.writeFieldEnd()
   if self.doubleMetrics != None:
     oprot.writeFieldBegin('doubleMetrics', TType.MAP, 5)
     oprot.writeMapBegin(TType.STRING, TType.DOUBLE, len(self.doubleMetrics))
     for kiter25,viter26 in self.doubleMetrics.items():
       oprot.writeString(kiter25)
       oprot.writeDouble(viter26)
     oprot.writeMapEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
   def validate(self):
     return
开发者ID:pcdinh,项目名称:plume,代码行数:33,代码来源:ttypes.py

示例4: write

 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('FuncStat')
   if self.file is not None:
     oprot.writeFieldBegin('file', TType.STRING, 1)
     oprot.writeString(self.file)
     oprot.writeFieldEnd()
   if self.line is not None:
     oprot.writeFieldBegin('line', TType.I32, 2)
     oprot.writeI32(self.line)
     oprot.writeFieldEnd()
   if self.func_name is not None:
     oprot.writeFieldBegin('func_name', TType.STRING, 3)
     oprot.writeString(self.func_name)
     oprot.writeFieldEnd()
   if self.calls_count is not None:
     oprot.writeFieldBegin('calls_count', TType.I32, 4)
     oprot.writeI32(self.calls_count)
     oprot.writeFieldEnd()
   if self.total_time is not None:
     oprot.writeFieldBegin('total_time', TType.DOUBLE, 5)
     oprot.writeDouble(self.total_time)
     oprot.writeFieldEnd()
   if self.own_time is not None:
     oprot.writeFieldBegin('own_time', TType.DOUBLE, 6)
     oprot.writeDouble(self.own_time)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:AndyHovingh,项目名称:intellij-community,代码行数:31,代码来源:ttypes.py

示例5: write

 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('Graph')
   if self.nodeType is not None:
     oprot.writeFieldBegin('nodeType', TType.I32, 1)
     oprot.writeI32(self.nodeType)
     oprot.writeFieldEnd()
   if self.roots is not None:
     oprot.writeFieldBegin('roots', TType.LIST, 2)
     oprot.writeListBegin(TType.STRING, len(self.roots))
     for iter19 in self.roots:
       oprot.writeString(iter19)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.adjacencyList is not None:
     oprot.writeFieldBegin('adjacencyList', TType.LIST, 3)
     oprot.writeListBegin(TType.STRUCT, len(self.adjacencyList))
     for iter20 in self.adjacencyList:
       iter20.write(oprot)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:1ack,项目名称:Impala,代码行数:25,代码来源:ttypes.py

示例6: write

 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('Shaping')
   if self.rate is not None:
     oprot.writeFieldBegin('rate', TType.I32, 1)
     oprot.writeI32(self.rate)
     oprot.writeFieldEnd()
   if self.delay is not None:
     oprot.writeFieldBegin('delay', TType.STRUCT, 2)
     self.delay.write(oprot)
     oprot.writeFieldEnd()
   if self.loss is not None:
     oprot.writeFieldBegin('loss', TType.STRUCT, 3)
     self.loss.write(oprot)
     oprot.writeFieldEnd()
   if self.reorder is not None:
     oprot.writeFieldBegin('reorder', TType.STRUCT, 4)
     self.reorder.write(oprot)
     oprot.writeFieldEnd()
   if self.corruption is not None:
     oprot.writeFieldBegin('corruption', TType.STRUCT, 5)
     self.corruption.write(oprot)
     oprot.writeFieldEnd()
   if self.iptables_options is not None:
     oprot.writeFieldBegin('iptables_options', TType.LIST, 6)
     oprot.writeListBegin(TType.STRING, len(self.iptables_options))
     for iter6 in self.iptables_options:
       oprot.writeString(iter6)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:duydb2,项目名称:ZTC,代码行数:34,代码来源:ttypes.py

示例7: write

 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('HeartbeatAppInfo')
   if self.app_name is not None:
     oprot.writeFieldBegin('app_name', TType.STRING, 1)
     oprot.writeString(self.app_name)
     oprot.writeFieldEnd()
   if self.state is not None:
     oprot.writeFieldBegin('state', TType.I32, 2)
     oprot.writeI32(self.state)
     oprot.writeFieldEnd()
   if self.error_id is not None:
     oprot.writeFieldBegin('error_id', TType.I32, 3)
     oprot.writeI32(self.error_id)
     oprot.writeFieldEnd()
   if self.app_x is not None:
     oprot.writeFieldBegin('app_x', TType.STRING, 4)
     oprot.writeString(self.app_x)
     oprot.writeFieldEnd()
   if self.app_y is not None:
     oprot.writeFieldBegin('app_y', TType.I32, 5)
     oprot.writeI32(self.app_y)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:yes-txh,项目名称:test,代码行数:27,代码来源:ttypes.py

示例8: write

 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('AuthenticationResult')
   if self.currentTime != None:
     oprot.writeFieldBegin('currentTime', TType.I64, 1)
     oprot.writeI64(self.currentTime)
     oprot.writeFieldEnd()
   if self.authenticationToken != None:
     oprot.writeFieldBegin('authenticationToken', TType.STRING, 2)
     oprot.writeString(self.authenticationToken)
     oprot.writeFieldEnd()
   if self.expiration != None:
     oprot.writeFieldBegin('expiration', TType.I64, 3)
     oprot.writeI64(self.expiration)
     oprot.writeFieldEnd()
   if self.user != None:
     oprot.writeFieldBegin('user', TType.STRUCT, 4)
     self.user.write(oprot)
     oprot.writeFieldEnd()
   if self.publicUserInfo != None:
     oprot.writeFieldBegin('publicUserInfo', TType.STRUCT, 5)
     self.publicUserInfo.write(oprot)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:cconrad,项目名称:evernotebackup,代码行数:27,代码来源:ttypes.py

示例9: write

 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('ProblemaCondicaoAvaliacaoAIThrift')
   if self.ciaps is not None:
     oprot.writeFieldBegin('ciaps', TType.LIST, 1)
     oprot.writeListBegin(TType.STRING, len(self.ciaps))
     for iter13 in self.ciaps:
       oprot.writeString(iter13)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.outroCiap1 is not None:
     oprot.writeFieldBegin('outroCiap1', TType.STRING, 2)
     oprot.writeString(self.outroCiap1)
     oprot.writeFieldEnd()
   if self.outroCiap2 is not None:
     oprot.writeFieldBegin('outroCiap2', TType.STRING, 3)
     oprot.writeString(self.outroCiap2)
     oprot.writeFieldEnd()
   if self.cid10 is not None:
     oprot.writeFieldBegin('cid10', TType.STRING, 4)
     oprot.writeString(self.cid10)
     oprot.writeFieldEnd()
   if self.cid10_2 is not None:
     oprot.writeFieldBegin('cid10_2', TType.STRING, 5)
     oprot.writeString(self.cid10_2)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:felipenedel,项目名称:integracao,代码行数:30,代码来源:ttypes.py

示例10: write

 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('LocationInfo')
   if self.parent is not None:
     oprot.writeFieldBegin('parent', TType.STRUCT, 1)
     self.parent.write(oprot)
     oprot.writeFieldEnd()
   if self.peers is not None:
     oprot.writeFieldBegin('peers', TType.LIST, 2)
     oprot.writeListBegin(TType.STRUCT, len(self.peers))
     for iter12 in self.peers:
       iter12.write(oprot)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.children is not None:
     oprot.writeFieldBegin('children', TType.LIST, 3)
     oprot.writeListBegin(TType.STRUCT, len(self.children))
     for iter13 in self.children:
       iter13.write(oprot)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:HarrisonW,项目名称:SuperPub,代码行数:25,代码来源:ttypes.py

示例11: write

 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('MailObject')
   if self.sendto is not None:
     oprot.writeFieldBegin('sendto', TType.STRING, 1)
     oprot.writeString(self.sendto)
     oprot.writeFieldEnd()
   if self.subject is not None:
     oprot.writeFieldBegin('subject', TType.STRING, 2)
     oprot.writeString(self.subject)
     oprot.writeFieldEnd()
   if self.content is not None:
     oprot.writeFieldBegin('content', TType.STRING, 3)
     oprot.writeString(self.content)
     oprot.writeFieldEnd()
   if self.attach_files is not None:
     oprot.writeFieldBegin('attach_files', TType.LIST, 4)
     oprot.writeListBegin(TType.STRING, len(self.attach_files))
     for iter6 in self.attach_files:
       oprot.writeString(iter6)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.priority is not None:
     oprot.writeFieldBegin('priority', TType.I32, 5)
     oprot.writeI32(self.priority)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:dreamcatcher2015,项目名称:email_sender,代码行数:30,代码来源:ttypes.py

示例12: write

 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('addDevice_args')
   if self.deviceId is not None:
     oprot.writeFieldBegin('deviceId', TType.I64, 1)
     oprot.writeI64(self.deviceId)
     oprot.writeFieldEnd()
   if self.deviceKey is not None:
     oprot.writeFieldBegin('deviceKey', TType.STRING, 2)
     oprot.writeString(self.deviceKey)
     oprot.writeFieldEnd()
   if self.serverType is not None:
     oprot.writeFieldBegin('serverType', TType.STRING, 3)
     oprot.writeString(self.serverType)
     oprot.writeFieldEnd()
   if self.supportedTaskTypes is not None:
     oprot.writeFieldBegin('supportedTaskTypes', TType.LIST, 4)
     oprot.writeListBegin(TType.STRING, len(self.supportedTaskTypes))
     for iter6 in self.supportedTaskTypes:
       oprot.writeString(iter6)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   if self.deviceInfo is not None:
     oprot.writeFieldBegin('deviceInfo', TType.STRING, 5)
     oprot.writeString(self.deviceInfo)
     oprot.writeFieldEnd()
   if self.connectToServerNeeded is not None:
     oprot.writeFieldBegin('connectToServerNeeded', TType.BOOL, 6)
     oprot.writeBool(self.connectToServerNeeded)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:guanxingquan,项目名称:workspace,代码行数:34,代码来源:DeviceArbiterService.py

示例13: write

 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('TAdminCommentQueryData')
   if self.totalCount is not None:
     oprot.writeFieldBegin('totalCount', TType.I32, 1)
     oprot.writeI32(self.totalCount)
     oprot.writeFieldEnd()
   if self.totalPage is not None:
     oprot.writeFieldBegin('totalPage', TType.I32, 2)
     oprot.writeI32(self.totalPage)
     oprot.writeFieldEnd()
   if self.pageSize is not None:
     oprot.writeFieldBegin('pageSize', TType.I32, 3)
     oprot.writeI32(self.pageSize)
     oprot.writeFieldEnd()
   if self.currPage is not None:
     oprot.writeFieldBegin('currPage', TType.I32, 4)
     oprot.writeI32(self.currPage)
     oprot.writeFieldEnd()
   if self.dataList is not None:
     oprot.writeFieldBegin('dataList', TType.LIST, 5)
     oprot.writeListBegin(TType.STRUCT, len(self.dataList))
     for iter6 in self.dataList:
       iter6.write(oprot)
     oprot.writeListEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:ybg555,项目名称:vue-tvBox,代码行数:30,代码来源:ttypes.py

示例14: write

 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('performBinaryUpdate_args')
   if self.relationName is not None:
     oprot.writeFieldBegin('relationName', TType.STRING, 1)
     oprot.writeString(self.relationName)
     oprot.writeFieldEnd()
   if self.old_column1 is not None:
     oprot.writeFieldBegin('old_column1', TType.STRING, 2)
     oprot.writeString(self.old_column1)
     oprot.writeFieldEnd()
   if self.old_column2 is not None:
     oprot.writeFieldBegin('old_column2', TType.STRING, 3)
     oprot.writeString(self.old_column2)
     oprot.writeFieldEnd()
   if self.new_column1 is not None:
     oprot.writeFieldBegin('new_column1', TType.STRING, 4)
     oprot.writeString(self.new_column1)
     oprot.writeFieldEnd()
   if self.new_column2 is not None:
     oprot.writeFieldBegin('new_column2', TType.STRING, 5)
     oprot.writeString(self.new_column2)
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:FTSRG,项目名称:mondo-mondix-teiiddemo,代码行数:27,代码来源:TeiidChangeService.py

示例15: write

 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('FavoritesRemoveRequest')
   if self.type is not None:
     oprot.writeFieldBegin('type', TType.I32, 1)
     oprot.writeI32(self.type)
     oprot.writeFieldEnd()
   if self.userId is not None:
     oprot.writeFieldBegin('userId', TType.I32, 2)
     oprot.writeI32(self.userId)
     oprot.writeFieldEnd()
   if self.favUsrIds is not None:
     oprot.writeFieldBegin('favUsrIds', TType.SET, 3)
     oprot.writeSetBegin(TType.I32, len(self.favUsrIds))
     for iter19 in self.favUsrIds:
       oprot.writeI32(iter19)
     oprot.writeSetEnd()
     oprot.writeFieldEnd()
   if self.favWareIds is not None:
     oprot.writeFieldBegin('favWareIds', TType.SET, 4)
     oprot.writeSetBegin(TType.STRING, len(self.favWareIds))
     for iter20 in self.favWareIds:
       oprot.writeString(iter20)
     oprot.writeSetEnd()
     oprot.writeFieldEnd()
   oprot.writeFieldStop()
   oprot.writeStructEnd()
开发者ID:Maksim1988,项目名称:test,代码行数:29,代码来源:ttypes.py


注:本文中的thrift.protocol.fastbinary.encode_binary函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。