#
# Autogenerated by Thrift Compiler (0.11.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys
import logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []


class Iface(object):
    def joinCluster(self, NodeX, pmin, pmax):
        """
        Parameters:
         - NodeX
         - pmin
         - pmax
        """
        pass

    def joinPool(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        pass

    def getCandidatePool(self, reliability, pmin):
        """
        Parameters:
         - reliability
         - pmin
        """
        pass

    def bootstrapFog(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        pass

    def initiate2PhasePreCommit(self, preCommitRequest):
        """
        Parameters:
         - preCommitRequest
        """
        pass

    def initiate2PhaseCommit(self, commitRequest):
        """
        Parameters:
         - commitRequest
        """
        pass

    def buddyHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        pass

    def neighborHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        pass

    def getPoolMember(self, buddyPoolId):
        """
        Parameters:
         - buddyPoolId
        """
        pass

    def getBuddyPoolMembers(self):
        pass

    def getNeighborCountPerPool(self):
        pass

    def requestNeighbors(self, requestMap):
        """
        Parameters:
         - requestMap
        """
        pass

    def nodeJoiningComplete(self):
        pass

    def subscribe(self, nodeInfoData):
        """
        Parameters:
         - nodeInfoData
        """
        pass

    def edgeHeartBeats(self, edgePayload):
        """
        Parameters:
         - edgePayload
        """
        pass

    def edgeJoin(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        pass

    def edgeLeave(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        pass

    def terminate(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def registerStream(self, streamId, streamMetadata, startSequenceNumber):
        """
        Parameters:
         - streamId
         - streamMetadata
         - startSequenceNumber
        """
        pass

    def intentToWrite(self, clientId):
        """
        Parameters:
         - clientId
        """
        pass

    def getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        """
        Parameters:
         - streamId
         - checkNeighbors
         - checkBuddies
         - forceLatest
        """
        pass

    def getStreamMetadataFromOwner(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        """
        Parameters:
         - dataLength
         - metadata
         - blackListedFogs
         - isEdge
        """
        pass

    def write(self, mbMetadata, data, preference):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
        """
        pass

    def writeNext(self, sessionId, mbData, dataLength):
        """
        Parameters:
         - sessionId
         - mbData
         - dataLength
        """
        pass

    def insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - edgeInfoData
         - metaKeyValueMap
        """
        pass

    def findNext(self, microbatchId):
        """
        Parameters:
         - microbatchId
        """
        pass

    def find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
         - selfInfo
        """
        pass

    def read(self, microbatchId, fetchMetadata):
        """
        Parameters:
         - microbatchId
         - fetchMetadata
        """
        pass

    def findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metadataKey
         - metadataValue
         - checkNeighbors
         - checkBuddies
        """
        pass

    def getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
        """
        pass

    def serializeState(self):
        pass

    def updateStreamMetadata(self, metadata):
        """
        Parameters:
         - metadata
        """
        pass

    def open(self, streamId, clientId, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - expectedLease
         - setLease
        """
        pass

    def putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
         - metaKeyValueMap
        """
        pass

    def incrementBlockCount(self, mbMetadata, setLease):
        """
        Parameters:
         - mbMetadata
         - setLease
        """
        pass

    def renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - sessionSecret
         - expectedLease
         - setLease
        """
        pass

    def getLargestBlockId(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def findStream(self, squery):
        """
        Parameters:
         - squery
        """
        pass

    def updateBlock(self, mbId, mbMetadata, mbData):
        """
        Parameters:
         - mbId
         - mbMetadata
         - mbData
        """
        pass

    def listLocalPartitionMbId(self, flag):
        """
        Parameters:
         - flag
        """
        pass

    def requestAllNeighbors(self):
        pass

    def requestMbIDLocationMap(self):
        pass

    def findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metaKeyValueMap
         - checkNeighbors
         - checkBuddies
        """
        pass


class Client(Iface):
    def __init__(self, iprot, oprot=None):
        self._iprot = self._oprot = iprot
        if oprot is not None:
            self._oprot = oprot
        self._seqid = 0

    def joinCluster(self, NodeX, pmin, pmax):
        """
        Parameters:
         - NodeX
         - pmin
         - pmax
        """
        self.send_joinCluster(NodeX, pmin, pmax)
        return self.recv_joinCluster()

    def send_joinCluster(self, NodeX, pmin, pmax):
        self._oprot.writeMessageBegin('joinCluster', TMessageType.CALL, self._seqid)
        args = joinCluster_args()
        args.NodeX = NodeX
        args.pmin = pmin
        args.pmax = pmax
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_joinCluster(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = joinCluster_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "joinCluster failed: unknown result")

    def joinPool(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        self.send_joinPool(NodeX)
        return self.recv_joinPool()

    def send_joinPool(self, NodeX):
        self._oprot.writeMessageBegin('joinPool', TMessageType.CALL, self._seqid)
        args = joinPool_args()
        args.NodeX = NodeX
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_joinPool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = joinPool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "joinPool failed: unknown result")

    def getCandidatePool(self, reliability, pmin):
        """
        Parameters:
         - reliability
         - pmin
        """
        self.send_getCandidatePool(reliability, pmin)
        return self.recv_getCandidatePool()

    def send_getCandidatePool(self, reliability, pmin):
        self._oprot.writeMessageBegin('getCandidatePool', TMessageType.CALL, self._seqid)
        args = getCandidatePool_args()
        args.reliability = reliability
        args.pmin = pmin
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getCandidatePool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getCandidatePool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getCandidatePool failed: unknown result")

    def bootstrapFog(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        self.send_bootstrapFog(NodeX)
        return self.recv_bootstrapFog()

    def send_bootstrapFog(self, NodeX):
        self._oprot.writeMessageBegin('bootstrapFog', TMessageType.CALL, self._seqid)
        args = bootstrapFog_args()
        args.NodeX = NodeX
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_bootstrapFog(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = bootstrapFog_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "bootstrapFog failed: unknown result")

    def initiate2PhasePreCommit(self, preCommitRequest):
        """
        Parameters:
         - preCommitRequest
        """
        self.send_initiate2PhasePreCommit(preCommitRequest)
        return self.recv_initiate2PhasePreCommit()

    def send_initiate2PhasePreCommit(self, preCommitRequest):
        self._oprot.writeMessageBegin('initiate2PhasePreCommit', TMessageType.CALL, self._seqid)
        args = initiate2PhasePreCommit_args()
        args.preCommitRequest = preCommitRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_initiate2PhasePreCommit(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = initiate2PhasePreCommit_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "initiate2PhasePreCommit failed: unknown result")

    def initiate2PhaseCommit(self, commitRequest):
        """
        Parameters:
         - commitRequest
        """
        self.send_initiate2PhaseCommit(commitRequest)
        return self.recv_initiate2PhaseCommit()

    def send_initiate2PhaseCommit(self, commitRequest):
        self._oprot.writeMessageBegin('initiate2PhaseCommit', TMessageType.CALL, self._seqid)
        args = initiate2PhaseCommit_args()
        args.commitRequest = commitRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_initiate2PhaseCommit(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = initiate2PhaseCommit_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "initiate2PhaseCommit failed: unknown result")

    def buddyHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        self.send_buddyHeartBeat(payload)

    def send_buddyHeartBeat(self, payload):
        self._oprot.writeMessageBegin('buddyHeartBeat', TMessageType.ONEWAY, self._seqid)
        args = buddyHeartBeat_args()
        args.payload = payload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def neighborHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        self.send_neighborHeartBeat(payload)

    def send_neighborHeartBeat(self, payload):
        self._oprot.writeMessageBegin('neighborHeartBeat', TMessageType.ONEWAY, self._seqid)
        args = neighborHeartBeat_args()
        args.payload = payload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def getPoolMember(self, buddyPoolId):
        """
        Parameters:
         - buddyPoolId
        """
        self.send_getPoolMember(buddyPoolId)
        return self.recv_getPoolMember()

    def send_getPoolMember(self, buddyPoolId):
        self._oprot.writeMessageBegin('getPoolMember', TMessageType.CALL, self._seqid)
        args = getPoolMember_args()
        args.buddyPoolId = buddyPoolId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getPoolMember(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getPoolMember_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getPoolMember failed: unknown result")

    def getBuddyPoolMembers(self):
        self.send_getBuddyPoolMembers()
        return self.recv_getBuddyPoolMembers()

    def send_getBuddyPoolMembers(self):
        self._oprot.writeMessageBegin('getBuddyPoolMembers', TMessageType.CALL, self._seqid)
        args = getBuddyPoolMembers_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getBuddyPoolMembers(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getBuddyPoolMembers_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getBuddyPoolMembers failed: unknown result")

    def getNeighborCountPerPool(self):
        self.send_getNeighborCountPerPool()
        return self.recv_getNeighborCountPerPool()

    def send_getNeighborCountPerPool(self):
        self._oprot.writeMessageBegin('getNeighborCountPerPool', TMessageType.CALL, self._seqid)
        args = getNeighborCountPerPool_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getNeighborCountPerPool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getNeighborCountPerPool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getNeighborCountPerPool failed: unknown result")

    def requestNeighbors(self, requestMap):
        """
        Parameters:
         - requestMap
        """
        self.send_requestNeighbors(requestMap)
        return self.recv_requestNeighbors()

    def send_requestNeighbors(self, requestMap):
        self._oprot.writeMessageBegin('requestNeighbors', TMessageType.CALL, self._seqid)
        args = requestNeighbors_args()
        args.requestMap = requestMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestNeighbors(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestNeighbors_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestNeighbors failed: unknown result")

    def nodeJoiningComplete(self):
        self.send_nodeJoiningComplete()
        self.recv_nodeJoiningComplete()

    def send_nodeJoiningComplete(self):
        self._oprot.writeMessageBegin('nodeJoiningComplete', TMessageType.CALL, self._seqid)
        args = nodeJoiningComplete_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_nodeJoiningComplete(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = nodeJoiningComplete_result()
        result.read(iprot)
        iprot.readMessageEnd()
        return

    def subscribe(self, nodeInfoData):
        """
        Parameters:
         - nodeInfoData
        """
        self.send_subscribe(nodeInfoData)
        return self.recv_subscribe()

    def send_subscribe(self, nodeInfoData):
        self._oprot.writeMessageBegin('subscribe', TMessageType.CALL, self._seqid)
        args = subscribe_args()
        args.nodeInfoData = nodeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_subscribe(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = subscribe_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "subscribe failed: unknown result")

    def edgeHeartBeats(self, edgePayload):
        """
        Parameters:
         - edgePayload
        """
        self.send_edgeHeartBeats(edgePayload)
        return self.recv_edgeHeartBeats()

    def send_edgeHeartBeats(self, edgePayload):
        self._oprot.writeMessageBegin('edgeHeartBeats', TMessageType.CALL, self._seqid)
        args = edgeHeartBeats_args()
        args.edgePayload = edgePayload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeHeartBeats(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeHeartBeats_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeHeartBeats failed: unknown result")

    def edgeJoin(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        self.send_edgeJoin(edgeInfoData)
        return self.recv_edgeJoin()

    def send_edgeJoin(self, edgeInfoData):
        self._oprot.writeMessageBegin('edgeJoin', TMessageType.CALL, self._seqid)
        args = edgeJoin_args()
        args.edgeInfoData = edgeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeJoin(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeJoin_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeJoin failed: unknown result")

    def edgeLeave(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        self.send_edgeLeave(edgeInfoData)
        return self.recv_edgeLeave()

    def send_edgeLeave(self, edgeInfoData):
        self._oprot.writeMessageBegin('edgeLeave', TMessageType.CALL, self._seqid)
        args = edgeLeave_args()
        args.edgeInfoData = edgeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeLeave(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeLeave_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeLeave failed: unknown result")

    def terminate(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_terminate(streamId)
        return self.recv_terminate()

    def send_terminate(self, streamId):
        self._oprot.writeMessageBegin('terminate', TMessageType.CALL, self._seqid)
        args = terminate_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_terminate(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = terminate_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "terminate failed: unknown result")

    def registerStream(self, streamId, streamMetadata, startSequenceNumber):
        """
        Parameters:
         - streamId
         - streamMetadata
         - startSequenceNumber
        """
        self.send_registerStream(streamId, streamMetadata, startSequenceNumber)
        return self.recv_registerStream()

    def send_registerStream(self, streamId, streamMetadata, startSequenceNumber):
        self._oprot.writeMessageBegin('registerStream', TMessageType.CALL, self._seqid)
        args = registerStream_args()
        args.streamId = streamId
        args.streamMetadata = streamMetadata
        args.startSequenceNumber = startSequenceNumber
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_registerStream(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = registerStream_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "registerStream failed: unknown result")

    def intentToWrite(self, clientId):
        """
        Parameters:
         - clientId
        """
        self.send_intentToWrite(clientId)
        return self.recv_intentToWrite()

    def send_intentToWrite(self, clientId):
        self._oprot.writeMessageBegin('intentToWrite', TMessageType.CALL, self._seqid)
        args = intentToWrite_args()
        args.clientId = clientId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_intentToWrite(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = intentToWrite_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "intentToWrite failed: unknown result")

    def getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        """
        Parameters:
         - streamId
         - checkNeighbors
         - checkBuddies
         - forceLatest
        """
        self.send_getStreamMetadata(streamId, checkNeighbors, checkBuddies, forceLatest)
        return self.recv_getStreamMetadata()

    def send_getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        self._oprot.writeMessageBegin('getStreamMetadata', TMessageType.CALL, self._seqid)
        args = getStreamMetadata_args()
        args.streamId = streamId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.forceLatest = forceLatest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getStreamMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getStreamMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getStreamMetadata failed: unknown result")

    def getStreamMetadataFromOwner(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_getStreamMetadataFromOwner(streamId)
        return self.recv_getStreamMetadataFromOwner()

    def send_getStreamMetadataFromOwner(self, streamId):
        self._oprot.writeMessageBegin('getStreamMetadataFromOwner', TMessageType.CALL, self._seqid)
        args = getStreamMetadataFromOwner_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getStreamMetadataFromOwner(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getStreamMetadataFromOwner_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getStreamMetadataFromOwner failed: unknown result")

    def getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        """
        Parameters:
         - dataLength
         - metadata
         - blackListedFogs
         - isEdge
        """
        self.send_getWriteLocations(dataLength, metadata, blackListedFogs, isEdge)
        return self.recv_getWriteLocations()

    def send_getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        self._oprot.writeMessageBegin('getWriteLocations', TMessageType.CALL, self._seqid)
        args = getWriteLocations_args()
        args.dataLength = dataLength
        args.metadata = metadata
        args.blackListedFogs = blackListedFogs
        args.isEdge = isEdge
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getWriteLocations(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getWriteLocations_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getWriteLocations failed: unknown result")

    def write(self, mbMetadata, data, preference):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
        """
        self.send_write(mbMetadata, data, preference)
        return self.recv_write()

    def send_write(self, mbMetadata, data, preference):
        self._oprot.writeMessageBegin('write', TMessageType.CALL, self._seqid)
        args = write_args()
        args.mbMetadata = mbMetadata
        args.data = data
        args.preference = preference
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_write(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = write_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "write failed: unknown result")

    def writeNext(self, sessionId, mbData, dataLength):
        """
        Parameters:
         - sessionId
         - mbData
         - dataLength
        """
        self.send_writeNext(sessionId, mbData, dataLength)
        return self.recv_writeNext()

    def send_writeNext(self, sessionId, mbData, dataLength):
        self._oprot.writeMessageBegin('writeNext', TMessageType.CALL, self._seqid)
        args = writeNext_args()
        args.sessionId = sessionId
        args.mbData = mbData
        args.dataLength = dataLength
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_writeNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = writeNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "writeNext failed: unknown result")

    def insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - edgeInfoData
         - metaKeyValueMap
        """
        self.send_insertMetadata(mbMetadata, edgeInfoData, metaKeyValueMap)
        return self.recv_insertMetadata()

    def send_insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        self._oprot.writeMessageBegin('insertMetadata', TMessageType.CALL, self._seqid)
        args = insertMetadata_args()
        args.mbMetadata = mbMetadata
        args.edgeInfoData = edgeInfoData
        args.metaKeyValueMap = metaKeyValueMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_insertMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = insertMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "insertMetadata failed: unknown result")

    def findNext(self, microbatchId):
        """
        Parameters:
         - microbatchId
        """
        self.send_findNext(microbatchId)
        return self.recv_findNext()

    def send_findNext(self, microbatchId):
        self._oprot.writeMessageBegin('findNext', TMessageType.CALL, self._seqid)
        args = findNext_args()
        args.microbatchId = microbatchId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findNext failed: unknown result")

    def find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
         - selfInfo
        """
        self.send_find(microbatchId, checkNeighbors, checkBuddies, selfInfo)
        return self.recv_find()

    def send_find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        self._oprot.writeMessageBegin('find', TMessageType.CALL, self._seqid)
        args = find_args()
        args.microbatchId = microbatchId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.selfInfo = selfInfo
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_find(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = find_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "find failed: unknown result")

    def read(self, microbatchId, fetchMetadata):
        """
        Parameters:
         - microbatchId
         - fetchMetadata
        """
        self.send_read(microbatchId, fetchMetadata)
        return self.recv_read()

    def send_read(self, microbatchId, fetchMetadata):
        self._oprot.writeMessageBegin('read', TMessageType.CALL, self._seqid)
        args = read_args()
        args.microbatchId = microbatchId
        args.fetchMetadata = fetchMetadata
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_read(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = read_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "read failed: unknown result")

    def findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metadataKey
         - metadataValue
         - checkNeighbors
         - checkBuddies
        """
        self.send_findUsingQuery(metadataKey, metadataValue, checkNeighbors, checkBuddies)
        return self.recv_findUsingQuery()

    def send_findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('findUsingQuery', TMessageType.CALL, self._seqid)
        args = findUsingQuery_args()
        args.metadataKey = metadataKey
        args.metadataValue = metadataValue
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findUsingQuery(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findUsingQuery_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findUsingQuery failed: unknown result")

    def getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
        """
        self.send_getMeta(microbatchId, checkNeighbors, checkBuddies)
        return self.recv_getMeta()

    def send_getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('getMeta', TMessageType.CALL, self._seqid)
        args = getMeta_args()
        args.microbatchId = microbatchId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getMeta(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getMeta_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getMeta failed: unknown result")

    def serializeState(self):
        self.send_serializeState()
        return self.recv_serializeState()

    def send_serializeState(self):
        self._oprot.writeMessageBegin('serializeState', TMessageType.CALL, self._seqid)
        args = serializeState_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_serializeState(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = serializeState_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "serializeState failed: unknown result")

    def updateStreamMetadata(self, metadata):
        """
        Parameters:
         - metadata
        """
        self.send_updateStreamMetadata(metadata)
        return self.recv_updateStreamMetadata()

    def send_updateStreamMetadata(self, metadata):
        self._oprot.writeMessageBegin('updateStreamMetadata', TMessageType.CALL, self._seqid)
        args = updateStreamMetadata_args()
        args.metadata = metadata
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_updateStreamMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = updateStreamMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "updateStreamMetadata failed: unknown result")

    def open(self, streamId, clientId, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - expectedLease
         - setLease
        """
        self.send_open(streamId, clientId, expectedLease, setLease)
        return self.recv_open()

    def send_open(self, streamId, clientId, expectedLease, setLease):
        self._oprot.writeMessageBegin('open', TMessageType.CALL, self._seqid)
        args = open_args()
        args.streamId = streamId
        args.clientId = clientId
        args.expectedLease = expectedLease
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_open(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = open_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "open failed: unknown result")

    def putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
         - metaKeyValueMap
        """
        self.send_putNext(mbMetadata, data, preference, metaKeyValueMap)
        return self.recv_putNext()

    def send_putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        self._oprot.writeMessageBegin('putNext', TMessageType.CALL, self._seqid)
        args = putNext_args()
        args.mbMetadata = mbMetadata
        args.data = data
        args.preference = preference
        args.metaKeyValueMap = metaKeyValueMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_putNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = putNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "putNext failed: unknown result")

    def incrementBlockCount(self, mbMetadata, setLease):
        """
        Parameters:
         - mbMetadata
         - setLease
        """
        self.send_incrementBlockCount(mbMetadata, setLease)
        return self.recv_incrementBlockCount()

    def send_incrementBlockCount(self, mbMetadata, setLease):
        self._oprot.writeMessageBegin('incrementBlockCount', TMessageType.CALL, self._seqid)
        args = incrementBlockCount_args()
        args.mbMetadata = mbMetadata
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_incrementBlockCount(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = incrementBlockCount_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "incrementBlockCount failed: unknown result")

    def renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - sessionSecret
         - expectedLease
         - setLease
        """
        self.send_renewLease(streamId, clientId, sessionSecret, expectedLease, setLease)
        return self.recv_renewLease()

    def send_renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        self._oprot.writeMessageBegin('renewLease', TMessageType.CALL, self._seqid)
        args = renewLease_args()
        args.streamId = streamId
        args.clientId = clientId
        args.sessionSecret = sessionSecret
        args.expectedLease = expectedLease
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_renewLease(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = renewLease_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "renewLease failed: unknown result")

    def getLargestBlockId(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_getLargestBlockId(streamId)
        return self.recv_getLargestBlockId()

    def send_getLargestBlockId(self, streamId):
        self._oprot.writeMessageBegin('getLargestBlockId', TMessageType.CALL, self._seqid)
        args = getLargestBlockId_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getLargestBlockId(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getLargestBlockId_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getLargestBlockId failed: unknown result")

    def findStream(self, squery):
        """
        Parameters:
         - squery
        """
        self.send_findStream(squery)
        return self.recv_findStream()

    def send_findStream(self, squery):
        self._oprot.writeMessageBegin('findStream', TMessageType.CALL, self._seqid)
        args = findStream_args()
        args.squery = squery
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findStream(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findStream_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findStream failed: unknown result")

    def updateBlock(self, mbId, mbMetadata, mbData):
        """
        Parameters:
         - mbId
         - mbMetadata
         - mbData
        """
        self.send_updateBlock(mbId, mbMetadata, mbData)
        return self.recv_updateBlock()

    def send_updateBlock(self, mbId, mbMetadata, mbData):
        self._oprot.writeMessageBegin('updateBlock', TMessageType.CALL, self._seqid)
        args = updateBlock_args()
        args.mbId = mbId
        args.mbMetadata = mbMetadata
        args.mbData = mbData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_updateBlock(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = updateBlock_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "updateBlock failed: unknown result")

    def listLocalPartitionMbId(self, flag):
        """
        Parameters:
         - flag
        """
        self.send_listLocalPartitionMbId(flag)
        return self.recv_listLocalPartitionMbId()

    def send_listLocalPartitionMbId(self, flag):
        self._oprot.writeMessageBegin('listLocalPartitionMbId', TMessageType.CALL, self._seqid)
        args = listLocalPartitionMbId_args()
        args.flag = flag
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_listLocalPartitionMbId(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = listLocalPartitionMbId_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "listLocalPartitionMbId failed: unknown result")

    def requestAllNeighbors(self):
        self.send_requestAllNeighbors()
        return self.recv_requestAllNeighbors()

    def send_requestAllNeighbors(self):
        self._oprot.writeMessageBegin('requestAllNeighbors', TMessageType.CALL, self._seqid)
        args = requestAllNeighbors_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestAllNeighbors(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestAllNeighbors_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestAllNeighbors failed: unknown result")

    def requestMbIDLocationMap(self):
        self.send_requestMbIDLocationMap()
        return self.recv_requestMbIDLocationMap()

    def send_requestMbIDLocationMap(self):
        self._oprot.writeMessageBegin('requestMbIDLocationMap', TMessageType.CALL, self._seqid)
        args = requestMbIDLocationMap_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestMbIDLocationMap(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestMbIDLocationMap_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestMbIDLocationMap failed: unknown result")

    def findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metaKeyValueMap
         - checkNeighbors
         - checkBuddies
        """
        self.send_findBlockUsingQuery(metaKeyValueMap, checkNeighbors, checkBuddies)
        return self.recv_findBlockUsingQuery()

    def send_findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('findBlockUsingQuery', TMessageType.CALL, self._seqid)
        args = findBlockUsingQuery_args()
        args.metaKeyValueMap = metaKeyValueMap
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findBlockUsingQuery(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findBlockUsingQuery_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findBlockUsingQuery failed: unknown result")


class Processor(Iface, TProcessor):
    def __init__(self, handler):
        self._handler = handler
        self._processMap = {}
        self._processMap["joinCluster"] = Processor.process_joinCluster
        self._processMap["joinPool"] = Processor.process_joinPool
        self._processMap["getCandidatePool"] = Processor.process_getCandidatePool
        self._processMap["bootstrapFog"] = Processor.process_bootstrapFog
        self._processMap["initiate2PhasePreCommit"] = Processor.process_initiate2PhasePreCommit
        self._processMap["initiate2PhaseCommit"] = Processor.process_initiate2PhaseCommit
        self._processMap["buddyHeartBeat"] = Processor.process_buddyHeartBeat
        self._processMap["neighborHeartBeat"] = Processor.process_neighborHeartBeat
        self._processMap["getPoolMember"] = Processor.process_getPoolMember
        self._processMap["getBuddyPoolMembers"] = Processor.process_getBuddyPoolMembers
        self._processMap["getNeighborCountPerPool"] = Processor.process_getNeighborCountPerPool
        self._processMap["requestNeighbors"] = Processor.process_requestNeighbors
        self._processMap["nodeJoiningComplete"] = Processor.process_nodeJoiningComplete
        self._processMap["subscribe"] = Processor.process_subscribe
        self._processMap["edgeHeartBeats"] = Processor.process_edgeHeartBeats
        self._processMap["edgeJoin"] = Processor.process_edgeJoin
        self._processMap["edgeLeave"] = Processor.process_edgeLeave
        self._processMap["terminate"] = Processor.process_terminate
        self._processMap["registerStream"] = Processor.process_registerStream
        self._processMap["intentToWrite"] = Processor.process_intentToWrite
        self._processMap["getStreamMetadata"] = Processor.process_getStreamMetadata
        self._processMap["getStreamMetadataFromOwner"] = Processor.process_getStreamMetadataFromOwner
        self._processMap["getWriteLocations"] = Processor.process_getWriteLocations
        self._processMap["write"] = Processor.process_write
        self._processMap["writeNext"] = Processor.process_writeNext
        self._processMap["insertMetadata"] = Processor.process_insertMetadata
        self._processMap["findNext"] = Processor.process_findNext
        self._processMap["find"] = Processor.process_find
        self._processMap["read"] = Processor.process_read
        self._processMap["findUsingQuery"] = Processor.process_findUsingQuery
        self._processMap["getMeta"] = Processor.process_getMeta
        self._processMap["serializeState"] = Processor.process_serializeState
        self._processMap["updateStreamMetadata"] = Processor.process_updateStreamMetadata
        self._processMap["open"] = Processor.process_open
        self._processMap["putNext"] = Processor.process_putNext
        self._processMap["incrementBlockCount"] = Processor.process_incrementBlockCount
        self._processMap["renewLease"] = Processor.process_renewLease
        self._processMap["getLargestBlockId"] = Processor.process_getLargestBlockId
        self._processMap["findStream"] = Processor.process_findStream
        self._processMap["updateBlock"] = Processor.process_updateBlock
        self._processMap["listLocalPartitionMbId"] = Processor.process_listLocalPartitionMbId
        self._processMap["requestAllNeighbors"] = Processor.process_requestAllNeighbors
        self._processMap["requestMbIDLocationMap"] = Processor.process_requestMbIDLocationMap
        self._processMap["findBlockUsingQuery"] = Processor.process_findBlockUsingQuery

    def process(self, iprot, oprot):
        (name, type, seqid) = iprot.readMessageBegin()
        if name not in self._processMap:
            iprot.skip(TType.STRUCT)
            iprot.readMessageEnd()
            x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
            oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
            x.write(oprot)
            oprot.writeMessageEnd()
            oprot.trans.flush()
            return
        else:
            self._processMap[name](self, seqid, iprot, oprot)
        return True

    def process_joinCluster(self, seqid, iprot, oprot):
        args = joinCluster_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = joinCluster_result()
        try:
            result.success = self._handler.joinCluster(args.NodeX, args.pmin, args.pmax)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("joinCluster", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_joinPool(self, seqid, iprot, oprot):
        args = joinPool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = joinPool_result()
        try:
            result.success = self._handler.joinPool(args.NodeX)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("joinPool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCandidatePool(self, seqid, iprot, oprot):
        args = getCandidatePool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCandidatePool_result()
        try:
            result.success = self._handler.getCandidatePool(args.reliability, args.pmin)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getCandidatePool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_bootstrapFog(self, seqid, iprot, oprot):
        args = bootstrapFog_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = bootstrapFog_result()
        try:
            result.success = self._handler.bootstrapFog(args.NodeX)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("bootstrapFog", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_initiate2PhasePreCommit(self, seqid, iprot, oprot):
        args = initiate2PhasePreCommit_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = initiate2PhasePreCommit_result()
        try:
            result.success = self._handler.initiate2PhasePreCommit(args.preCommitRequest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("initiate2PhasePreCommit", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_initiate2PhaseCommit(self, seqid, iprot, oprot):
        args = initiate2PhaseCommit_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = initiate2PhaseCommit_result()
        try:
            result.success = self._handler.initiate2PhaseCommit(args.commitRequest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("initiate2PhaseCommit", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_buddyHeartBeat(self, seqid, iprot, oprot):
        args = buddyHeartBeat_args()
        args.read(iprot)
        iprot.readMessageEnd()
        try:
            self._handler.buddyHeartBeat(args.payload)
        except TTransport.TTransportException:
            raise
        except Exception:
            logging.exception('Exception in oneway handler')

    def process_neighborHeartBeat(self, seqid, iprot, oprot):
        args = neighborHeartBeat_args()
        args.read(iprot)
        iprot.readMessageEnd()
        try:
            self._handler.neighborHeartBeat(args.payload)
        except TTransport.TTransportException:
            raise
        except Exception:
            logging.exception('Exception in oneway handler')

    def process_getPoolMember(self, seqid, iprot, oprot):
        args = getPoolMember_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPoolMember_result()
        try:
            result.success = self._handler.getPoolMember(args.buddyPoolId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getPoolMember", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getBuddyPoolMembers(self, seqid, iprot, oprot):
        args = getBuddyPoolMembers_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getBuddyPoolMembers_result()
        try:
            result.success = self._handler.getBuddyPoolMembers()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getBuddyPoolMembers", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getNeighborCountPerPool(self, seqid, iprot, oprot):
        args = getNeighborCountPerPool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getNeighborCountPerPool_result()
        try:
            result.success = self._handler.getNeighborCountPerPool()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getNeighborCountPerPool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestNeighbors(self, seqid, iprot, oprot):
        args = requestNeighbors_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestNeighbors_result()
        try:
            result.success = self._handler.requestNeighbors(args.requestMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestNeighbors", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_nodeJoiningComplete(self, seqid, iprot, oprot):
        args = nodeJoiningComplete_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = nodeJoiningComplete_result()
        try:
            self._handler.nodeJoiningComplete()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("nodeJoiningComplete", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_subscribe(self, seqid, iprot, oprot):
        args = subscribe_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = subscribe_result()
        try:
            result.success = self._handler.subscribe(args.nodeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("subscribe", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeHeartBeats(self, seqid, iprot, oprot):
        args = edgeHeartBeats_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeHeartBeats_result()
        try:
            result.success = self._handler.edgeHeartBeats(args.edgePayload)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeHeartBeats", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeJoin(self, seqid, iprot, oprot):
        args = edgeJoin_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeJoin_result()
        try:
            result.success = self._handler.edgeJoin(args.edgeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeJoin", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeLeave(self, seqid, iprot, oprot):
        args = edgeLeave_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeLeave_result()
        try:
            result.success = self._handler.edgeLeave(args.edgeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeLeave", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_terminate(self, seqid, iprot, oprot):
        args = terminate_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = terminate_result()
        try:
            result.success = self._handler.terminate(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("terminate", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_registerStream(self, seqid, iprot, oprot):
        args = registerStream_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = registerStream_result()
        try:
            result.success = self._handler.registerStream(args.streamId, args.streamMetadata, args.startSequenceNumber)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("registerStream", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_intentToWrite(self, seqid, iprot, oprot):
        args = intentToWrite_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = intentToWrite_result()
        try:
            result.success = self._handler.intentToWrite(args.clientId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("intentToWrite", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getStreamMetadata(self, seqid, iprot, oprot):
        args = getStreamMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getStreamMetadata_result()
        try:
            result.success = self._handler.getStreamMetadata(args.streamId, args.checkNeighbors, args.checkBuddies, args.forceLatest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getStreamMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getStreamMetadataFromOwner(self, seqid, iprot, oprot):
        args = getStreamMetadataFromOwner_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getStreamMetadataFromOwner_result()
        try:
            result.success = self._handler.getStreamMetadataFromOwner(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getStreamMetadataFromOwner", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getWriteLocations(self, seqid, iprot, oprot):
        args = getWriteLocations_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getWriteLocations_result()
        try:
            result.success = self._handler.getWriteLocations(args.dataLength, args.metadata, args.blackListedFogs, args.isEdge)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getWriteLocations", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_write(self, seqid, iprot, oprot):
        args = write_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = write_result()
        try:
            result.success = self._handler.write(args.mbMetadata, args.data, args.preference)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("write", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_writeNext(self, seqid, iprot, oprot):
        args = writeNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = writeNext_result()
        try:
            result.success = self._handler.writeNext(args.sessionId, args.mbData, args.dataLength)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("writeNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_insertMetadata(self, seqid, iprot, oprot):
        args = insertMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = insertMetadata_result()
        try:
            result.success = self._handler.insertMetadata(args.mbMetadata, args.edgeInfoData, args.metaKeyValueMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("insertMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findNext(self, seqid, iprot, oprot):
        args = findNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findNext_result()
        try:
            result.success = self._handler.findNext(args.microbatchId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_find(self, seqid, iprot, oprot):
        args = find_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = find_result()
        try:
            result.success = self._handler.find(args.microbatchId, args.checkNeighbors, args.checkBuddies, args.selfInfo)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("find", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_read(self, seqid, iprot, oprot):
        args = read_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = read_result()
        try:
            result.success = self._handler.read(args.microbatchId, args.fetchMetadata)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("read", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findUsingQuery(self, seqid, iprot, oprot):
        args = findUsingQuery_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findUsingQuery_result()
        try:
            result.success = self._handler.findUsingQuery(args.metadataKey, args.metadataValue, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findUsingQuery", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getMeta(self, seqid, iprot, oprot):
        args = getMeta_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getMeta_result()
        try:
            result.success = self._handler.getMeta(args.microbatchId, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getMeta", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_serializeState(self, seqid, iprot, oprot):
        args = serializeState_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = serializeState_result()
        try:
            result.success = self._handler.serializeState()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("serializeState", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_updateStreamMetadata(self, seqid, iprot, oprot):
        args = updateStreamMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = updateStreamMetadata_result()
        try:
            result.success = self._handler.updateStreamMetadata(args.metadata)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("updateStreamMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_open(self, seqid, iprot, oprot):
        args = open_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = open_result()
        try:
            result.success = self._handler.open(args.streamId, args.clientId, args.expectedLease, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("open", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_putNext(self, seqid, iprot, oprot):
        args = putNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = putNext_result()
        try:
            result.success = self._handler.putNext(args.mbMetadata, args.data, args.preference, args.metaKeyValueMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("putNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_incrementBlockCount(self, seqid, iprot, oprot):
        args = incrementBlockCount_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = incrementBlockCount_result()
        try:
            result.success = self._handler.incrementBlockCount(args.mbMetadata, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("incrementBlockCount", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_renewLease(self, seqid, iprot, oprot):
        args = renewLease_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = renewLease_result()
        try:
            result.success = self._handler.renewLease(args.streamId, args.clientId, args.sessionSecret, args.expectedLease, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("renewLease", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getLargestBlockId(self, seqid, iprot, oprot):
        args = getLargestBlockId_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getLargestBlockId_result()
        try:
            result.success = self._handler.getLargestBlockId(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getLargestBlockId", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findStream(self, seqid, iprot, oprot):
        args = findStream_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findStream_result()
        try:
            result.success = self._handler.findStream(args.squery)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findStream", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_updateBlock(self, seqid, iprot, oprot):
        args = updateBlock_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = updateBlock_result()
        try:
            result.success = self._handler.updateBlock(args.mbId, args.mbMetadata, args.mbData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("updateBlock", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_listLocalPartitionMbId(self, seqid, iprot, oprot):
        args = listLocalPartitionMbId_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = listLocalPartitionMbId_result()
        try:
            result.success = self._handler.listLocalPartitionMbId(args.flag)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("listLocalPartitionMbId", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestAllNeighbors(self, seqid, iprot, oprot):
        args = requestAllNeighbors_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestAllNeighbors_result()
        try:
            result.success = self._handler.requestAllNeighbors()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestAllNeighbors", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestMbIDLocationMap(self, seqid, iprot, oprot):
        args = requestMbIDLocationMap_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestMbIDLocationMap_result()
        try:
            result.success = self._handler.requestMbIDLocationMap()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestMbIDLocationMap", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findBlockUsingQuery(self, seqid, iprot, oprot):
        args = findBlockUsingQuery_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findBlockUsingQuery_result()
        try:
            result.success = self._handler.findBlockUsingQuery(args.metaKeyValueMap, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findBlockUsingQuery", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES


class joinCluster_args(object):
    """
    Attributes:
     - NodeX
     - pmin
     - pmax
    """


    def __init__(self, NodeX=None, pmin=None, pmax=None,):
        self.NodeX = NodeX
        self.pmin = pmin
        self.pmax = pmax

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.pmin = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I16:
                    self.pmax = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinCluster_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        if self.pmin is not None:
            oprot.writeFieldBegin('pmin', TType.I16, 2)
            oprot.writeI16(self.pmin)
            oprot.writeFieldEnd()
        if self.pmax is not None:
            oprot.writeFieldBegin('pmax', TType.I16, 3)
            oprot.writeI16(self.pmax)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinCluster_args)
joinCluster_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
    (2, TType.I16, 'pmin', None, None, ),  # 2
    (3, TType.I16, 'pmax', None, None, ),  # 3
)


class joinCluster_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype85, _size82) = iprot.readListBegin()
                    for _i86 in range(_size82):
                        _elem87 = NeighborInfoData()
                        _elem87.read(iprot)
                        self.success.append(_elem87)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinCluster_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter88 in self.success:
                iter88.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinCluster_result)
joinCluster_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class joinPool_args(object):
    """
    Attributes:
     - NodeX
    """


    def __init__(self, NodeX=None,):
        self.NodeX = NodeX

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinPool_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinPool_args)
joinPool_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
)


class joinPool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhaseCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinPool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinPool_result)
joinPool_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhaseCommitResponse, None], None, ),  # 0
)


class getCandidatePool_args(object):
    """
    Attributes:
     - reliability
     - pmin
    """


    def __init__(self, reliability=None, pmin=None,):
        self.reliability = reliability
        self.pmin = pmin

    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.DOUBLE:
                    self.reliability = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.pmin = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getCandidatePool_args')
        if self.reliability is not None:
            oprot.writeFieldBegin('reliability', TType.DOUBLE, 1)
            oprot.writeDouble(self.reliability)
            oprot.writeFieldEnd()
        if self.pmin is not None:
            oprot.writeFieldBegin('pmin', TType.I16, 2)
            oprot.writeI16(self.pmin)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getCandidatePool_args)
getCandidatePool_args.thrift_spec = (
    None,  # 0
    (1, TType.DOUBLE, 'reliability', None, None, ),  # 1
    (2, TType.I16, 'pmin', None, None, ),  # 2
)


class getCandidatePool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype92, _size89) = iprot.readListBegin()
                    for _i93 in range(_size89):
                        _elem94 = NeighborInfoData()
                        _elem94.read(iprot)
                        self.success.append(_elem94)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getCandidatePool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter95 in self.success:
                iter95.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getCandidatePool_result)
getCandidatePool_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class bootstrapFog_args(object):
    """
    Attributes:
     - NodeX
    """


    def __init__(self, NodeX=None,):
        self.NodeX = NodeX

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('bootstrapFog_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(bootstrapFog_args)
bootstrapFog_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
)


class bootstrapFog_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('bootstrapFog_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(bootstrapFog_result)
bootstrapFog_result.thrift_spec = (
    (0, TType.STRING, 'success', 'UTF8', None, ),  # 0
)


class initiate2PhasePreCommit_args(object):
    """
    Attributes:
     - preCommitRequest
    """


    def __init__(self, preCommitRequest=None,):
        self.preCommitRequest = preCommitRequest

    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.preCommitRequest = TwoPhasePreCommitRequest()
                    self.preCommitRequest.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhasePreCommit_args')
        if self.preCommitRequest is not None:
            oprot.writeFieldBegin('preCommitRequest', TType.STRUCT, 1)
            self.preCommitRequest.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhasePreCommit_args)
initiate2PhasePreCommit_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'preCommitRequest', [TwoPhasePreCommitRequest, None], None, ),  # 1
)


class initiate2PhasePreCommit_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhasePreCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhasePreCommit_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhasePreCommit_result)
initiate2PhasePreCommit_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhasePreCommitResponse, None], None, ),  # 0
)


class initiate2PhaseCommit_args(object):
    """
    Attributes:
     - commitRequest
    """


    def __init__(self, commitRequest=None,):
        self.commitRequest = commitRequest

    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.commitRequest = TwoPhaseCommitRequest()
                    self.commitRequest.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhaseCommit_args')
        if self.commitRequest is not None:
            oprot.writeFieldBegin('commitRequest', TType.STRUCT, 1)
            self.commitRequest.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhaseCommit_args)
initiate2PhaseCommit_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'commitRequest', [TwoPhaseCommitRequest, None], None, ),  # 1
)


class initiate2PhaseCommit_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhaseCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhaseCommit_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhaseCommit_result)
initiate2PhaseCommit_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhaseCommitResponse, None], None, ),  # 0
)


class buddyHeartBeat_args(object):
    """
    Attributes:
     - payload
    """


    def __init__(self, payload=None,):
        self.payload = payload

    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.payload = BuddyPayload()
                    self.payload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('buddyHeartBeat_args')
        if self.payload is not None:
            oprot.writeFieldBegin('payload', TType.STRUCT, 1)
            self.payload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(buddyHeartBeat_args)
buddyHeartBeat_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'payload', [BuddyPayload, None], None, ),  # 1
)


class neighborHeartBeat_args(object):
    """
    Attributes:
     - payload
    """


    def __init__(self, payload=None,):
        self.payload = payload

    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.payload = NeighborPayload()
                    self.payload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('neighborHeartBeat_args')
        if self.payload is not None:
            oprot.writeFieldBegin('payload', TType.STRUCT, 1)
            self.payload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(neighborHeartBeat_args)
neighborHeartBeat_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'payload', [NeighborPayload, None], None, ),  # 1
)


class getPoolMember_args(object):
    """
    Attributes:
     - buddyPoolId
    """


    def __init__(self, buddyPoolId=None,):
        self.buddyPoolId = buddyPoolId

    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.I16:
                    self.buddyPoolId = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getPoolMember_args')
        if self.buddyPoolId is not None:
            oprot.writeFieldBegin('buddyPoolId', TType.I16, 1)
            oprot.writeI16(self.buddyPoolId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getPoolMember_args)
getPoolMember_args.thrift_spec = (
    None,  # 0
    (1, TType.I16, 'buddyPoolId', None, None, ),  # 1
)


class getPoolMember_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = NodeInfoData()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getPoolMember_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getPoolMember_result)
getPoolMember_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [NodeInfoData, None], None, ),  # 0
)


class getBuddyPoolMembers_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getBuddyPoolMembers_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getBuddyPoolMembers_args)
getBuddyPoolMembers_args.thrift_spec = (
)


class getBuddyPoolMembers_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype99, _size96) = iprot.readListBegin()
                    for _i100 in range(_size96):
                        _elem101 = FogInfoData()
                        _elem101.read(iprot)
                        self.success.append(_elem101)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getBuddyPoolMembers_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter102 in self.success:
                iter102.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getBuddyPoolMembers_result)
getBuddyPoolMembers_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [FogInfoData, None], False), None, ),  # 0
)


class getNeighborCountPerPool_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getNeighborCountPerPool_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getNeighborCountPerPool_args)
getNeighborCountPerPool_args.thrift_spec = (
)


class getNeighborCountPerPool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = NeighborCount()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getNeighborCountPerPool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getNeighborCountPerPool_result)
getNeighborCountPerPool_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [NeighborCount, None], None, ),  # 0
)


class requestNeighbors_args(object):
    """
    Attributes:
     - requestMap
    """


    def __init__(self, requestMap=None,):
        self.requestMap = requestMap

    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.MAP:
                    self.requestMap = {}
                    (_ktype104, _vtype105, _size103) = iprot.readMapBegin()
                    for _i107 in range(_size103):
                        _key108 = iprot.readI16()
                        _val109 = iprot.readI16()
                        self.requestMap[_key108] = _val109
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestNeighbors_args')
        if self.requestMap is not None:
            oprot.writeFieldBegin('requestMap', TType.MAP, 1)
            oprot.writeMapBegin(TType.I16, TType.I16, len(self.requestMap))
            for kiter110, viter111 in self.requestMap.items():
                oprot.writeI16(kiter110)
                oprot.writeI16(viter111)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestNeighbors_args)
requestNeighbors_args.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'requestMap', (TType.I16, None, TType.I16, None, False), None, ),  # 1
)


class requestNeighbors_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype115, _size112) = iprot.readListBegin()
                    for _i116 in range(_size112):
                        _elem117 = NeighborInfoData()
                        _elem117.read(iprot)
                        self.success.append(_elem117)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestNeighbors_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter118 in self.success:
                iter118.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestNeighbors_result)
requestNeighbors_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class nodeJoiningComplete_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('nodeJoiningComplete_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(nodeJoiningComplete_args)
nodeJoiningComplete_args.thrift_spec = (
)


class nodeJoiningComplete_result(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('nodeJoiningComplete_result')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(nodeJoiningComplete_result)
nodeJoiningComplete_result.thrift_spec = (
)


class subscribe_args(object):
    """
    Attributes:
     - nodeInfoData
    """


    def __init__(self, nodeInfoData=None,):
        self.nodeInfoData = nodeInfoData

    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.nodeInfoData = NodeInfoData()
                    self.nodeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('subscribe_args')
        if self.nodeInfoData is not None:
            oprot.writeFieldBegin('nodeInfoData', TType.STRUCT, 1)
            self.nodeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(subscribe_args)
subscribe_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'nodeInfoData', [NodeInfoData, None], None, ),  # 1
)


class subscribe_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('subscribe_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(subscribe_result)
subscribe_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
)


class edgeHeartBeats_args(object):
    """
    Attributes:
     - edgePayload
    """


    def __init__(self, edgePayload=None,):
        self.edgePayload = edgePayload

    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.edgePayload = EdgePayload()
                    self.edgePayload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeHeartBeats_args')
        if self.edgePayload is not None:
            oprot.writeFieldBegin('edgePayload', TType.STRUCT, 1)
            self.edgePayload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeHeartBeats_args)
edgeHeartBeats_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgePayload', [EdgePayload, None], None, ),  # 1
)


class edgeHeartBeats_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeHeartBeats_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeHeartBeats_result)
edgeHeartBeats_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
)


class edgeJoin_args(object):
    """
    Attributes:
     - edgeInfoData
    """


    def __init__(self, edgeInfoData=None,):
        self.edgeInfoData = edgeInfoData

    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.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeJoin_args')
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 1)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeJoin_args)
edgeJoin_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 1
)


class edgeJoin_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeJoin_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeJoin_result)
edgeJoin_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class edgeLeave_args(object):
    """
    Attributes:
     - edgeInfoData
    """


    def __init__(self, edgeInfoData=None,):
        self.edgeInfoData = edgeInfoData

    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.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeLeave_args')
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 1)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeLeave_args)
edgeLeave_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 1
)


class edgeLeave_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeLeave_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeLeave_result)
edgeLeave_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class terminate_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('terminate_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(terminate_args)
terminate_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class terminate_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('terminate_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(terminate_result)
terminate_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class registerStream_args(object):
    """
    Attributes:
     - streamId
     - streamMetadata
     - startSequenceNumber
    """


    def __init__(self, streamId=None, streamMetadata=None, startSequenceNumber=None,):
        self.streamId = streamId
        self.streamMetadata = streamMetadata
        self.startSequenceNumber = startSequenceNumber

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.streamMetadata = StreamMetadata()
                    self.streamMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.startSequenceNumber = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('registerStream_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.streamMetadata is not None:
            oprot.writeFieldBegin('streamMetadata', TType.STRUCT, 2)
            self.streamMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.startSequenceNumber is not None:
            oprot.writeFieldBegin('startSequenceNumber', TType.I64, 3)
            oprot.writeI64(self.startSequenceNumber)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(registerStream_args)
registerStream_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRUCT, 'streamMetadata', [StreamMetadata, None], None, ),  # 2
    (3, TType.I64, 'startSequenceNumber', None, None, ),  # 3
)


class registerStream_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('registerStream_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(registerStream_result)
registerStream_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class intentToWrite_args(object):
    """
    Attributes:
     - clientId
    """


    def __init__(self, clientId=None,):
        self.clientId = clientId

    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.BYTE:
                    self.clientId = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('intentToWrite_args')
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.BYTE, 1)
            oprot.writeByte(self.clientId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(intentToWrite_args)
intentToWrite_args.thrift_spec = (
    None,  # 0
    (1, TType.BYTE, 'clientId', None, None, ),  # 1
)


class intentToWrite_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('intentToWrite_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(intentToWrite_result)
intentToWrite_result.thrift_spec = (
    (0, TType.STRING, 'success', 'UTF8', None, ),  # 0
)


class getStreamMetadata_args(object):
    """
    Attributes:
     - streamId
     - checkNeighbors
     - checkBuddies
     - forceLatest
    """


    def __init__(self, streamId=None, checkNeighbors=None, checkBuddies=None, forceLatest=None,):
        self.streamId = streamId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies
        self.forceLatest = forceLatest

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.forceLatest = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadata_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        if self.forceLatest is not None:
            oprot.writeFieldBegin('forceLatest', TType.BOOL, 4)
            oprot.writeBool(self.forceLatest)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadata_args)
getStreamMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
    (4, TType.BOOL, 'forceLatest', None, None, ),  # 4
)


class getStreamMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadataInfo()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadata_result)
getStreamMetadata_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadataInfo, None], None, ),  # 0
)


class getStreamMetadataFromOwner_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadataFromOwner_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadataFromOwner_args)
getStreamMetadataFromOwner_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class getStreamMetadataFromOwner_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadata()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadataFromOwner_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadataFromOwner_result)
getStreamMetadataFromOwner_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadata, None], None, ),  # 0
)


class getWriteLocations_args(object):
    """
    Attributes:
     - dataLength
     - metadata
     - blackListedFogs
     - isEdge
    """


    def __init__(self, dataLength=None, metadata=None, blackListedFogs=None, isEdge=None,):
        self.dataLength = dataLength
        self.metadata = metadata
        self.blackListedFogs = blackListedFogs
        self.isEdge = isEdge

    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.BYTE:
                    self.dataLength = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.metadata = Metadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.blackListedFogs = []
                    (_etype122, _size119) = iprot.readListBegin()
                    for _i123 in range(_size119):
                        _elem124 = iprot.readI16()
                        self.blackListedFogs.append(_elem124)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.isEdge = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getWriteLocations_args')
        if self.dataLength is not None:
            oprot.writeFieldBegin('dataLength', TType.BYTE, 1)
            oprot.writeByte(self.dataLength)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin('metadata', TType.STRUCT, 2)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        if self.blackListedFogs is not None:
            oprot.writeFieldBegin('blackListedFogs', TType.LIST, 3)
            oprot.writeListBegin(TType.I16, len(self.blackListedFogs))
            for iter125 in self.blackListedFogs:
                oprot.writeI16(iter125)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isEdge is not None:
            oprot.writeFieldBegin('isEdge', TType.BOOL, 4)
            oprot.writeBool(self.isEdge)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getWriteLocations_args)
getWriteLocations_args.thrift_spec = (
    None,  # 0
    (1, TType.BYTE, 'dataLength', None, None, ),  # 1
    (2, TType.STRUCT, 'metadata', [Metadata, None], None, ),  # 2
    (3, TType.LIST, 'blackListedFogs', (TType.I16, None, False), None, ),  # 3
    (4, TType.BOOL, 'isEdge', None, None, ),  # 4
)


class getWriteLocations_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype129, _size126) = iprot.readListBegin()
                    for _i130 in range(_size126):
                        _elem131 = WritableFogData()
                        _elem131.read(iprot)
                        self.success.append(_elem131)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getWriteLocations_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter132 in self.success:
                iter132.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getWriteLocations_result)
getWriteLocations_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [WritableFogData, None], False), None, ),  # 0
)


class write_args(object):
    """
    Attributes:
     - mbMetadata
     - data
     - preference
    """


    def __init__(self, mbMetadata=None, data=None, preference=None,):
        self.mbMetadata = mbMetadata
        self.data = data
        self.preference = preference

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.data = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.preference = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('write_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.data is not None:
            oprot.writeFieldBegin('data', TType.STRING, 2)
            oprot.writeBinary(self.data)
            oprot.writeFieldEnd()
        if self.preference is not None:
            oprot.writeFieldBegin('preference', TType.I32, 3)
            oprot.writeI32(self.preference)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(write_args)
write_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRING, 'data', 'BINARY', None, ),  # 2
    (3, TType.I32, 'preference', None, None, ),  # 3
)


class write_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('write_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(write_result)
write_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class writeNext_args(object):
    """
    Attributes:
     - sessionId
     - mbData
     - dataLength
    """


    def __init__(self, sessionId=None, mbData=None, dataLength=None,):
        self.sessionId = sessionId
        self.mbData = mbData
        self.dataLength = dataLength

    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.sessionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.mbData = Metadata()
                    self.mbData.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BYTE:
                    self.dataLength = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('writeNext_args')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.STRING, 1)
            oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId)
            oprot.writeFieldEnd()
        if self.mbData is not None:
            oprot.writeFieldBegin('mbData', TType.STRUCT, 2)
            self.mbData.write(oprot)
            oprot.writeFieldEnd()
        if self.dataLength is not None:
            oprot.writeFieldBegin('dataLength', TType.BYTE, 3)
            oprot.writeByte(self.dataLength)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(writeNext_args)
writeNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'sessionId', 'UTF8', None, ),  # 1
    (2, TType.STRUCT, 'mbData', [Metadata, None], None, ),  # 2
    (3, TType.BYTE, 'dataLength', None, None, ),  # 3
)


class writeNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype136, _size133) = iprot.readListBegin()
                    for _i137 in range(_size133):
                        _elem138 = NodeInfoData()
                        _elem138.read(iprot)
                        self.success.append(_elem138)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('writeNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter139 in self.success:
                iter139.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(writeNext_result)
writeNext_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NodeInfoData, None], False), None, ),  # 0
)


class insertMetadata_args(object):
    """
    Attributes:
     - mbMetadata
     - edgeInfoData
     - metaKeyValueMap
    """


    def __init__(self, mbMetadata=None, edgeInfoData=None, metaKeyValueMap=None,):
        self.mbMetadata = mbMetadata
        self.edgeInfoData = edgeInfoData
        self.metaKeyValueMap = metaKeyValueMap

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype141, _vtype142, _size140) = iprot.readMapBegin()
                    for _i144 in range(_size140):
                        _key145 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val146 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key145] = _val146
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('insertMetadata_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 2)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 3)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter147, viter148 in self.metaKeyValueMap.items():
                oprot.writeString(kiter147.encode('utf-8') if sys.version_info[0] == 2 else kiter147)
                oprot.writeString(viter148.encode('utf-8') if sys.version_info[0] == 2 else viter148)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(insertMetadata_args)
insertMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 2
    (3, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 3
)


class insertMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('insertMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(insertMetadata_result)
insertMetadata_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class findNext_args(object):
    """
    Attributes:
     - microbatchId
    """


    def __init__(self, microbatchId=None,):
        self.microbatchId = microbatchId

    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.microbatchId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findNext_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.STRING, 1)
            oprot.writeString(self.microbatchId.encode('utf-8') if sys.version_info[0] == 2 else self.microbatchId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findNext_args)
findNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'microbatchId', 'UTF8', None, ),  # 1
)


class findNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeBinary(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findNext_result)
findNext_result.thrift_spec = (
    (0, TType.STRING, 'success', 'BINARY', None, ),  # 0
)


class find_args(object):
    """
    Attributes:
     - microbatchId
     - checkNeighbors
     - checkBuddies
     - selfInfo
    """


    def __init__(self, microbatchId=None, checkNeighbors=None, checkBuddies=None, selfInfo=None,):
        self.microbatchId = microbatchId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies
        self.selfInfo = selfInfo

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.selfInfo = EdgeInfoData()
                    self.selfInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('find_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        if self.selfInfo is not None:
            oprot.writeFieldBegin('selfInfo', TType.STRUCT, 4)
            self.selfInfo.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(find_args)
find_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
    (4, TType.STRUCT, 'selfInfo', [EdgeInfoData, None], None, ),  # 4
)


class find_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype152, _size149) = iprot.readListBegin()
                    for _i153 in range(_size149):
                        _elem154 = FindReplica()
                        _elem154.read(iprot)
                        self.success.append(_elem154)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('find_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter155 in self.success:
                iter155.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(find_result)
find_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [FindReplica, None], False), None, ),  # 0
)


class read_args(object):
    """
    Attributes:
     - microbatchId
     - fetchMetadata
    """


    def __init__(self, microbatchId=None, fetchMetadata=None,):
        self.microbatchId = microbatchId
        self.fetchMetadata = fetchMetadata

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.fetchMetadata = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('read_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.fetchMetadata is not None:
            oprot.writeFieldBegin('fetchMetadata', TType.BOOL, 2)
            oprot.writeBool(self.fetchMetadata)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(read_args)
read_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'fetchMetadata', None, None, ),  # 2
)


class read_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = ReadReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('read_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(read_result)
read_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [ReadReplica, None], None, ),  # 0
)


class findUsingQuery_args(object):
    """
    Attributes:
     - metadataKey
     - metadataValue
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, metadataKey=None, metadataValue=None, checkNeighbors=None, checkBuddies=None,):
        self.metadataKey = metadataKey
        self.metadataValue = metadataValue
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.metadataKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.metadataValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findUsingQuery_args')
        if self.metadataKey is not None:
            oprot.writeFieldBegin('metadataKey', TType.STRING, 1)
            oprot.writeString(self.metadataKey.encode('utf-8') if sys.version_info[0] == 2 else self.metadataKey)
            oprot.writeFieldEnd()
        if self.metadataValue is not None:
            oprot.writeFieldBegin('metadataValue', TType.STRING, 2)
            oprot.writeString(self.metadataValue.encode('utf-8') if sys.version_info[0] == 2 else self.metadataValue)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 3)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 4)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findUsingQuery_args)
findUsingQuery_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'metadataKey', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'metadataValue', 'UTF8', None, ),  # 2
    (3, TType.BOOL, 'checkNeighbors', None, None, ),  # 3
    (4, TType.BOOL, 'checkBuddies', None, None, ),  # 4
)


class findUsingQuery_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = QueryReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findUsingQuery_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findUsingQuery_result)
findUsingQuery_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [QueryReplica, None], None, ),  # 0
)


class getMeta_args(object):
    """
    Attributes:
     - microbatchId
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, microbatchId=None, checkNeighbors=None, checkBuddies=None,):
        self.microbatchId = microbatchId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getMeta_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getMeta_args)
getMeta_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
)


class getMeta_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = ReadReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getMeta_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getMeta_result)
getMeta_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [ReadReplica, None], None, ),  # 0
)


class serializeState_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('serializeState_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(serializeState_args)
serializeState_args.thrift_spec = (
)


class serializeState_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('serializeState_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(serializeState_result)
serializeState_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class updateStreamMetadata_args(object):
    """
    Attributes:
     - metadata
    """


    def __init__(self, metadata=None,):
        self.metadata = metadata

    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.metadata = StreamMetadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateStreamMetadata_args')
        if self.metadata is not None:
            oprot.writeFieldBegin('metadata', TType.STRUCT, 1)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateStreamMetadata_args)
updateStreamMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'metadata', [StreamMetadata, None], None, ),  # 1
)


class updateStreamMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadataUpdateResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateStreamMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateStreamMetadata_result)
updateStreamMetadata_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadataUpdateResponse, None], None, ),  # 0
)


class open_args(object):
    """
    Attributes:
     - streamId
     - clientId
     - expectedLease
     - setLease
    """


    def __init__(self, streamId=None, clientId=None, expectedLease=None, setLease=None,):
        self.streamId = streamId
        self.clientId = clientId
        self.expectedLease = expectedLease
        self.setLease = setLease

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.expectedLease = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('open_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.expectedLease is not None:
            oprot.writeFieldBegin('expectedLease', TType.I32, 3)
            oprot.writeI32(self.expectedLease)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 4)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(open_args)
open_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
    (3, TType.I32, 'expectedLease', None, None, ),  # 3
    (4, TType.BOOL, 'setLease', None, None, ),  # 4
)


class open_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = OpenStreamResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('open_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(open_result)
open_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [OpenStreamResponse, None], None, ),  # 0
)


class putNext_args(object):
    """
    Attributes:
     - mbMetadata
     - data
     - preference
     - metaKeyValueMap
    """


    def __init__(self, mbMetadata=None, data=None, preference=None, metaKeyValueMap=None,):
        self.mbMetadata = mbMetadata
        self.data = data
        self.preference = preference
        self.metaKeyValueMap = metaKeyValueMap

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.data = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.preference = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype157, _vtype158, _size156) = iprot.readMapBegin()
                    for _i160 in range(_size156):
                        _key161 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val162 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key161] = _val162
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('putNext_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.data is not None:
            oprot.writeFieldBegin('data', TType.STRING, 2)
            oprot.writeBinary(self.data)
            oprot.writeFieldEnd()
        if self.preference is not None:
            oprot.writeFieldBegin('preference', TType.I32, 3)
            oprot.writeI32(self.preference)
            oprot.writeFieldEnd()
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 4)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter163, viter164 in self.metaKeyValueMap.items():
                oprot.writeString(kiter163.encode('utf-8') if sys.version_info[0] == 2 else kiter163)
                oprot.writeString(viter164.encode('utf-8') if sys.version_info[0] == 2 else viter164)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(putNext_args)
putNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRING, 'data', 'BINARY', None, ),  # 2
    (3, TType.I32, 'preference', None, None, ),  # 3
    (4, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 4
)


class putNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('putNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(putNext_result)
putNext_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class incrementBlockCount_args(object):
    """
    Attributes:
     - mbMetadata
     - setLease
    """


    def __init__(self, mbMetadata=None, setLease=None,):
        self.mbMetadata = mbMetadata
        self.setLease = setLease

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('incrementBlockCount_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 2)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(incrementBlockCount_args)
incrementBlockCount_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.BOOL, 'setLease', None, None, ),  # 2
)


class incrementBlockCount_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = BlockMetadataUpdateResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('incrementBlockCount_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(incrementBlockCount_result)
incrementBlockCount_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [BlockMetadataUpdateResponse, None], None, ),  # 0
)


class renewLease_args(object):
    """
    Attributes:
     - streamId
     - clientId
     - sessionSecret
     - expectedLease
     - setLease
    """


    def __init__(self, streamId=None, clientId=None, sessionSecret=None, expectedLease=None, setLease=None,):
        self.streamId = streamId
        self.clientId = clientId
        self.sessionSecret = sessionSecret
        self.expectedLease = expectedLease
        self.setLease = setLease

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.sessionSecret = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.expectedLease = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('renewLease_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.sessionSecret is not None:
            oprot.writeFieldBegin('sessionSecret', TType.STRING, 3)
            oprot.writeString(self.sessionSecret.encode('utf-8') if sys.version_info[0] == 2 else self.sessionSecret)
            oprot.writeFieldEnd()
        if self.expectedLease is not None:
            oprot.writeFieldBegin('expectedLease', TType.I32, 4)
            oprot.writeI32(self.expectedLease)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 5)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(renewLease_args)
renewLease_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'sessionSecret', 'UTF8', None, ),  # 3
    (4, TType.I32, 'expectedLease', None, None, ),  # 4
    (5, TType.BOOL, 'setLease', None, None, ),  # 5
)


class renewLease_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamLeaseRenewalResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('renewLease_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(renewLease_result)
renewLease_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamLeaseRenewalResponse, None], None, ),  # 0
)


class getLargestBlockId_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getLargestBlockId_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getLargestBlockId_args)
getLargestBlockId_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class getLargestBlockId_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.I64:
                    self.success = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getLargestBlockId_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.I64, 0)
            oprot.writeI64(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getLargestBlockId_result)
getLargestBlockId_result.thrift_spec = (
    (0, TType.I64, 'success', None, None, ),  # 0
)


class findStream_args(object):
    """
    Attributes:
     - squery
    """


    def __init__(self, squery=None,):
        self.squery = squery

    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.squery = SQueryRequest()
                    self.squery.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findStream_args')
        if self.squery is not None:
            oprot.writeFieldBegin('squery', TType.STRUCT, 1)
            self.squery.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findStream_args)
findStream_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'squery', [SQueryRequest, None], None, ),  # 1
)


class findStream_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = SQueryResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findStream_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findStream_result)
findStream_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [SQueryResponse, None], None, ),  # 0
)


class updateBlock_args(object):
    """
    Attributes:
     - mbId
     - mbMetadata
     - mbData
    """


    def __init__(self, mbId=None, mbMetadata=None, mbData=None,):
        self.mbId = mbId
        self.mbMetadata = mbMetadata
        self.mbData = mbData

    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.I64:
                    self.mbId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.mbData = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateBlock_args')
        if self.mbId is not None:
            oprot.writeFieldBegin('mbId', TType.I64, 1)
            oprot.writeI64(self.mbId)
            oprot.writeFieldEnd()
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 2)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.mbData is not None:
            oprot.writeFieldBegin('mbData', TType.STRING, 3)
            oprot.writeBinary(self.mbData)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateBlock_args)
updateBlock_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'mbId', None, None, ),  # 1
    (2, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 2
    (3, TType.STRING, 'mbData', 'BINARY', None, ),  # 3
)


class updateBlock_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateBlock_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateBlock_result)
updateBlock_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class listLocalPartitionMbId_args(object):
    """
    Attributes:
     - flag
    """


    def __init__(self, flag=None,):
        self.flag = flag

    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.BOOL:
                    self.flag = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('listLocalPartitionMbId_args')
        if self.flag is not None:
            oprot.writeFieldBegin('flag', TType.BOOL, 1)
            oprot.writeBool(self.flag)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(listLocalPartitionMbId_args)
listLocalPartitionMbId_args.thrift_spec = (
    None,  # 0
    (1, TType.BOOL, 'flag', None, None, ),  # 1
)


class listLocalPartitionMbId_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.SET:
                    self.success = set()
                    (_etype168, _size165) = iprot.readSetBegin()
                    for _i169 in range(_size165):
                        _elem170 = iprot.readI64()
                        self.success.add(_elem170)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('listLocalPartitionMbId_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.SET, 0)
            oprot.writeSetBegin(TType.I64, len(self.success))
            for iter171 in self.success:
                oprot.writeI64(iter171)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(listLocalPartitionMbId_result)
listLocalPartitionMbId_result.thrift_spec = (
    (0, TType.SET, 'success', (TType.I64, None, False), None, ),  # 0
)


class requestAllNeighbors_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestAllNeighbors_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestAllNeighbors_args)
requestAllNeighbors_args.thrift_spec = (
)


class requestAllNeighbors_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype175, _size172) = iprot.readListBegin()
                    for _i176 in range(_size172):
                        _elem177 = NeighborInfoData()
                        _elem177.read(iprot)
                        self.success.append(_elem177)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestAllNeighbors_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter178 in self.success:
                iter178.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestAllNeighbors_result)
requestAllNeighbors_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class requestMbIDLocationMap_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestMbIDLocationMap_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestMbIDLocationMap_args)
requestMbIDLocationMap_args.thrift_spec = (
)


class requestMbIDLocationMap_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.MAP:
                    self.success = {}
                    (_ktype180, _vtype181, _size179) = iprot.readMapBegin()
                    for _i183 in range(_size179):
                        _key184 = iprot.readI64()
                        _val185 = {}
                        (_ktype187, _vtype188, _size186) = iprot.readMapBegin()
                        for _i190 in range(_size186):
                            _key191 = iprot.readI16()
                            _val192 = iprot.readByte()
                            _val185[_key191] = _val192
                        iprot.readMapEnd()
                        self.success[_key184] = _val185
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestMbIDLocationMap_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.MAP, 0)
            oprot.writeMapBegin(TType.I64, TType.MAP, len(self.success))
            for kiter193, viter194 in self.success.items():
                oprot.writeI64(kiter193)
                oprot.writeMapBegin(TType.I16, TType.BYTE, len(viter194))
                for kiter195, viter196 in viter194.items():
                    oprot.writeI16(kiter195)
                    oprot.writeByte(viter196)
                oprot.writeMapEnd()
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestMbIDLocationMap_result)
requestMbIDLocationMap_result.thrift_spec = (
    (0, TType.MAP, 'success', (TType.I64, None, TType.MAP, (TType.I16, None, TType.BYTE, None, False), False), None, ),  # 0
)


class findBlockUsingQuery_args(object):
    """
    Attributes:
     - metaKeyValueMap
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, metaKeyValueMap=None, checkNeighbors=None, checkBuddies=None,):
        self.metaKeyValueMap = metaKeyValueMap
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype198, _vtype199, _size197) = iprot.readMapBegin()
                    for _i201 in range(_size197):
                        _key202 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val203 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key202] = _val203
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findBlockUsingQuery_args')
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter204, viter205 in self.metaKeyValueMap.items():
                oprot.writeString(kiter204.encode('utf-8') if sys.version_info[0] == 2 else kiter204)
                oprot.writeString(viter205.encode('utf-8') if sys.version_info[0] == 2 else viter205)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findBlockUsingQuery_args)
findBlockUsingQuery_args.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
)


class findBlockUsingQuery_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.MAP:
                    self.success = {}
                    (_ktype207, _vtype208, _size206) = iprot.readMapBegin()
                    for _i210 in range(_size206):
                        _key211 = iprot.readI64()
                        _val212 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.success[_key211] = _val212
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findBlockUsingQuery_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.MAP, 0)
            oprot.writeMapBegin(TType.I64, TType.STRING, len(self.success))
            for kiter213, viter214 in self.success.items():
                oprot.writeI64(kiter213)
                oprot.writeString(viter214.encode('utf-8') if sys.version_info[0] == 2 else viter214)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findBlockUsingQuery_result)
findBlockUsingQuery_result.thrift_spec = (
    (0, TType.MAP, 'success', (TType.I64, None, TType.STRING, 'UTF8', False), None, ),  # 0
)
fix_spec(all_structs)
del all_structs


#
# Autogenerated by Thrift Compiler (0.11.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py
#

from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec

import sys
import logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []


class Iface(object):
    def joinCluster(self, NodeX, pmin, pmax):
        """
        Parameters:
         - NodeX
         - pmin
         - pmax
        """
        pass

    def joinPool(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        pass

    def getCandidatePool(self, reliability, pmin):
        """
        Parameters:
         - reliability
         - pmin
        """
        pass

    def bootstrapFog(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        pass

    def initiate2PhasePreCommit(self, preCommitRequest):
        """
        Parameters:
         - preCommitRequest
        """
        pass

    def initiate2PhaseCommit(self, commitRequest):
        """
        Parameters:
         - commitRequest
        """
        pass

    def buddyHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        pass

    def neighborHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        pass

    def getPoolMember(self, buddyPoolId):
        """
        Parameters:
         - buddyPoolId
        """
        pass

    def getBuddyPoolMembers(self):
        pass

    def getNeighborCountPerPool(self):
        pass

    def requestNeighbors(self, requestMap):
        """
        Parameters:
         - requestMap
        """
        pass

    def nodeJoiningComplete(self):
        pass

    def subscribe(self, nodeInfoData):
        """
        Parameters:
         - nodeInfoData
        """
        pass

    def edgeHeartBeats(self, edgePayload):
        """
        Parameters:
         - edgePayload
        """
        pass

    def edgeJoin(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        pass

    def edgeLeave(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        pass

    def terminate(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def registerStream(self, streamId, streamMetadata, startSequenceNumber):
        """
        Parameters:
         - streamId
         - streamMetadata
         - startSequenceNumber
        """
        pass

    def intentToWrite(self, clientId):
        """
        Parameters:
         - clientId
        """
        pass

    def getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        """
        Parameters:
         - streamId
         - checkNeighbors
         - checkBuddies
         - forceLatest
        """
        pass

    def getStreamMetadataFromOwner(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        """
        Parameters:
         - dataLength
         - metadata
         - blackListedFogs
         - isEdge
        """
        pass

    def write(self, mbMetadata, data, preference):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
        """
        pass

    def writeNext(self, sessionId, mbData, dataLength):
        """
        Parameters:
         - sessionId
         - mbData
         - dataLength
        """
        pass

    def insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - edgeInfoData
         - metaKeyValueMap
        """
        pass

    def findNext(self, microbatchId):
        """
        Parameters:
         - microbatchId
        """
        pass

    def find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
         - selfInfo
        """
        pass

    def read(self, microbatchId, fetchMetadata):
        """
        Parameters:
         - microbatchId
         - fetchMetadata
        """
        pass

    def findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metadataKey
         - metadataValue
         - checkNeighbors
         - checkBuddies
        """
        pass

    def getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
        """
        pass

    def serializeState(self):
        pass

    def updateStreamMetadata(self, metadata):
        """
        Parameters:
         - metadata
        """
        pass

    def open(self, streamId, clientId, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - expectedLease
         - setLease
        """
        pass

    def putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
         - metaKeyValueMap
        """
        pass

    def incrementBlockCount(self, mbMetadata, setLease):
        """
        Parameters:
         - mbMetadata
         - setLease
        """
        pass

    def renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - sessionSecret
         - expectedLease
         - setLease
        """
        pass

    def getLargestBlockId(self, streamId):
        """
        Parameters:
         - streamId
        """
        pass

    def findStream(self, squery):
        """
        Parameters:
         - squery
        """
        pass

    def updateBlock(self, mbId, mbMetadata, mbData):
        """
        Parameters:
         - mbId
         - mbMetadata
         - mbData
        """
        pass

    def listLocalPartitionMbId(self, flag):
        """
        Parameters:
         - flag
        """
        pass

    def requestAllNeighbors(self):
        pass

    def requestMbIDLocationMap(self):
        pass

    def findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metaKeyValueMap
         - checkNeighbors
         - checkBuddies
        """
        pass


class Client(Iface):
    def __init__(self, iprot, oprot=None):
        self._iprot = self._oprot = iprot
        if oprot is not None:
            self._oprot = oprot
        self._seqid = 0

    def joinCluster(self, NodeX, pmin, pmax):
        """
        Parameters:
         - NodeX
         - pmin
         - pmax
        """
        self.send_joinCluster(NodeX, pmin, pmax)
        return self.recv_joinCluster()

    def send_joinCluster(self, NodeX, pmin, pmax):
        self._oprot.writeMessageBegin('joinCluster', TMessageType.CALL, self._seqid)
        args = joinCluster_args()
        args.NodeX = NodeX
        args.pmin = pmin
        args.pmax = pmax
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_joinCluster(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = joinCluster_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "joinCluster failed: unknown result")

    def joinPool(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        self.send_joinPool(NodeX)
        return self.recv_joinPool()

    def send_joinPool(self, NodeX):
        self._oprot.writeMessageBegin('joinPool', TMessageType.CALL, self._seqid)
        args = joinPool_args()
        args.NodeX = NodeX
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_joinPool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = joinPool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "joinPool failed: unknown result")

    def getCandidatePool(self, reliability, pmin):
        """
        Parameters:
         - reliability
         - pmin
        """
        self.send_getCandidatePool(reliability, pmin)
        return self.recv_getCandidatePool()

    def send_getCandidatePool(self, reliability, pmin):
        self._oprot.writeMessageBegin('getCandidatePool', TMessageType.CALL, self._seqid)
        args = getCandidatePool_args()
        args.reliability = reliability
        args.pmin = pmin
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getCandidatePool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getCandidatePool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getCandidatePool failed: unknown result")

    def bootstrapFog(self, NodeX):
        """
        Parameters:
         - NodeX
        """
        self.send_bootstrapFog(NodeX)
        return self.recv_bootstrapFog()

    def send_bootstrapFog(self, NodeX):
        self._oprot.writeMessageBegin('bootstrapFog', TMessageType.CALL, self._seqid)
        args = bootstrapFog_args()
        args.NodeX = NodeX
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_bootstrapFog(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = bootstrapFog_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "bootstrapFog failed: unknown result")

    def initiate2PhasePreCommit(self, preCommitRequest):
        """
        Parameters:
         - preCommitRequest
        """
        self.send_initiate2PhasePreCommit(preCommitRequest)
        return self.recv_initiate2PhasePreCommit()

    def send_initiate2PhasePreCommit(self, preCommitRequest):
        self._oprot.writeMessageBegin('initiate2PhasePreCommit', TMessageType.CALL, self._seqid)
        args = initiate2PhasePreCommit_args()
        args.preCommitRequest = preCommitRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_initiate2PhasePreCommit(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = initiate2PhasePreCommit_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "initiate2PhasePreCommit failed: unknown result")

    def initiate2PhaseCommit(self, commitRequest):
        """
        Parameters:
         - commitRequest
        """
        self.send_initiate2PhaseCommit(commitRequest)
        return self.recv_initiate2PhaseCommit()

    def send_initiate2PhaseCommit(self, commitRequest):
        self._oprot.writeMessageBegin('initiate2PhaseCommit', TMessageType.CALL, self._seqid)
        args = initiate2PhaseCommit_args()
        args.commitRequest = commitRequest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_initiate2PhaseCommit(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = initiate2PhaseCommit_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "initiate2PhaseCommit failed: unknown result")

    def buddyHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        self.send_buddyHeartBeat(payload)

    def send_buddyHeartBeat(self, payload):
        self._oprot.writeMessageBegin('buddyHeartBeat', TMessageType.ONEWAY, self._seqid)
        args = buddyHeartBeat_args()
        args.payload = payload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def neighborHeartBeat(self, payload):
        """
        Parameters:
         - payload
        """
        self.send_neighborHeartBeat(payload)

    def send_neighborHeartBeat(self, payload):
        self._oprot.writeMessageBegin('neighborHeartBeat', TMessageType.ONEWAY, self._seqid)
        args = neighborHeartBeat_args()
        args.payload = payload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def getPoolMember(self, buddyPoolId):
        """
        Parameters:
         - buddyPoolId
        """
        self.send_getPoolMember(buddyPoolId)
        return self.recv_getPoolMember()

    def send_getPoolMember(self, buddyPoolId):
        self._oprot.writeMessageBegin('getPoolMember', TMessageType.CALL, self._seqid)
        args = getPoolMember_args()
        args.buddyPoolId = buddyPoolId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getPoolMember(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getPoolMember_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getPoolMember failed: unknown result")

    def getBuddyPoolMembers(self):
        self.send_getBuddyPoolMembers()
        return self.recv_getBuddyPoolMembers()

    def send_getBuddyPoolMembers(self):
        self._oprot.writeMessageBegin('getBuddyPoolMembers', TMessageType.CALL, self._seqid)
        args = getBuddyPoolMembers_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getBuddyPoolMembers(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getBuddyPoolMembers_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getBuddyPoolMembers failed: unknown result")

    def getNeighborCountPerPool(self):
        self.send_getNeighborCountPerPool()
        return self.recv_getNeighborCountPerPool()

    def send_getNeighborCountPerPool(self):
        self._oprot.writeMessageBegin('getNeighborCountPerPool', TMessageType.CALL, self._seqid)
        args = getNeighborCountPerPool_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getNeighborCountPerPool(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getNeighborCountPerPool_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getNeighborCountPerPool failed: unknown result")

    def requestNeighbors(self, requestMap):
        """
        Parameters:
         - requestMap
        """
        self.send_requestNeighbors(requestMap)
        return self.recv_requestNeighbors()

    def send_requestNeighbors(self, requestMap):
        self._oprot.writeMessageBegin('requestNeighbors', TMessageType.CALL, self._seqid)
        args = requestNeighbors_args()
        args.requestMap = requestMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestNeighbors(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestNeighbors_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestNeighbors failed: unknown result")

    def nodeJoiningComplete(self):
        self.send_nodeJoiningComplete()
        self.recv_nodeJoiningComplete()

    def send_nodeJoiningComplete(self):
        self._oprot.writeMessageBegin('nodeJoiningComplete', TMessageType.CALL, self._seqid)
        args = nodeJoiningComplete_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_nodeJoiningComplete(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = nodeJoiningComplete_result()
        result.read(iprot)
        iprot.readMessageEnd()
        return

    def subscribe(self, nodeInfoData):
        """
        Parameters:
         - nodeInfoData
        """
        self.send_subscribe(nodeInfoData)
        return self.recv_subscribe()

    def send_subscribe(self, nodeInfoData):
        self._oprot.writeMessageBegin('subscribe', TMessageType.CALL, self._seqid)
        args = subscribe_args()
        args.nodeInfoData = nodeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_subscribe(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = subscribe_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "subscribe failed: unknown result")

    def edgeHeartBeats(self, edgePayload):
        """
        Parameters:
         - edgePayload
        """
        self.send_edgeHeartBeats(edgePayload)
        return self.recv_edgeHeartBeats()

    def send_edgeHeartBeats(self, edgePayload):
        self._oprot.writeMessageBegin('edgeHeartBeats', TMessageType.CALL, self._seqid)
        args = edgeHeartBeats_args()
        args.edgePayload = edgePayload
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeHeartBeats(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeHeartBeats_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeHeartBeats failed: unknown result")

    def edgeJoin(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        self.send_edgeJoin(edgeInfoData)
        return self.recv_edgeJoin()

    def send_edgeJoin(self, edgeInfoData):
        self._oprot.writeMessageBegin('edgeJoin', TMessageType.CALL, self._seqid)
        args = edgeJoin_args()
        args.edgeInfoData = edgeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeJoin(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeJoin_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeJoin failed: unknown result")

    def edgeLeave(self, edgeInfoData):
        """
        Parameters:
         - edgeInfoData
        """
        self.send_edgeLeave(edgeInfoData)
        return self.recv_edgeLeave()

    def send_edgeLeave(self, edgeInfoData):
        self._oprot.writeMessageBegin('edgeLeave', TMessageType.CALL, self._seqid)
        args = edgeLeave_args()
        args.edgeInfoData = edgeInfoData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_edgeLeave(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = edgeLeave_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "edgeLeave failed: unknown result")

    def terminate(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_terminate(streamId)
        return self.recv_terminate()

    def send_terminate(self, streamId):
        self._oprot.writeMessageBegin('terminate', TMessageType.CALL, self._seqid)
        args = terminate_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_terminate(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = terminate_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "terminate failed: unknown result")

    def registerStream(self, streamId, streamMetadata, startSequenceNumber):
        """
        Parameters:
         - streamId
         - streamMetadata
         - startSequenceNumber
        """
        self.send_registerStream(streamId, streamMetadata, startSequenceNumber)
        return self.recv_registerStream()

    def send_registerStream(self, streamId, streamMetadata, startSequenceNumber):
        self._oprot.writeMessageBegin('registerStream', TMessageType.CALL, self._seqid)
        args = registerStream_args()
        args.streamId = streamId
        args.streamMetadata = streamMetadata
        args.startSequenceNumber = startSequenceNumber
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_registerStream(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = registerStream_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "registerStream failed: unknown result")

    def intentToWrite(self, clientId):
        """
        Parameters:
         - clientId
        """
        self.send_intentToWrite(clientId)
        return self.recv_intentToWrite()

    def send_intentToWrite(self, clientId):
        self._oprot.writeMessageBegin('intentToWrite', TMessageType.CALL, self._seqid)
        args = intentToWrite_args()
        args.clientId = clientId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_intentToWrite(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = intentToWrite_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "intentToWrite failed: unknown result")

    def getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        """
        Parameters:
         - streamId
         - checkNeighbors
         - checkBuddies
         - forceLatest
        """
        self.send_getStreamMetadata(streamId, checkNeighbors, checkBuddies, forceLatest)
        return self.recv_getStreamMetadata()

    def send_getStreamMetadata(self, streamId, checkNeighbors, checkBuddies, forceLatest):
        self._oprot.writeMessageBegin('getStreamMetadata', TMessageType.CALL, self._seqid)
        args = getStreamMetadata_args()
        args.streamId = streamId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.forceLatest = forceLatest
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getStreamMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getStreamMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getStreamMetadata failed: unknown result")

    def getStreamMetadataFromOwner(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_getStreamMetadataFromOwner(streamId)
        return self.recv_getStreamMetadataFromOwner()

    def send_getStreamMetadataFromOwner(self, streamId):
        self._oprot.writeMessageBegin('getStreamMetadataFromOwner', TMessageType.CALL, self._seqid)
        args = getStreamMetadataFromOwner_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getStreamMetadataFromOwner(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getStreamMetadataFromOwner_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getStreamMetadataFromOwner failed: unknown result")

    def getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        """
        Parameters:
         - dataLength
         - metadata
         - blackListedFogs
         - isEdge
        """
        self.send_getWriteLocations(dataLength, metadata, blackListedFogs, isEdge)
        return self.recv_getWriteLocations()

    def send_getWriteLocations(self, dataLength, metadata, blackListedFogs, isEdge):
        self._oprot.writeMessageBegin('getWriteLocations', TMessageType.CALL, self._seqid)
        args = getWriteLocations_args()
        args.dataLength = dataLength
        args.metadata = metadata
        args.blackListedFogs = blackListedFogs
        args.isEdge = isEdge
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getWriteLocations(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getWriteLocations_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getWriteLocations failed: unknown result")

    def write(self, mbMetadata, data, preference):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
        """
        self.send_write(mbMetadata, data, preference)
        return self.recv_write()

    def send_write(self, mbMetadata, data, preference):
        self._oprot.writeMessageBegin('write', TMessageType.CALL, self._seqid)
        args = write_args()
        args.mbMetadata = mbMetadata
        args.data = data
        args.preference = preference
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_write(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = write_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "write failed: unknown result")

    def writeNext(self, sessionId, mbData, dataLength):
        """
        Parameters:
         - sessionId
         - mbData
         - dataLength
        """
        self.send_writeNext(sessionId, mbData, dataLength)
        return self.recv_writeNext()

    def send_writeNext(self, sessionId, mbData, dataLength):
        self._oprot.writeMessageBegin('writeNext', TMessageType.CALL, self._seqid)
        args = writeNext_args()
        args.sessionId = sessionId
        args.mbData = mbData
        args.dataLength = dataLength
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_writeNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = writeNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "writeNext failed: unknown result")

    def insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - edgeInfoData
         - metaKeyValueMap
        """
        self.send_insertMetadata(mbMetadata, edgeInfoData, metaKeyValueMap)
        return self.recv_insertMetadata()

    def send_insertMetadata(self, mbMetadata, edgeInfoData, metaKeyValueMap):
        self._oprot.writeMessageBegin('insertMetadata', TMessageType.CALL, self._seqid)
        args = insertMetadata_args()
        args.mbMetadata = mbMetadata
        args.edgeInfoData = edgeInfoData
        args.metaKeyValueMap = metaKeyValueMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_insertMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = insertMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "insertMetadata failed: unknown result")

    def findNext(self, microbatchId):
        """
        Parameters:
         - microbatchId
        """
        self.send_findNext(microbatchId)
        return self.recv_findNext()

    def send_findNext(self, microbatchId):
        self._oprot.writeMessageBegin('findNext', TMessageType.CALL, self._seqid)
        args = findNext_args()
        args.microbatchId = microbatchId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findNext failed: unknown result")

    def find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
         - selfInfo
        """
        self.send_find(microbatchId, checkNeighbors, checkBuddies, selfInfo)
        return self.recv_find()

    def send_find(self, microbatchId, checkNeighbors, checkBuddies, selfInfo):
        self._oprot.writeMessageBegin('find', TMessageType.CALL, self._seqid)
        args = find_args()
        args.microbatchId = microbatchId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.selfInfo = selfInfo
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_find(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = find_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "find failed: unknown result")

    def read(self, microbatchId, fetchMetadata):
        """
        Parameters:
         - microbatchId
         - fetchMetadata
        """
        self.send_read(microbatchId, fetchMetadata)
        return self.recv_read()

    def send_read(self, microbatchId, fetchMetadata):
        self._oprot.writeMessageBegin('read', TMessageType.CALL, self._seqid)
        args = read_args()
        args.microbatchId = microbatchId
        args.fetchMetadata = fetchMetadata
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_read(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = read_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "read failed: unknown result")

    def findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metadataKey
         - metadataValue
         - checkNeighbors
         - checkBuddies
        """
        self.send_findUsingQuery(metadataKey, metadataValue, checkNeighbors, checkBuddies)
        return self.recv_findUsingQuery()

    def send_findUsingQuery(self, metadataKey, metadataValue, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('findUsingQuery', TMessageType.CALL, self._seqid)
        args = findUsingQuery_args()
        args.metadataKey = metadataKey
        args.metadataValue = metadataValue
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findUsingQuery(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findUsingQuery_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findUsingQuery failed: unknown result")

    def getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        """
        Parameters:
         - microbatchId
         - checkNeighbors
         - checkBuddies
        """
        self.send_getMeta(microbatchId, checkNeighbors, checkBuddies)
        return self.recv_getMeta()

    def send_getMeta(self, microbatchId, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('getMeta', TMessageType.CALL, self._seqid)
        args = getMeta_args()
        args.microbatchId = microbatchId
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getMeta(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getMeta_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getMeta failed: unknown result")

    def serializeState(self):
        self.send_serializeState()
        return self.recv_serializeState()

    def send_serializeState(self):
        self._oprot.writeMessageBegin('serializeState', TMessageType.CALL, self._seqid)
        args = serializeState_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_serializeState(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = serializeState_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "serializeState failed: unknown result")

    def updateStreamMetadata(self, metadata):
        """
        Parameters:
         - metadata
        """
        self.send_updateStreamMetadata(metadata)
        return self.recv_updateStreamMetadata()

    def send_updateStreamMetadata(self, metadata):
        self._oprot.writeMessageBegin('updateStreamMetadata', TMessageType.CALL, self._seqid)
        args = updateStreamMetadata_args()
        args.metadata = metadata
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_updateStreamMetadata(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = updateStreamMetadata_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "updateStreamMetadata failed: unknown result")

    def open(self, streamId, clientId, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - expectedLease
         - setLease
        """
        self.send_open(streamId, clientId, expectedLease, setLease)
        return self.recv_open()

    def send_open(self, streamId, clientId, expectedLease, setLease):
        self._oprot.writeMessageBegin('open', TMessageType.CALL, self._seqid)
        args = open_args()
        args.streamId = streamId
        args.clientId = clientId
        args.expectedLease = expectedLease
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_open(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = open_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "open failed: unknown result")

    def putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        """
        Parameters:
         - mbMetadata
         - data
         - preference
         - metaKeyValueMap
        """
        self.send_putNext(mbMetadata, data, preference, metaKeyValueMap)
        return self.recv_putNext()

    def send_putNext(self, mbMetadata, data, preference, metaKeyValueMap):
        self._oprot.writeMessageBegin('putNext', TMessageType.CALL, self._seqid)
        args = putNext_args()
        args.mbMetadata = mbMetadata
        args.data = data
        args.preference = preference
        args.metaKeyValueMap = metaKeyValueMap
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_putNext(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = putNext_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "putNext failed: unknown result")

    def incrementBlockCount(self, mbMetadata, setLease):
        """
        Parameters:
         - mbMetadata
         - setLease
        """
        self.send_incrementBlockCount(mbMetadata, setLease)
        return self.recv_incrementBlockCount()

    def send_incrementBlockCount(self, mbMetadata, setLease):
        self._oprot.writeMessageBegin('incrementBlockCount', TMessageType.CALL, self._seqid)
        args = incrementBlockCount_args()
        args.mbMetadata = mbMetadata
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_incrementBlockCount(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = incrementBlockCount_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "incrementBlockCount failed: unknown result")

    def renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        """
        Parameters:
         - streamId
         - clientId
         - sessionSecret
         - expectedLease
         - setLease
        """
        self.send_renewLease(streamId, clientId, sessionSecret, expectedLease, setLease)
        return self.recv_renewLease()

    def send_renewLease(self, streamId, clientId, sessionSecret, expectedLease, setLease):
        self._oprot.writeMessageBegin('renewLease', TMessageType.CALL, self._seqid)
        args = renewLease_args()
        args.streamId = streamId
        args.clientId = clientId
        args.sessionSecret = sessionSecret
        args.expectedLease = expectedLease
        args.setLease = setLease
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_renewLease(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = renewLease_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "renewLease failed: unknown result")

    def getLargestBlockId(self, streamId):
        """
        Parameters:
         - streamId
        """
        self.send_getLargestBlockId(streamId)
        return self.recv_getLargestBlockId()

    def send_getLargestBlockId(self, streamId):
        self._oprot.writeMessageBegin('getLargestBlockId', TMessageType.CALL, self._seqid)
        args = getLargestBlockId_args()
        args.streamId = streamId
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_getLargestBlockId(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = getLargestBlockId_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "getLargestBlockId failed: unknown result")

    def findStream(self, squery):
        """
        Parameters:
         - squery
        """
        self.send_findStream(squery)
        return self.recv_findStream()

    def send_findStream(self, squery):
        self._oprot.writeMessageBegin('findStream', TMessageType.CALL, self._seqid)
        args = findStream_args()
        args.squery = squery
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findStream(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findStream_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findStream failed: unknown result")

    def updateBlock(self, mbId, mbMetadata, mbData):
        """
        Parameters:
         - mbId
         - mbMetadata
         - mbData
        """
        self.send_updateBlock(mbId, mbMetadata, mbData)
        return self.recv_updateBlock()

    def send_updateBlock(self, mbId, mbMetadata, mbData):
        self._oprot.writeMessageBegin('updateBlock', TMessageType.CALL, self._seqid)
        args = updateBlock_args()
        args.mbId = mbId
        args.mbMetadata = mbMetadata
        args.mbData = mbData
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_updateBlock(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = updateBlock_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "updateBlock failed: unknown result")

    def listLocalPartitionMbId(self, flag):
        """
        Parameters:
         - flag
        """
        self.send_listLocalPartitionMbId(flag)
        return self.recv_listLocalPartitionMbId()

    def send_listLocalPartitionMbId(self, flag):
        self._oprot.writeMessageBegin('listLocalPartitionMbId', TMessageType.CALL, self._seqid)
        args = listLocalPartitionMbId_args()
        args.flag = flag
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_listLocalPartitionMbId(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = listLocalPartitionMbId_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "listLocalPartitionMbId failed: unknown result")

    def requestAllNeighbors(self):
        self.send_requestAllNeighbors()
        return self.recv_requestAllNeighbors()

    def send_requestAllNeighbors(self):
        self._oprot.writeMessageBegin('requestAllNeighbors', TMessageType.CALL, self._seqid)
        args = requestAllNeighbors_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestAllNeighbors(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestAllNeighbors_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestAllNeighbors failed: unknown result")

    def requestMbIDLocationMap(self):
        self.send_requestMbIDLocationMap()
        return self.recv_requestMbIDLocationMap()

    def send_requestMbIDLocationMap(self):
        self._oprot.writeMessageBegin('requestMbIDLocationMap', TMessageType.CALL, self._seqid)
        args = requestMbIDLocationMap_args()
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_requestMbIDLocationMap(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = requestMbIDLocationMap_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "requestMbIDLocationMap failed: unknown result")

    def findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        """
        Parameters:
         - metaKeyValueMap
         - checkNeighbors
         - checkBuddies
        """
        self.send_findBlockUsingQuery(metaKeyValueMap, checkNeighbors, checkBuddies)
        return self.recv_findBlockUsingQuery()

    def send_findBlockUsingQuery(self, metaKeyValueMap, checkNeighbors, checkBuddies):
        self._oprot.writeMessageBegin('findBlockUsingQuery', TMessageType.CALL, self._seqid)
        args = findBlockUsingQuery_args()
        args.metaKeyValueMap = metaKeyValueMap
        args.checkNeighbors = checkNeighbors
        args.checkBuddies = checkBuddies
        args.write(self._oprot)
        self._oprot.writeMessageEnd()
        self._oprot.trans.flush()

    def recv_findBlockUsingQuery(self):
        iprot = self._iprot
        (fname, mtype, rseqid) = iprot.readMessageBegin()
        if mtype == TMessageType.EXCEPTION:
            x = TApplicationException()
            x.read(iprot)
            iprot.readMessageEnd()
            raise x
        result = findBlockUsingQuery_result()
        result.read(iprot)
        iprot.readMessageEnd()
        if result.success is not None:
            return result.success
        raise TApplicationException(TApplicationException.MISSING_RESULT, "findBlockUsingQuery failed: unknown result")


class Processor(Iface, TProcessor):
    def __init__(self, handler):
        self._handler = handler
        self._processMap = {}
        self._processMap["joinCluster"] = Processor.process_joinCluster
        self._processMap["joinPool"] = Processor.process_joinPool
        self._processMap["getCandidatePool"] = Processor.process_getCandidatePool
        self._processMap["bootstrapFog"] = Processor.process_bootstrapFog
        self._processMap["initiate2PhasePreCommit"] = Processor.process_initiate2PhasePreCommit
        self._processMap["initiate2PhaseCommit"] = Processor.process_initiate2PhaseCommit
        self._processMap["buddyHeartBeat"] = Processor.process_buddyHeartBeat
        self._processMap["neighborHeartBeat"] = Processor.process_neighborHeartBeat
        self._processMap["getPoolMember"] = Processor.process_getPoolMember
        self._processMap["getBuddyPoolMembers"] = Processor.process_getBuddyPoolMembers
        self._processMap["getNeighborCountPerPool"] = Processor.process_getNeighborCountPerPool
        self._processMap["requestNeighbors"] = Processor.process_requestNeighbors
        self._processMap["nodeJoiningComplete"] = Processor.process_nodeJoiningComplete
        self._processMap["subscribe"] = Processor.process_subscribe
        self._processMap["edgeHeartBeats"] = Processor.process_edgeHeartBeats
        self._processMap["edgeJoin"] = Processor.process_edgeJoin
        self._processMap["edgeLeave"] = Processor.process_edgeLeave
        self._processMap["terminate"] = Processor.process_terminate
        self._processMap["registerStream"] = Processor.process_registerStream
        self._processMap["intentToWrite"] = Processor.process_intentToWrite
        self._processMap["getStreamMetadata"] = Processor.process_getStreamMetadata
        self._processMap["getStreamMetadataFromOwner"] = Processor.process_getStreamMetadataFromOwner
        self._processMap["getWriteLocations"] = Processor.process_getWriteLocations
        self._processMap["write"] = Processor.process_write
        self._processMap["writeNext"] = Processor.process_writeNext
        self._processMap["insertMetadata"] = Processor.process_insertMetadata
        self._processMap["findNext"] = Processor.process_findNext
        self._processMap["find"] = Processor.process_find
        self._processMap["read"] = Processor.process_read
        self._processMap["findUsingQuery"] = Processor.process_findUsingQuery
        self._processMap["getMeta"] = Processor.process_getMeta
        self._processMap["serializeState"] = Processor.process_serializeState
        self._processMap["updateStreamMetadata"] = Processor.process_updateStreamMetadata
        self._processMap["open"] = Processor.process_open
        self._processMap["putNext"] = Processor.process_putNext
        self._processMap["incrementBlockCount"] = Processor.process_incrementBlockCount
        self._processMap["renewLease"] = Processor.process_renewLease
        self._processMap["getLargestBlockId"] = Processor.process_getLargestBlockId
        self._processMap["findStream"] = Processor.process_findStream
        self._processMap["updateBlock"] = Processor.process_updateBlock
        self._processMap["listLocalPartitionMbId"] = Processor.process_listLocalPartitionMbId
        self._processMap["requestAllNeighbors"] = Processor.process_requestAllNeighbors
        self._processMap["requestMbIDLocationMap"] = Processor.process_requestMbIDLocationMap
        self._processMap["findBlockUsingQuery"] = Processor.process_findBlockUsingQuery

    def process(self, iprot, oprot):
        (name, type, seqid) = iprot.readMessageBegin()
        if name not in self._processMap:
            iprot.skip(TType.STRUCT)
            iprot.readMessageEnd()
            x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
            oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
            x.write(oprot)
            oprot.writeMessageEnd()
            oprot.trans.flush()
            return
        else:
            self._processMap[name](self, seqid, iprot, oprot)
        return True

    def process_joinCluster(self, seqid, iprot, oprot):
        args = joinCluster_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = joinCluster_result()
        try:
            result.success = self._handler.joinCluster(args.NodeX, args.pmin, args.pmax)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("joinCluster", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_joinPool(self, seqid, iprot, oprot):
        args = joinPool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = joinPool_result()
        try:
            result.success = self._handler.joinPool(args.NodeX)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("joinPool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getCandidatePool(self, seqid, iprot, oprot):
        args = getCandidatePool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getCandidatePool_result()
        try:
            result.success = self._handler.getCandidatePool(args.reliability, args.pmin)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getCandidatePool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_bootstrapFog(self, seqid, iprot, oprot):
        args = bootstrapFog_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = bootstrapFog_result()
        try:
            result.success = self._handler.bootstrapFog(args.NodeX)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("bootstrapFog", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_initiate2PhasePreCommit(self, seqid, iprot, oprot):
        args = initiate2PhasePreCommit_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = initiate2PhasePreCommit_result()
        try:
            result.success = self._handler.initiate2PhasePreCommit(args.preCommitRequest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("initiate2PhasePreCommit", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_initiate2PhaseCommit(self, seqid, iprot, oprot):
        args = initiate2PhaseCommit_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = initiate2PhaseCommit_result()
        try:
            result.success = self._handler.initiate2PhaseCommit(args.commitRequest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("initiate2PhaseCommit", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_buddyHeartBeat(self, seqid, iprot, oprot):
        args = buddyHeartBeat_args()
        args.read(iprot)
        iprot.readMessageEnd()
        try:
            self._handler.buddyHeartBeat(args.payload)
        except TTransport.TTransportException:
            raise
        except Exception:
            logging.exception('Exception in oneway handler')

    def process_neighborHeartBeat(self, seqid, iprot, oprot):
        args = neighborHeartBeat_args()
        args.read(iprot)
        iprot.readMessageEnd()
        try:
            self._handler.neighborHeartBeat(args.payload)
        except TTransport.TTransportException:
            raise
        except Exception:
            logging.exception('Exception in oneway handler')

    def process_getPoolMember(self, seqid, iprot, oprot):
        args = getPoolMember_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getPoolMember_result()
        try:
            result.success = self._handler.getPoolMember(args.buddyPoolId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getPoolMember", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getBuddyPoolMembers(self, seqid, iprot, oprot):
        args = getBuddyPoolMembers_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getBuddyPoolMembers_result()
        try:
            result.success = self._handler.getBuddyPoolMembers()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getBuddyPoolMembers", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getNeighborCountPerPool(self, seqid, iprot, oprot):
        args = getNeighborCountPerPool_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getNeighborCountPerPool_result()
        try:
            result.success = self._handler.getNeighborCountPerPool()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getNeighborCountPerPool", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestNeighbors(self, seqid, iprot, oprot):
        args = requestNeighbors_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestNeighbors_result()
        try:
            result.success = self._handler.requestNeighbors(args.requestMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestNeighbors", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_nodeJoiningComplete(self, seqid, iprot, oprot):
        args = nodeJoiningComplete_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = nodeJoiningComplete_result()
        try:
            self._handler.nodeJoiningComplete()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("nodeJoiningComplete", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_subscribe(self, seqid, iprot, oprot):
        args = subscribe_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = subscribe_result()
        try:
            result.success = self._handler.subscribe(args.nodeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("subscribe", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeHeartBeats(self, seqid, iprot, oprot):
        args = edgeHeartBeats_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeHeartBeats_result()
        try:
            result.success = self._handler.edgeHeartBeats(args.edgePayload)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeHeartBeats", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeJoin(self, seqid, iprot, oprot):
        args = edgeJoin_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeJoin_result()
        try:
            result.success = self._handler.edgeJoin(args.edgeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeJoin", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_edgeLeave(self, seqid, iprot, oprot):
        args = edgeLeave_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = edgeLeave_result()
        try:
            result.success = self._handler.edgeLeave(args.edgeInfoData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("edgeLeave", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_terminate(self, seqid, iprot, oprot):
        args = terminate_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = terminate_result()
        try:
            result.success = self._handler.terminate(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("terminate", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_registerStream(self, seqid, iprot, oprot):
        args = registerStream_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = registerStream_result()
        try:
            result.success = self._handler.registerStream(args.streamId, args.streamMetadata, args.startSequenceNumber)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("registerStream", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_intentToWrite(self, seqid, iprot, oprot):
        args = intentToWrite_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = intentToWrite_result()
        try:
            result.success = self._handler.intentToWrite(args.clientId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("intentToWrite", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getStreamMetadata(self, seqid, iprot, oprot):
        args = getStreamMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getStreamMetadata_result()
        try:
            result.success = self._handler.getStreamMetadata(args.streamId, args.checkNeighbors, args.checkBuddies, args.forceLatest)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getStreamMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getStreamMetadataFromOwner(self, seqid, iprot, oprot):
        args = getStreamMetadataFromOwner_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getStreamMetadataFromOwner_result()
        try:
            result.success = self._handler.getStreamMetadataFromOwner(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getStreamMetadataFromOwner", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getWriteLocations(self, seqid, iprot, oprot):
        args = getWriteLocations_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getWriteLocations_result()
        try:
            result.success = self._handler.getWriteLocations(args.dataLength, args.metadata, args.blackListedFogs, args.isEdge)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getWriteLocations", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_write(self, seqid, iprot, oprot):
        args = write_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = write_result()
        try:
            result.success = self._handler.write(args.mbMetadata, args.data, args.preference)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("write", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_writeNext(self, seqid, iprot, oprot):
        args = writeNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = writeNext_result()
        try:
            result.success = self._handler.writeNext(args.sessionId, args.mbData, args.dataLength)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("writeNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_insertMetadata(self, seqid, iprot, oprot):
        args = insertMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = insertMetadata_result()
        try:
            result.success = self._handler.insertMetadata(args.mbMetadata, args.edgeInfoData, args.metaKeyValueMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("insertMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findNext(self, seqid, iprot, oprot):
        args = findNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findNext_result()
        try:
            result.success = self._handler.findNext(args.microbatchId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_find(self, seqid, iprot, oprot):
        args = find_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = find_result()
        try:
            result.success = self._handler.find(args.microbatchId, args.checkNeighbors, args.checkBuddies, args.selfInfo)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("find", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_read(self, seqid, iprot, oprot):
        args = read_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = read_result()
        try:
            result.success = self._handler.read(args.microbatchId, args.fetchMetadata)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("read", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findUsingQuery(self, seqid, iprot, oprot):
        args = findUsingQuery_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findUsingQuery_result()
        try:
            result.success = self._handler.findUsingQuery(args.metadataKey, args.metadataValue, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findUsingQuery", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getMeta(self, seqid, iprot, oprot):
        args = getMeta_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getMeta_result()
        try:
            result.success = self._handler.getMeta(args.microbatchId, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getMeta", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_serializeState(self, seqid, iprot, oprot):
        args = serializeState_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = serializeState_result()
        try:
            result.success = self._handler.serializeState()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("serializeState", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_updateStreamMetadata(self, seqid, iprot, oprot):
        args = updateStreamMetadata_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = updateStreamMetadata_result()
        try:
            result.success = self._handler.updateStreamMetadata(args.metadata)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("updateStreamMetadata", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_open(self, seqid, iprot, oprot):
        args = open_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = open_result()
        try:
            result.success = self._handler.open(args.streamId, args.clientId, args.expectedLease, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("open", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_putNext(self, seqid, iprot, oprot):
        args = putNext_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = putNext_result()
        try:
            result.success = self._handler.putNext(args.mbMetadata, args.data, args.preference, args.metaKeyValueMap)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("putNext", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_incrementBlockCount(self, seqid, iprot, oprot):
        args = incrementBlockCount_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = incrementBlockCount_result()
        try:
            result.success = self._handler.incrementBlockCount(args.mbMetadata, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("incrementBlockCount", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_renewLease(self, seqid, iprot, oprot):
        args = renewLease_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = renewLease_result()
        try:
            result.success = self._handler.renewLease(args.streamId, args.clientId, args.sessionSecret, args.expectedLease, args.setLease)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("renewLease", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_getLargestBlockId(self, seqid, iprot, oprot):
        args = getLargestBlockId_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getLargestBlockId_result()
        try:
            result.success = self._handler.getLargestBlockId(args.streamId)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getLargestBlockId", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findStream(self, seqid, iprot, oprot):
        args = findStream_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findStream_result()
        try:
            result.success = self._handler.findStream(args.squery)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findStream", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_updateBlock(self, seqid, iprot, oprot):
        args = updateBlock_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = updateBlock_result()
        try:
            result.success = self._handler.updateBlock(args.mbId, args.mbMetadata, args.mbData)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("updateBlock", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_listLocalPartitionMbId(self, seqid, iprot, oprot):
        args = listLocalPartitionMbId_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = listLocalPartitionMbId_result()
        try:
            result.success = self._handler.listLocalPartitionMbId(args.flag)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("listLocalPartitionMbId", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestAllNeighbors(self, seqid, iprot, oprot):
        args = requestAllNeighbors_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestAllNeighbors_result()
        try:
            result.success = self._handler.requestAllNeighbors()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestAllNeighbors", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_requestMbIDLocationMap(self, seqid, iprot, oprot):
        args = requestMbIDLocationMap_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestMbIDLocationMap_result()
        try:
            result.success = self._handler.requestMbIDLocationMap()
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("requestMbIDLocationMap", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

    def process_findBlockUsingQuery(self, seqid, iprot, oprot):
        args = findBlockUsingQuery_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = findBlockUsingQuery_result()
        try:
            result.success = self._handler.findBlockUsingQuery(args.metaKeyValueMap, args.checkNeighbors, args.checkBuddies)
            msg_type = TMessageType.REPLY
        except TTransport.TTransportException:
            raise
        except TApplicationException as ex:
            logging.exception('TApplication exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = ex
        except Exception:
            logging.exception('Unexpected exception in handler')
            msg_type = TMessageType.EXCEPTION
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("findBlockUsingQuery", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES


class joinCluster_args(object):
    """
    Attributes:
     - NodeX
     - pmin
     - pmax
    """


    def __init__(self, NodeX=None, pmin=None, pmax=None,):
        self.NodeX = NodeX
        self.pmin = pmin
        self.pmax = pmax

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.pmin = iprot.readI16()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I16:
                    self.pmax = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinCluster_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        if self.pmin is not None:
            oprot.writeFieldBegin('pmin', TType.I16, 2)
            oprot.writeI16(self.pmin)
            oprot.writeFieldEnd()
        if self.pmax is not None:
            oprot.writeFieldBegin('pmax', TType.I16, 3)
            oprot.writeI16(self.pmax)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinCluster_args)
joinCluster_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
    (2, TType.I16, 'pmin', None, None, ),  # 2
    (3, TType.I16, 'pmax', None, None, ),  # 3
)


class joinCluster_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype85, _size82) = iprot.readListBegin()
                    for _i86 in range(_size82):
                        _elem87 = NeighborInfoData()
                        _elem87.read(iprot)
                        self.success.append(_elem87)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinCluster_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter88 in self.success:
                iter88.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinCluster_result)
joinCluster_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class joinPool_args(object):
    """
    Attributes:
     - NodeX
    """


    def __init__(self, NodeX=None,):
        self.NodeX = NodeX

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinPool_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinPool_args)
joinPool_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
)


class joinPool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhaseCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('joinPool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(joinPool_result)
joinPool_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhaseCommitResponse, None], None, ),  # 0
)


class getCandidatePool_args(object):
    """
    Attributes:
     - reliability
     - pmin
    """


    def __init__(self, reliability=None, pmin=None,):
        self.reliability = reliability
        self.pmin = pmin

    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.DOUBLE:
                    self.reliability = iprot.readDouble()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.I16:
                    self.pmin = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getCandidatePool_args')
        if self.reliability is not None:
            oprot.writeFieldBegin('reliability', TType.DOUBLE, 1)
            oprot.writeDouble(self.reliability)
            oprot.writeFieldEnd()
        if self.pmin is not None:
            oprot.writeFieldBegin('pmin', TType.I16, 2)
            oprot.writeI16(self.pmin)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getCandidatePool_args)
getCandidatePool_args.thrift_spec = (
    None,  # 0
    (1, TType.DOUBLE, 'reliability', None, None, ),  # 1
    (2, TType.I16, 'pmin', None, None, ),  # 2
)


class getCandidatePool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype92, _size89) = iprot.readListBegin()
                    for _i93 in range(_size89):
                        _elem94 = NeighborInfoData()
                        _elem94.read(iprot)
                        self.success.append(_elem94)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getCandidatePool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter95 in self.success:
                iter95.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getCandidatePool_result)
getCandidatePool_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class bootstrapFog_args(object):
    """
    Attributes:
     - NodeX
    """


    def __init__(self, NodeX=None,):
        self.NodeX = NodeX

    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.NodeX = FogInfoData()
                    self.NodeX.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('bootstrapFog_args')
        if self.NodeX is not None:
            oprot.writeFieldBegin('NodeX', TType.STRUCT, 1)
            self.NodeX.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(bootstrapFog_args)
bootstrapFog_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'NodeX', [FogInfoData, None], None, ),  # 1
)


class bootstrapFog_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('bootstrapFog_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(bootstrapFog_result)
bootstrapFog_result.thrift_spec = (
    (0, TType.STRING, 'success', 'UTF8', None, ),  # 0
)


class initiate2PhasePreCommit_args(object):
    """
    Attributes:
     - preCommitRequest
    """


    def __init__(self, preCommitRequest=None,):
        self.preCommitRequest = preCommitRequest

    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.preCommitRequest = TwoPhasePreCommitRequest()
                    self.preCommitRequest.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhasePreCommit_args')
        if self.preCommitRequest is not None:
            oprot.writeFieldBegin('preCommitRequest', TType.STRUCT, 1)
            self.preCommitRequest.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhasePreCommit_args)
initiate2PhasePreCommit_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'preCommitRequest', [TwoPhasePreCommitRequest, None], None, ),  # 1
)


class initiate2PhasePreCommit_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhasePreCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhasePreCommit_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhasePreCommit_result)
initiate2PhasePreCommit_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhasePreCommitResponse, None], None, ),  # 0
)


class initiate2PhaseCommit_args(object):
    """
    Attributes:
     - commitRequest
    """


    def __init__(self, commitRequest=None,):
        self.commitRequest = commitRequest

    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.commitRequest = TwoPhaseCommitRequest()
                    self.commitRequest.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhaseCommit_args')
        if self.commitRequest is not None:
            oprot.writeFieldBegin('commitRequest', TType.STRUCT, 1)
            self.commitRequest.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhaseCommit_args)
initiate2PhaseCommit_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'commitRequest', [TwoPhaseCommitRequest, None], None, ),  # 1
)


class initiate2PhaseCommit_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = TwoPhaseCommitResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('initiate2PhaseCommit_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(initiate2PhaseCommit_result)
initiate2PhaseCommit_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [TwoPhaseCommitResponse, None], None, ),  # 0
)


class buddyHeartBeat_args(object):
    """
    Attributes:
     - payload
    """


    def __init__(self, payload=None,):
        self.payload = payload

    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.payload = BuddyPayload()
                    self.payload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('buddyHeartBeat_args')
        if self.payload is not None:
            oprot.writeFieldBegin('payload', TType.STRUCT, 1)
            self.payload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(buddyHeartBeat_args)
buddyHeartBeat_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'payload', [BuddyPayload, None], None, ),  # 1
)


class neighborHeartBeat_args(object):
    """
    Attributes:
     - payload
    """


    def __init__(self, payload=None,):
        self.payload = payload

    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.payload = NeighborPayload()
                    self.payload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('neighborHeartBeat_args')
        if self.payload is not None:
            oprot.writeFieldBegin('payload', TType.STRUCT, 1)
            self.payload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(neighborHeartBeat_args)
neighborHeartBeat_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'payload', [NeighborPayload, None], None, ),  # 1
)


class getPoolMember_args(object):
    """
    Attributes:
     - buddyPoolId
    """


    def __init__(self, buddyPoolId=None,):
        self.buddyPoolId = buddyPoolId

    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.I16:
                    self.buddyPoolId = iprot.readI16()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getPoolMember_args')
        if self.buddyPoolId is not None:
            oprot.writeFieldBegin('buddyPoolId', TType.I16, 1)
            oprot.writeI16(self.buddyPoolId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getPoolMember_args)
getPoolMember_args.thrift_spec = (
    None,  # 0
    (1, TType.I16, 'buddyPoolId', None, None, ),  # 1
)


class getPoolMember_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = NodeInfoData()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getPoolMember_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getPoolMember_result)
getPoolMember_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [NodeInfoData, None], None, ),  # 0
)


class getBuddyPoolMembers_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getBuddyPoolMembers_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getBuddyPoolMembers_args)
getBuddyPoolMembers_args.thrift_spec = (
)


class getBuddyPoolMembers_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype99, _size96) = iprot.readListBegin()
                    for _i100 in range(_size96):
                        _elem101 = FogInfoData()
                        _elem101.read(iprot)
                        self.success.append(_elem101)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getBuddyPoolMembers_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter102 in self.success:
                iter102.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getBuddyPoolMembers_result)
getBuddyPoolMembers_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [FogInfoData, None], False), None, ),  # 0
)


class getNeighborCountPerPool_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getNeighborCountPerPool_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getNeighborCountPerPool_args)
getNeighborCountPerPool_args.thrift_spec = (
)


class getNeighborCountPerPool_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = NeighborCount()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getNeighborCountPerPool_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getNeighborCountPerPool_result)
getNeighborCountPerPool_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [NeighborCount, None], None, ),  # 0
)


class requestNeighbors_args(object):
    """
    Attributes:
     - requestMap
    """


    def __init__(self, requestMap=None,):
        self.requestMap = requestMap

    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.MAP:
                    self.requestMap = {}
                    (_ktype104, _vtype105, _size103) = iprot.readMapBegin()
                    for _i107 in range(_size103):
                        _key108 = iprot.readI16()
                        _val109 = iprot.readI16()
                        self.requestMap[_key108] = _val109
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestNeighbors_args')
        if self.requestMap is not None:
            oprot.writeFieldBegin('requestMap', TType.MAP, 1)
            oprot.writeMapBegin(TType.I16, TType.I16, len(self.requestMap))
            for kiter110, viter111 in self.requestMap.items():
                oprot.writeI16(kiter110)
                oprot.writeI16(viter111)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestNeighbors_args)
requestNeighbors_args.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'requestMap', (TType.I16, None, TType.I16, None, False), None, ),  # 1
)


class requestNeighbors_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype115, _size112) = iprot.readListBegin()
                    for _i116 in range(_size112):
                        _elem117 = NeighborInfoData()
                        _elem117.read(iprot)
                        self.success.append(_elem117)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestNeighbors_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter118 in self.success:
                iter118.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestNeighbors_result)
requestNeighbors_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class nodeJoiningComplete_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('nodeJoiningComplete_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(nodeJoiningComplete_args)
nodeJoiningComplete_args.thrift_spec = (
)


class nodeJoiningComplete_result(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('nodeJoiningComplete_result')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(nodeJoiningComplete_result)
nodeJoiningComplete_result.thrift_spec = (
)


class subscribe_args(object):
    """
    Attributes:
     - nodeInfoData
    """


    def __init__(self, nodeInfoData=None,):
        self.nodeInfoData = nodeInfoData

    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.nodeInfoData = NodeInfoData()
                    self.nodeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('subscribe_args')
        if self.nodeInfoData is not None:
            oprot.writeFieldBegin('nodeInfoData', TType.STRUCT, 1)
            self.nodeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(subscribe_args)
subscribe_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'nodeInfoData', [NodeInfoData, None], None, ),  # 1
)


class subscribe_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('subscribe_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(subscribe_result)
subscribe_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
)


class edgeHeartBeats_args(object):
    """
    Attributes:
     - edgePayload
    """


    def __init__(self, edgePayload=None,):
        self.edgePayload = edgePayload

    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.edgePayload = EdgePayload()
                    self.edgePayload.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeHeartBeats_args')
        if self.edgePayload is not None:
            oprot.writeFieldBegin('edgePayload', TType.STRUCT, 1)
            self.edgePayload.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeHeartBeats_args)
edgeHeartBeats_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgePayload', [EdgePayload, None], None, ),  # 1
)


class edgeHeartBeats_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BOOL:
                    self.success = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeHeartBeats_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BOOL, 0)
            oprot.writeBool(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeHeartBeats_result)
edgeHeartBeats_result.thrift_spec = (
    (0, TType.BOOL, 'success', None, None, ),  # 0
)


class edgeJoin_args(object):
    """
    Attributes:
     - edgeInfoData
    """


    def __init__(self, edgeInfoData=None,):
        self.edgeInfoData = edgeInfoData

    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.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeJoin_args')
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 1)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeJoin_args)
edgeJoin_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 1
)


class edgeJoin_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeJoin_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeJoin_result)
edgeJoin_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class edgeLeave_args(object):
    """
    Attributes:
     - edgeInfoData
    """


    def __init__(self, edgeInfoData=None,):
        self.edgeInfoData = edgeInfoData

    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.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeLeave_args')
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 1)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeLeave_args)
edgeLeave_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 1
)


class edgeLeave_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('edgeLeave_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(edgeLeave_result)
edgeLeave_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class terminate_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('terminate_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(terminate_args)
terminate_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class terminate_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('terminate_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(terminate_result)
terminate_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class registerStream_args(object):
    """
    Attributes:
     - streamId
     - streamMetadata
     - startSequenceNumber
    """


    def __init__(self, streamId=None, streamMetadata=None, startSequenceNumber=None,):
        self.streamId = streamId
        self.streamMetadata = streamMetadata
        self.startSequenceNumber = startSequenceNumber

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.streamMetadata = StreamMetadata()
                    self.streamMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I64:
                    self.startSequenceNumber = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('registerStream_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.streamMetadata is not None:
            oprot.writeFieldBegin('streamMetadata', TType.STRUCT, 2)
            self.streamMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.startSequenceNumber is not None:
            oprot.writeFieldBegin('startSequenceNumber', TType.I64, 3)
            oprot.writeI64(self.startSequenceNumber)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(registerStream_args)
registerStream_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRUCT, 'streamMetadata', [StreamMetadata, None], None, ),  # 2
    (3, TType.I64, 'startSequenceNumber', None, None, ),  # 3
)


class registerStream_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('registerStream_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(registerStream_result)
registerStream_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class intentToWrite_args(object):
    """
    Attributes:
     - clientId
    """


    def __init__(self, clientId=None,):
        self.clientId = clientId

    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.BYTE:
                    self.clientId = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('intentToWrite_args')
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.BYTE, 1)
            oprot.writeByte(self.clientId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(intentToWrite_args)
intentToWrite_args.thrift_spec = (
    None,  # 0
    (1, TType.BYTE, 'clientId', None, None, ),  # 1
)


class intentToWrite_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('intentToWrite_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(intentToWrite_result)
intentToWrite_result.thrift_spec = (
    (0, TType.STRING, 'success', 'UTF8', None, ),  # 0
)


class getStreamMetadata_args(object):
    """
    Attributes:
     - streamId
     - checkNeighbors
     - checkBuddies
     - forceLatest
    """


    def __init__(self, streamId=None, checkNeighbors=None, checkBuddies=None, forceLatest=None,):
        self.streamId = streamId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies
        self.forceLatest = forceLatest

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.forceLatest = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadata_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        if self.forceLatest is not None:
            oprot.writeFieldBegin('forceLatest', TType.BOOL, 4)
            oprot.writeBool(self.forceLatest)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadata_args)
getStreamMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
    (4, TType.BOOL, 'forceLatest', None, None, ),  # 4
)


class getStreamMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadataInfo()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadata_result)
getStreamMetadata_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadataInfo, None], None, ),  # 0
)


class getStreamMetadataFromOwner_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadataFromOwner_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadataFromOwner_args)
getStreamMetadataFromOwner_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class getStreamMetadataFromOwner_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadata()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getStreamMetadataFromOwner_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getStreamMetadataFromOwner_result)
getStreamMetadataFromOwner_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadata, None], None, ),  # 0
)


class getWriteLocations_args(object):
    """
    Attributes:
     - dataLength
     - metadata
     - blackListedFogs
     - isEdge
    """


    def __init__(self, dataLength=None, metadata=None, blackListedFogs=None, isEdge=None,):
        self.dataLength = dataLength
        self.metadata = metadata
        self.blackListedFogs = blackListedFogs
        self.isEdge = isEdge

    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.BYTE:
                    self.dataLength = iprot.readByte()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.metadata = Metadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.LIST:
                    self.blackListedFogs = []
                    (_etype122, _size119) = iprot.readListBegin()
                    for _i123 in range(_size119):
                        _elem124 = iprot.readI16()
                        self.blackListedFogs.append(_elem124)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.isEdge = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getWriteLocations_args')
        if self.dataLength is not None:
            oprot.writeFieldBegin('dataLength', TType.BYTE, 1)
            oprot.writeByte(self.dataLength)
            oprot.writeFieldEnd()
        if self.metadata is not None:
            oprot.writeFieldBegin('metadata', TType.STRUCT, 2)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        if self.blackListedFogs is not None:
            oprot.writeFieldBegin('blackListedFogs', TType.LIST, 3)
            oprot.writeListBegin(TType.I16, len(self.blackListedFogs))
            for iter125 in self.blackListedFogs:
                oprot.writeI16(iter125)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        if self.isEdge is not None:
            oprot.writeFieldBegin('isEdge', TType.BOOL, 4)
            oprot.writeBool(self.isEdge)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getWriteLocations_args)
getWriteLocations_args.thrift_spec = (
    None,  # 0
    (1, TType.BYTE, 'dataLength', None, None, ),  # 1
    (2, TType.STRUCT, 'metadata', [Metadata, None], None, ),  # 2
    (3, TType.LIST, 'blackListedFogs', (TType.I16, None, False), None, ),  # 3
    (4, TType.BOOL, 'isEdge', None, None, ),  # 4
)


class getWriteLocations_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype129, _size126) = iprot.readListBegin()
                    for _i130 in range(_size126):
                        _elem131 = WritableFogData()
                        _elem131.read(iprot)
                        self.success.append(_elem131)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getWriteLocations_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter132 in self.success:
                iter132.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getWriteLocations_result)
getWriteLocations_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [WritableFogData, None], False), None, ),  # 0
)


class write_args(object):
    """
    Attributes:
     - mbMetadata
     - data
     - preference
    """


    def __init__(self, mbMetadata=None, data=None, preference=None,):
        self.mbMetadata = mbMetadata
        self.data = data
        self.preference = preference

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.data = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.preference = iprot.readI32()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('write_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.data is not None:
            oprot.writeFieldBegin('data', TType.STRING, 2)
            oprot.writeBinary(self.data)
            oprot.writeFieldEnd()
        if self.preference is not None:
            oprot.writeFieldBegin('preference', TType.I32, 3)
            oprot.writeI32(self.preference)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(write_args)
write_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRING, 'data', 'BINARY', None, ),  # 2
    (3, TType.I32, 'preference', None, None, ),  # 3
)


class write_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('write_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(write_result)
write_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class writeNext_args(object):
    """
    Attributes:
     - sessionId
     - mbData
     - dataLength
    """


    def __init__(self, sessionId=None, mbData=None, dataLength=None,):
        self.sessionId = sessionId
        self.mbData = mbData
        self.dataLength = dataLength

    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.sessionId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.mbData = Metadata()
                    self.mbData.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BYTE:
                    self.dataLength = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('writeNext_args')
        if self.sessionId is not None:
            oprot.writeFieldBegin('sessionId', TType.STRING, 1)
            oprot.writeString(self.sessionId.encode('utf-8') if sys.version_info[0] == 2 else self.sessionId)
            oprot.writeFieldEnd()
        if self.mbData is not None:
            oprot.writeFieldBegin('mbData', TType.STRUCT, 2)
            self.mbData.write(oprot)
            oprot.writeFieldEnd()
        if self.dataLength is not None:
            oprot.writeFieldBegin('dataLength', TType.BYTE, 3)
            oprot.writeByte(self.dataLength)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(writeNext_args)
writeNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'sessionId', 'UTF8', None, ),  # 1
    (2, TType.STRUCT, 'mbData', [Metadata, None], None, ),  # 2
    (3, TType.BYTE, 'dataLength', None, None, ),  # 3
)


class writeNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype136, _size133) = iprot.readListBegin()
                    for _i137 in range(_size133):
                        _elem138 = NodeInfoData()
                        _elem138.read(iprot)
                        self.success.append(_elem138)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('writeNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter139 in self.success:
                iter139.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(writeNext_result)
writeNext_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NodeInfoData, None], False), None, ),  # 0
)


class insertMetadata_args(object):
    """
    Attributes:
     - mbMetadata
     - edgeInfoData
     - metaKeyValueMap
    """


    def __init__(self, mbMetadata=None, edgeInfoData=None, metaKeyValueMap=None,):
        self.mbMetadata = mbMetadata
        self.edgeInfoData = edgeInfoData
        self.metaKeyValueMap = metaKeyValueMap

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.edgeInfoData = EdgeInfoData()
                    self.edgeInfoData.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype141, _vtype142, _size140) = iprot.readMapBegin()
                    for _i144 in range(_size140):
                        _key145 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val146 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key145] = _val146
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('insertMetadata_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.edgeInfoData is not None:
            oprot.writeFieldBegin('edgeInfoData', TType.STRUCT, 2)
            self.edgeInfoData.write(oprot)
            oprot.writeFieldEnd()
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 3)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter147, viter148 in self.metaKeyValueMap.items():
                oprot.writeString(kiter147.encode('utf-8') if sys.version_info[0] == 2 else kiter147)
                oprot.writeString(viter148.encode('utf-8') if sys.version_info[0] == 2 else viter148)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(insertMetadata_args)
insertMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRUCT, 'edgeInfoData', [EdgeInfoData, None], None, ),  # 2
    (3, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 3
)


class insertMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('insertMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(insertMetadata_result)
insertMetadata_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class findNext_args(object):
    """
    Attributes:
     - microbatchId
    """


    def __init__(self, microbatchId=None,):
        self.microbatchId = microbatchId

    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.microbatchId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findNext_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.STRING, 1)
            oprot.writeString(self.microbatchId.encode('utf-8') if sys.version_info[0] == 2 else self.microbatchId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findNext_args)
findNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'microbatchId', 'UTF8', None, ),  # 1
)


class findNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRING:
                    self.success = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRING, 0)
            oprot.writeBinary(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findNext_result)
findNext_result.thrift_spec = (
    (0, TType.STRING, 'success', 'BINARY', None, ),  # 0
)


class find_args(object):
    """
    Attributes:
     - microbatchId
     - checkNeighbors
     - checkBuddies
     - selfInfo
    """


    def __init__(self, microbatchId=None, checkNeighbors=None, checkBuddies=None, selfInfo=None,):
        self.microbatchId = microbatchId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies
        self.selfInfo = selfInfo

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.STRUCT:
                    self.selfInfo = EdgeInfoData()
                    self.selfInfo.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('find_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        if self.selfInfo is not None:
            oprot.writeFieldBegin('selfInfo', TType.STRUCT, 4)
            self.selfInfo.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(find_args)
find_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
    (4, TType.STRUCT, 'selfInfo', [EdgeInfoData, None], None, ),  # 4
)


class find_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype152, _size149) = iprot.readListBegin()
                    for _i153 in range(_size149):
                        _elem154 = FindReplica()
                        _elem154.read(iprot)
                        self.success.append(_elem154)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('find_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter155 in self.success:
                iter155.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(find_result)
find_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [FindReplica, None], False), None, ),  # 0
)


class read_args(object):
    """
    Attributes:
     - microbatchId
     - fetchMetadata
    """


    def __init__(self, microbatchId=None, fetchMetadata=None,):
        self.microbatchId = microbatchId
        self.fetchMetadata = fetchMetadata

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.fetchMetadata = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('read_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.fetchMetadata is not None:
            oprot.writeFieldBegin('fetchMetadata', TType.BOOL, 2)
            oprot.writeBool(self.fetchMetadata)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(read_args)
read_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'fetchMetadata', None, None, ),  # 2
)


class read_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = ReadReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('read_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(read_result)
read_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [ReadReplica, None], None, ),  # 0
)


class findUsingQuery_args(object):
    """
    Attributes:
     - metadataKey
     - metadataValue
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, metadataKey=None, metadataValue=None, checkNeighbors=None, checkBuddies=None,):
        self.metadataKey = metadataKey
        self.metadataValue = metadataValue
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.metadataKey = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.metadataValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findUsingQuery_args')
        if self.metadataKey is not None:
            oprot.writeFieldBegin('metadataKey', TType.STRING, 1)
            oprot.writeString(self.metadataKey.encode('utf-8') if sys.version_info[0] == 2 else self.metadataKey)
            oprot.writeFieldEnd()
        if self.metadataValue is not None:
            oprot.writeFieldBegin('metadataValue', TType.STRING, 2)
            oprot.writeString(self.metadataValue.encode('utf-8') if sys.version_info[0] == 2 else self.metadataValue)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 3)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 4)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findUsingQuery_args)
findUsingQuery_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'metadataKey', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'metadataValue', 'UTF8', None, ),  # 2
    (3, TType.BOOL, 'checkNeighbors', None, None, ),  # 3
    (4, TType.BOOL, 'checkBuddies', None, None, ),  # 4
)


class findUsingQuery_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = QueryReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findUsingQuery_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findUsingQuery_result)
findUsingQuery_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [QueryReplica, None], None, ),  # 0
)


class getMeta_args(object):
    """
    Attributes:
     - microbatchId
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, microbatchId=None, checkNeighbors=None, checkBuddies=None,):
        self.microbatchId = microbatchId
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.I64:
                    self.microbatchId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getMeta_args')
        if self.microbatchId is not None:
            oprot.writeFieldBegin('microbatchId', TType.I64, 1)
            oprot.writeI64(self.microbatchId)
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getMeta_args)
getMeta_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'microbatchId', None, None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
)


class getMeta_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = ReadReplica()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getMeta_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getMeta_result)
getMeta_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [ReadReplica, None], None, ),  # 0
)


class serializeState_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('serializeState_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(serializeState_args)
serializeState_args.thrift_spec = (
)


class serializeState_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.BYTE:
                    self.success = iprot.readByte()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('serializeState_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.BYTE, 0)
            oprot.writeByte(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(serializeState_result)
serializeState_result.thrift_spec = (
    (0, TType.BYTE, 'success', None, None, ),  # 0
)


class updateStreamMetadata_args(object):
    """
    Attributes:
     - metadata
    """


    def __init__(self, metadata=None,):
        self.metadata = metadata

    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.metadata = StreamMetadata()
                    self.metadata.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateStreamMetadata_args')
        if self.metadata is not None:
            oprot.writeFieldBegin('metadata', TType.STRUCT, 1)
            self.metadata.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateStreamMetadata_args)
updateStreamMetadata_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'metadata', [StreamMetadata, None], None, ),  # 1
)


class updateStreamMetadata_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamMetadataUpdateResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateStreamMetadata_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateStreamMetadata_result)
updateStreamMetadata_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamMetadataUpdateResponse, None], None, ),  # 0
)


class open_args(object):
    """
    Attributes:
     - streamId
     - clientId
     - expectedLease
     - setLease
    """


    def __init__(self, streamId=None, clientId=None, expectedLease=None, setLease=None,):
        self.streamId = streamId
        self.clientId = clientId
        self.expectedLease = expectedLease
        self.setLease = setLease

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.expectedLease = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('open_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.expectedLease is not None:
            oprot.writeFieldBegin('expectedLease', TType.I32, 3)
            oprot.writeI32(self.expectedLease)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 4)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(open_args)
open_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
    (3, TType.I32, 'expectedLease', None, None, ),  # 3
    (4, TType.BOOL, 'setLease', None, None, ),  # 4
)


class open_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = OpenStreamResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('open_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(open_result)
open_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [OpenStreamResponse, None], None, ),  # 0
)


class putNext_args(object):
    """
    Attributes:
     - mbMetadata
     - data
     - preference
     - metaKeyValueMap
    """


    def __init__(self, mbMetadata=None, data=None, preference=None, metaKeyValueMap=None,):
        self.mbMetadata = mbMetadata
        self.data = data
        self.preference = preference
        self.metaKeyValueMap = metaKeyValueMap

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.data = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.I32:
                    self.preference = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype157, _vtype158, _size156) = iprot.readMapBegin()
                    for _i160 in range(_size156):
                        _key161 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val162 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key161] = _val162
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('putNext_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.data is not None:
            oprot.writeFieldBegin('data', TType.STRING, 2)
            oprot.writeBinary(self.data)
            oprot.writeFieldEnd()
        if self.preference is not None:
            oprot.writeFieldBegin('preference', TType.I32, 3)
            oprot.writeI32(self.preference)
            oprot.writeFieldEnd()
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 4)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter163, viter164 in self.metaKeyValueMap.items():
                oprot.writeString(kiter163.encode('utf-8') if sys.version_info[0] == 2 else kiter163)
                oprot.writeString(viter164.encode('utf-8') if sys.version_info[0] == 2 else viter164)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(putNext_args)
putNext_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.STRING, 'data', 'BINARY', None, ),  # 2
    (3, TType.I32, 'preference', None, None, ),  # 3
    (4, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 4
)


class putNext_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('putNext_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(putNext_result)
putNext_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class incrementBlockCount_args(object):
    """
    Attributes:
     - mbMetadata
     - setLease
    """


    def __init__(self, mbMetadata=None, setLease=None,):
        self.mbMetadata = mbMetadata
        self.setLease = setLease

    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.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('incrementBlockCount_args')
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 1)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 2)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(incrementBlockCount_args)
incrementBlockCount_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 1
    (2, TType.BOOL, 'setLease', None, None, ),  # 2
)


class incrementBlockCount_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = BlockMetadataUpdateResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('incrementBlockCount_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(incrementBlockCount_result)
incrementBlockCount_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [BlockMetadataUpdateResponse, None], None, ),  # 0
)


class renewLease_args(object):
    """
    Attributes:
     - streamId
     - clientId
     - sessionSecret
     - expectedLease
     - setLease
    """


    def __init__(self, streamId=None, clientId=None, sessionSecret=None, expectedLease=None, setLease=None,):
        self.streamId = streamId
        self.clientId = clientId
        self.sessionSecret = sessionSecret
        self.expectedLease = expectedLease
        self.setLease = setLease

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRING:
                    self.clientId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.sessionSecret = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            elif fid == 4:
                if ftype == TType.I32:
                    self.expectedLease = iprot.readI32()
                else:
                    iprot.skip(ftype)
            elif fid == 5:
                if ftype == TType.BOOL:
                    self.setLease = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('renewLease_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        if self.clientId is not None:
            oprot.writeFieldBegin('clientId', TType.STRING, 2)
            oprot.writeString(self.clientId.encode('utf-8') if sys.version_info[0] == 2 else self.clientId)
            oprot.writeFieldEnd()
        if self.sessionSecret is not None:
            oprot.writeFieldBegin('sessionSecret', TType.STRING, 3)
            oprot.writeString(self.sessionSecret.encode('utf-8') if sys.version_info[0] == 2 else self.sessionSecret)
            oprot.writeFieldEnd()
        if self.expectedLease is not None:
            oprot.writeFieldBegin('expectedLease', TType.I32, 4)
            oprot.writeI32(self.expectedLease)
            oprot.writeFieldEnd()
        if self.setLease is not None:
            oprot.writeFieldBegin('setLease', TType.BOOL, 5)
            oprot.writeBool(self.setLease)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(renewLease_args)
renewLease_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
    (2, TType.STRING, 'clientId', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'sessionSecret', 'UTF8', None, ),  # 3
    (4, TType.I32, 'expectedLease', None, None, ),  # 4
    (5, TType.BOOL, 'setLease', None, None, ),  # 5
)


class renewLease_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = StreamLeaseRenewalResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('renewLease_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(renewLease_result)
renewLease_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [StreamLeaseRenewalResponse, None], None, ),  # 0
)


class getLargestBlockId_args(object):
    """
    Attributes:
     - streamId
    """


    def __init__(self, streamId=None,):
        self.streamId = streamId

    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.streamId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getLargestBlockId_args')
        if self.streamId is not None:
            oprot.writeFieldBegin('streamId', TType.STRING, 1)
            oprot.writeString(self.streamId.encode('utf-8') if sys.version_info[0] == 2 else self.streamId)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getLargestBlockId_args)
getLargestBlockId_args.thrift_spec = (
    None,  # 0
    (1, TType.STRING, 'streamId', 'UTF8', None, ),  # 1
)


class getLargestBlockId_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.I64:
                    self.success = iprot.readI64()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('getLargestBlockId_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.I64, 0)
            oprot.writeI64(self.success)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(getLargestBlockId_result)
getLargestBlockId_result.thrift_spec = (
    (0, TType.I64, 'success', None, None, ),  # 0
)


class findStream_args(object):
    """
    Attributes:
     - squery
    """


    def __init__(self, squery=None,):
        self.squery = squery

    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.squery = SQueryRequest()
                    self.squery.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findStream_args')
        if self.squery is not None:
            oprot.writeFieldBegin('squery', TType.STRUCT, 1)
            self.squery.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findStream_args)
findStream_args.thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'squery', [SQueryRequest, None], None, ),  # 1
)


class findStream_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = SQueryResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findStream_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findStream_result)
findStream_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [SQueryResponse, None], None, ),  # 0
)


class updateBlock_args(object):
    """
    Attributes:
     - mbId
     - mbMetadata
     - mbData
    """


    def __init__(self, mbId=None, mbMetadata=None, mbData=None,):
        self.mbId = mbId
        self.mbMetadata = mbMetadata
        self.mbData = mbData

    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.I64:
                    self.mbId = iprot.readI64()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.STRUCT:
                    self.mbMetadata = Metadata()
                    self.mbMetadata.read(iprot)
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.STRING:
                    self.mbData = iprot.readBinary()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateBlock_args')
        if self.mbId is not None:
            oprot.writeFieldBegin('mbId', TType.I64, 1)
            oprot.writeI64(self.mbId)
            oprot.writeFieldEnd()
        if self.mbMetadata is not None:
            oprot.writeFieldBegin('mbMetadata', TType.STRUCT, 2)
            self.mbMetadata.write(oprot)
            oprot.writeFieldEnd()
        if self.mbData is not None:
            oprot.writeFieldBegin('mbData', TType.STRING, 3)
            oprot.writeBinary(self.mbData)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateBlock_args)
updateBlock_args.thrift_spec = (
    None,  # 0
    (1, TType.I64, 'mbId', None, None, ),  # 1
    (2, TType.STRUCT, 'mbMetadata', [Metadata, None], None, ),  # 2
    (3, TType.STRING, 'mbData', 'BINARY', None, ),  # 3
)


class updateBlock_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.STRUCT:
                    self.success = WriteResponse()
                    self.success.read(iprot)
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('updateBlock_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.STRUCT, 0)
            self.success.write(oprot)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(updateBlock_result)
updateBlock_result.thrift_spec = (
    (0, TType.STRUCT, 'success', [WriteResponse, None], None, ),  # 0
)


class listLocalPartitionMbId_args(object):
    """
    Attributes:
     - flag
    """


    def __init__(self, flag=None,):
        self.flag = flag

    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.BOOL:
                    self.flag = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('listLocalPartitionMbId_args')
        if self.flag is not None:
            oprot.writeFieldBegin('flag', TType.BOOL, 1)
            oprot.writeBool(self.flag)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(listLocalPartitionMbId_args)
listLocalPartitionMbId_args.thrift_spec = (
    None,  # 0
    (1, TType.BOOL, 'flag', None, None, ),  # 1
)


class listLocalPartitionMbId_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.SET:
                    self.success = set()
                    (_etype168, _size165) = iprot.readSetBegin()
                    for _i169 in range(_size165):
                        _elem170 = iprot.readI64()
                        self.success.add(_elem170)
                    iprot.readSetEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('listLocalPartitionMbId_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.SET, 0)
            oprot.writeSetBegin(TType.I64, len(self.success))
            for iter171 in self.success:
                oprot.writeI64(iter171)
            oprot.writeSetEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(listLocalPartitionMbId_result)
listLocalPartitionMbId_result.thrift_spec = (
    (0, TType.SET, 'success', (TType.I64, None, False), None, ),  # 0
)


class requestAllNeighbors_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestAllNeighbors_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestAllNeighbors_args)
requestAllNeighbors_args.thrift_spec = (
)


class requestAllNeighbors_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.LIST:
                    self.success = []
                    (_etype175, _size172) = iprot.readListBegin()
                    for _i176 in range(_size172):
                        _elem177 = NeighborInfoData()
                        _elem177.read(iprot)
                        self.success.append(_elem177)
                    iprot.readListEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestAllNeighbors_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.LIST, 0)
            oprot.writeListBegin(TType.STRUCT, len(self.success))
            for iter178 in self.success:
                iter178.write(oprot)
            oprot.writeListEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestAllNeighbors_result)
requestAllNeighbors_result.thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT, [NeighborInfoData, None], False), None, ),  # 0
)


class requestMbIDLocationMap_args(object):


    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
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestMbIDLocationMap_args')
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestMbIDLocationMap_args)
requestMbIDLocationMap_args.thrift_spec = (
)


class requestMbIDLocationMap_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.MAP:
                    self.success = {}
                    (_ktype180, _vtype181, _size179) = iprot.readMapBegin()
                    for _i183 in range(_size179):
                        _key184 = iprot.readI64()
                        _val185 = {}
                        (_ktype187, _vtype188, _size186) = iprot.readMapBegin()
                        for _i190 in range(_size186):
                            _key191 = iprot.readI16()
                            _val192 = iprot.readByte()
                            _val185[_key191] = _val192
                        iprot.readMapEnd()
                        self.success[_key184] = _val185
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('requestMbIDLocationMap_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.MAP, 0)
            oprot.writeMapBegin(TType.I64, TType.MAP, len(self.success))
            for kiter193, viter194 in self.success.items():
                oprot.writeI64(kiter193)
                oprot.writeMapBegin(TType.I16, TType.BYTE, len(viter194))
                for kiter195, viter196 in viter194.items():
                    oprot.writeI16(kiter195)
                    oprot.writeByte(viter196)
                oprot.writeMapEnd()
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(requestMbIDLocationMap_result)
requestMbIDLocationMap_result.thrift_spec = (
    (0, TType.MAP, 'success', (TType.I64, None, TType.MAP, (TType.I16, None, TType.BYTE, None, False), False), None, ),  # 0
)


class findBlockUsingQuery_args(object):
    """
    Attributes:
     - metaKeyValueMap
     - checkNeighbors
     - checkBuddies
    """


    def __init__(self, metaKeyValueMap=None, checkNeighbors=None, checkBuddies=None,):
        self.metaKeyValueMap = metaKeyValueMap
        self.checkNeighbors = checkNeighbors
        self.checkBuddies = checkBuddies

    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.MAP:
                    self.metaKeyValueMap = {}
                    (_ktype198, _vtype199, _size197) = iprot.readMapBegin()
                    for _i201 in range(_size197):
                        _key202 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        _val203 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.metaKeyValueMap[_key202] = _val203
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            elif fid == 2:
                if ftype == TType.BOOL:
                    self.checkNeighbors = iprot.readBool()
                else:
                    iprot.skip(ftype)
            elif fid == 3:
                if ftype == TType.BOOL:
                    self.checkBuddies = iprot.readBool()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findBlockUsingQuery_args')
        if self.metaKeyValueMap is not None:
            oprot.writeFieldBegin('metaKeyValueMap', TType.MAP, 1)
            oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.metaKeyValueMap))
            for kiter204, viter205 in self.metaKeyValueMap.items():
                oprot.writeString(kiter204.encode('utf-8') if sys.version_info[0] == 2 else kiter204)
                oprot.writeString(viter205.encode('utf-8') if sys.version_info[0] == 2 else viter205)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        if self.checkNeighbors is not None:
            oprot.writeFieldBegin('checkNeighbors', TType.BOOL, 2)
            oprot.writeBool(self.checkNeighbors)
            oprot.writeFieldEnd()
        if self.checkBuddies is not None:
            oprot.writeFieldBegin('checkBuddies', TType.BOOL, 3)
            oprot.writeBool(self.checkBuddies)
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findBlockUsingQuery_args)
findBlockUsingQuery_args.thrift_spec = (
    None,  # 0
    (1, TType.MAP, 'metaKeyValueMap', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ),  # 1
    (2, TType.BOOL, 'checkNeighbors', None, None, ),  # 2
    (3, TType.BOOL, 'checkBuddies', None, None, ),  # 3
)


class findBlockUsingQuery_result(object):
    """
    Attributes:
     - success
    """


    def __init__(self, success=None,):
        self.success = success

    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 == 0:
                if ftype == TType.MAP:
                    self.success = {}
                    (_ktype207, _vtype208, _size206) = iprot.readMapBegin()
                    for _i210 in range(_size206):
                        _key211 = iprot.readI64()
                        _val212 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
                        self.success[_key211] = _val212
                    iprot.readMapEnd()
                else:
                    iprot.skip(ftype)
            else:
                iprot.skip(ftype)
            iprot.readFieldEnd()
        iprot.readStructEnd()

    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('findBlockUsingQuery_result')
        if self.success is not None:
            oprot.writeFieldBegin('success', TType.MAP, 0)
            oprot.writeMapBegin(TType.I64, TType.STRING, len(self.success))
            for kiter213, viter214 in self.success.items():
                oprot.writeI64(kiter213)
                oprot.writeString(viter214.encode('utf-8') if sys.version_info[0] == 2 else viter214)
            oprot.writeMapEnd()
            oprot.writeFieldEnd()
        oprot.writeFieldStop()
        oprot.writeStructEnd()

    def validate(self):
        return

    def __repr__(self):
        L = ['%s=%r' % (key, value)
             for key, value in self.__dict__.items()]
        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.append(findBlockUsingQuery_result)
findBlockUsingQuery_result.thrift_spec = (
    (0, TType.MAP, 'success', (TType.I64, None, TType.STRING, 'UTF8', False), None, ),  # 0
)
fix_spec(all_structs)
del all_structs


# # Autogenerated by Thrift Compiler (0.11.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # #  options string: py # Parameters:          - NodeX          - pmin          - pmax Parameters:          - NodeX Parameters:          - reliability          - pmin Parameters:          - NodeX Parameters:          - preCommitRequest Parameters:          - commitRequest Parameters:          - payload Parameters:          - payload Parameters:          - buddyPoolId Parameters:          - requestMap Parameters:          - nodeInfoData Parameters:          - edgePayload Parameters:          - edgeInfoData Parameters:          - edgeInfoData Parameters:          - streamId Parameters:          - streamId          - streamMetadata          - startSequenceNumber Parameters:          - clientId Parameters:          - streamId          - checkNeighbors          - checkBuddies          - forceLatest Parameters:          - streamId Parameters:          - dataLength          - metadata          - blackListedFogs          - isEdge Parameters:          - mbMetadata          - data          - preference Parameters:          - sessionId          - mbData          - dataLength Parameters:          - mbMetadata          - edgeInfoData          - metaKeyValueMap Parameters:          - microbatchId Parameters:          - microbatchId          - checkNeighbors          - checkBuddies          - selfInfo Parameters:          - microbatchId          - fetchMetadata Parameters:          - metadataKey          - metadataValue          - checkNeighbors          - checkBuddies Parameters:          - microbatchId          - checkNeighbors          - checkBuddies Parameters:          - metadata Parameters:          - streamId          - clientId          - expectedLease          - setLease Parameters:          - mbMetadata          - data          - preference          - metaKeyValueMap Parameters:          - mbMetadata          - setLease Parameters:          - streamId          - clientId          - sessionSecret          - expectedLease          - setLease Parameters:          - streamId Parameters:          - squery Parameters:          - mbId          - mbMetadata          - mbData Parameters:          - flag Parameters:          - metaKeyValueMap          - checkNeighbors          - checkBuddies Parameters:          - NodeX          - pmin          - pmax Parameters:          - NodeX Parameters:          - reliability          - pmin Parameters:          - NodeX Parameters:          - preCommitRequest Parameters:          - commitRequest Parameters:          - payload Parameters:          - payload Parameters:          - buddyPoolId Parameters:          - requestMap Parameters:          - nodeInfoData Parameters:          - edgePayload Parameters:          - edgeInfoData Parameters:          - edgeInfoData Parameters:          - streamId Parameters:          - streamId          - streamMetadata          - startSequenceNumber Parameters:          - clientId Parameters:          - streamId          - checkNeighbors          - checkBuddies          - forceLatest Parameters:          - streamId Parameters:          - dataLength          - metadata          - blackListedFogs          - isEdge Parameters:          - mbMetadata          - data          - preference Parameters:          - sessionId          - mbData          - dataLength Parameters:          - mbMetadata          - edgeInfoData          - metaKeyValueMap Parameters:          - microbatchId Parameters:          - microbatchId          - checkNeighbors          - checkBuddies          - selfInfo Parameters:          - microbatchId          - fetchMetadata Parameters:          - metadataKey          - metadataValue          - checkNeighbors          - checkBuddies Parameters:          - microbatchId          - checkNeighbors          - checkBuddies Parameters:          - metadata Parameters:          - streamId          - clientId          - expectedLease          - setLease Parameters:          - mbMetadata          - data          - preference          - metaKeyValueMap Parameters:          - mbMetadata          - setLease Parameters:          - streamId          - clientId          - sessionSecret          - expectedLease          - setLease Parameters:          - streamId Parameters:          - squery Parameters:          - mbId          - mbMetadata          - mbData Parameters:          - flag Parameters:          - metaKeyValueMap          - checkNeighbors          - checkBuddies # HELPER FUNCTIONS AND STRUCTURES Attributes:      - NodeX      - pmin      - pmax # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - NodeX # 0 # 1 Attributes:      - success # 0 Attributes:      - reliability      - pmin # 0 # 1 # 2 Attributes:      - success # 0 Attributes:      - NodeX # 0 # 1 Attributes:      - success # 0 Attributes:      - preCommitRequest # 0 # 1 Attributes:      - success # 0 Attributes:      - commitRequest # 0 # 1 Attributes:      - success # 0 Attributes:      - payload # 0 # 1 Attributes:      - payload # 0 # 1 Attributes:      - buddyPoolId # 0 # 1 Attributes:      - success # 0 Attributes:      - success # 0 Attributes:      - success # 0 Attributes:      - requestMap # 0 # 1 Attributes:      - success # 0 Attributes:      - nodeInfoData # 0 # 1 Attributes:      - success # 0 Attributes:      - edgePayload # 0 # 1 Attributes:      - success # 0 Attributes:      - edgeInfoData # 0 # 1 Attributes:      - success # 0 Attributes:      - edgeInfoData # 0 # 1 Attributes:      - success # 0 Attributes:      - streamId # 0 # 1 Attributes:      - success # 0 Attributes:      - streamId      - streamMetadata      - startSequenceNumber # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - clientId # 0 # 1 Attributes:      - success # 0 Attributes:      - streamId      - checkNeighbors      - checkBuddies      - forceLatest # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - streamId # 0 # 1 Attributes:      - success # 0 Attributes:      - dataLength      - metadata      - blackListedFogs      - isEdge # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - mbMetadata      - data      - preference # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - sessionId      - mbData      - dataLength # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - mbMetadata      - edgeInfoData      - metaKeyValueMap # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - microbatchId # 0 # 1 Attributes:      - success # 0 Attributes:      - microbatchId      - checkNeighbors      - checkBuddies      - selfInfo # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - microbatchId      - fetchMetadata # 0 # 1 # 2 Attributes:      - success # 0 Attributes:      - metadataKey      - metadataValue      - checkNeighbors      - checkBuddies # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - microbatchId      - checkNeighbors      - checkBuddies # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - success # 0 Attributes:      - metadata # 0 # 1 Attributes:      - success # 0 Attributes:      - streamId      - clientId      - expectedLease      - setLease # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - mbMetadata      - data      - preference      - metaKeyValueMap # 0 # 1 # 2 # 3 # 4 Attributes:      - success # 0 Attributes:      - mbMetadata      - setLease # 0 # 1 # 2 Attributes:      - success # 0 Attributes:      - streamId      - clientId      - sessionSecret      - expectedLease      - setLease # 0 # 1 # 2 # 3 # 4 # 5 Attributes:      - success # 0 Attributes:      - streamId # 0 # 1 Attributes:      - success # 0 Attributes:      - squery # 0 # 1 Attributes:      - success # 0 Attributes:      - mbId      - mbMetadata      - mbData # 0 # 1 # 2 # 3 Attributes:      - success # 0 Attributes:      - flag # 0 # 1 Attributes:      - success # 0 Attributes:      - success # 0 Attributes:      - success # 0 Attributes:      - metaKeyValueMap      - checkNeighbors      - checkBuddies # 0 # 1 # 2 # 3 Attributes:      - success # 0