All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iotdb.thrift.cluster.TSMetaService.py Maven / Gradle / Ivy

There is a newer version: 0.13.4
Show newest version
#
# Autogenerated by Thrift Compiler (0.14.1)
#
# 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 iotdb.thrift.cluster.RaftService
import logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []


class Iface(iotdb.thrift.cluster.RaftService.Iface):
    def addNode(self, node, startUpStatus):
        """
        Node which is not leader will call this method to try to add itself into the cluster as a new node.
        
For the receiver, If the local node is leader, it'll check whether the cluster can add this new node; otherwise, the local node will transfer the request to the leader. @param node a new node that needs to be added Parameters: - node - startUpStatus """ pass def checkStatus(self, startUpStatus): """ Parameters: - startUpStatus """ pass def removeNode(self, node): """ Remove a node from the cluster. If the node is not in the cluster or the cluster size will less than replication number, the request will be rejected. return -1(RESPONSE_AGREE) or -3(RESPONSE_REJECT) or -9(RESPONSE_CLUSTER_TOO_SMALL) Parameters: - node """ pass def exile(self, removeNodeLog): """ When a node is removed from the cluster, if it is not the meta leader, it cannot receive the commit command by heartbeat since it has been removed, so the leader should tell it directly that it is no longer in the cluster. Parameters: - removeNodeLog """ pass def queryNodeStatus(self): pass def checkAlive(self): """ Check whether this node is alive. """ pass def collectMigrationStatus(self): """ Collect the info of data migration, which will decide that if users can change membership. """ pass def handshake(self, sender): """ When a node starts, it send handshakes to all other nodes so they know the node is alive again. Notice that heartbeats exists only between leaders and followers, so coordinators cannot know when another node resumes, and handshakes are mainly used to update node status on coordinator side. Parameters: - sender """ pass class Client(iotdb.thrift.cluster.RaftService.Client, Iface): def __init__(self, iprot, oprot=None): iotdb.thrift.cluster.RaftService.Client.__init__(self, iprot, oprot) def addNode(self, node, startUpStatus): """ Node which is not leader will call this method to try to add itself into the cluster as a new node.
For the receiver, If the local node is leader, it'll check whether the cluster can add this new node; otherwise, the local node will transfer the request to the leader. @param node a new node that needs to be added Parameters: - node - startUpStatus """ self.send_addNode(node, startUpStatus) return self.recv_addNode() def send_addNode(self, node, startUpStatus): self._oprot.writeMessageBegin('addNode', TMessageType.CALL, self._seqid) args = addNode_args() args.node = node args.startUpStatus = startUpStatus args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_addNode(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = addNode_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "addNode failed: unknown result") def checkStatus(self, startUpStatus): """ Parameters: - startUpStatus """ self.send_checkStatus(startUpStatus) return self.recv_checkStatus() def send_checkStatus(self, startUpStatus): self._oprot.writeMessageBegin('checkStatus', TMessageType.CALL, self._seqid) args = checkStatus_args() args.startUpStatus = startUpStatus args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_checkStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = checkStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "checkStatus failed: unknown result") def removeNode(self, node): """ Remove a node from the cluster. If the node is not in the cluster or the cluster size will less than replication number, the request will be rejected. return -1(RESPONSE_AGREE) or -3(RESPONSE_REJECT) or -9(RESPONSE_CLUSTER_TOO_SMALL) Parameters: - node """ self.send_removeNode(node) return self.recv_removeNode() def send_removeNode(self, node): self._oprot.writeMessageBegin('removeNode', TMessageType.CALL, self._seqid) args = removeNode_args() args.node = node args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_removeNode(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = removeNode_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "removeNode failed: unknown result") def exile(self, removeNodeLog): """ When a node is removed from the cluster, if it is not the meta leader, it cannot receive the commit command by heartbeat since it has been removed, so the leader should tell it directly that it is no longer in the cluster. Parameters: - removeNodeLog """ self.send_exile(removeNodeLog) self.recv_exile() def send_exile(self, removeNodeLog): self._oprot.writeMessageBegin('exile', TMessageType.CALL, self._seqid) args = exile_args() args.removeNodeLog = removeNodeLog args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_exile(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = exile_result() result.read(iprot) iprot.readMessageEnd() return def queryNodeStatus(self): self.send_queryNodeStatus() return self.recv_queryNodeStatus() def send_queryNodeStatus(self): self._oprot.writeMessageBegin('queryNodeStatus', TMessageType.CALL, self._seqid) args = queryNodeStatus_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_queryNodeStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = queryNodeStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "queryNodeStatus failed: unknown result") def checkAlive(self): """ Check whether this node is alive. """ self.send_checkAlive() return self.recv_checkAlive() def send_checkAlive(self): self._oprot.writeMessageBegin('checkAlive', TMessageType.CALL, self._seqid) args = checkAlive_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_checkAlive(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = checkAlive_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAlive failed: unknown result") def collectMigrationStatus(self): """ Collect the info of data migration, which will decide that if users can change membership. """ self.send_collectMigrationStatus() return self.recv_collectMigrationStatus() def send_collectMigrationStatus(self): self._oprot.writeMessageBegin('collectMigrationStatus', TMessageType.CALL, self._seqid) args = collectMigrationStatus_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_collectMigrationStatus(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = collectMigrationStatus_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "collectMigrationStatus failed: unknown result") def handshake(self, sender): """ When a node starts, it send handshakes to all other nodes so they know the node is alive again. Notice that heartbeats exists only between leaders and followers, so coordinators cannot know when another node resumes, and handshakes are mainly used to update node status on coordinator side. Parameters: - sender """ self.send_handshake(sender) self.recv_handshake() def send_handshake(self, sender): self._oprot.writeMessageBegin('handshake', TMessageType.CALL, self._seqid) args = handshake_args() args.sender = sender args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_handshake(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = handshake_result() result.read(iprot) iprot.readMessageEnd() return class Processor(iotdb.thrift.cluster.RaftService.Processor, Iface, TProcessor): def __init__(self, handler): iotdb.thrift.cluster.RaftService.Processor.__init__(self, handler) self._processMap["addNode"] = Processor.process_addNode self._processMap["checkStatus"] = Processor.process_checkStatus self._processMap["removeNode"] = Processor.process_removeNode self._processMap["exile"] = Processor.process_exile self._processMap["queryNodeStatus"] = Processor.process_queryNodeStatus self._processMap["checkAlive"] = Processor.process_checkAlive self._processMap["collectMigrationStatus"] = Processor.process_collectMigrationStatus self._processMap["handshake"] = Processor.process_handshake self._on_message_begin = None def on_message_begin(self, func): self._on_message_begin = func def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() if self._on_message_begin: self._on_message_begin(name, type, seqid) 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_addNode(self, seqid, iprot, oprot): args = addNode_args() args.read(iprot) iprot.readMessageEnd() result = addNode_result() try: result.success = self._handler.addNode(args.node, args.startUpStatus) 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("addNode", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_checkStatus(self, seqid, iprot, oprot): args = checkStatus_args() args.read(iprot) iprot.readMessageEnd() result = checkStatus_result() try: result.success = self._handler.checkStatus(args.startUpStatus) 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("checkStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_removeNode(self, seqid, iprot, oprot): args = removeNode_args() args.read(iprot) iprot.readMessageEnd() result = removeNode_result() try: result.success = self._handler.removeNode(args.node) 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("removeNode", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_exile(self, seqid, iprot, oprot): args = exile_args() args.read(iprot) iprot.readMessageEnd() result = exile_result() try: self._handler.exile(args.removeNodeLog) 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("exile", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_queryNodeStatus(self, seqid, iprot, oprot): args = queryNodeStatus_args() args.read(iprot) iprot.readMessageEnd() result = queryNodeStatus_result() try: result.success = self._handler.queryNodeStatus() 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("queryNodeStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_checkAlive(self, seqid, iprot, oprot): args = checkAlive_args() args.read(iprot) iprot.readMessageEnd() result = checkAlive_result() try: result.success = self._handler.checkAlive() 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("checkAlive", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_collectMigrationStatus(self, seqid, iprot, oprot): args = collectMigrationStatus_args() args.read(iprot) iprot.readMessageEnd() result = collectMigrationStatus_result() try: result.success = self._handler.collectMigrationStatus() 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("collectMigrationStatus", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_handshake(self, seqid, iprot, oprot): args = handshake_args() args.read(iprot) iprot.readMessageEnd() result = handshake_result() try: self._handler.handshake(args.sender) 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("handshake", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class addNode_args(object): """ Attributes: - node - startUpStatus """ def __init__(self, node=None, startUpStatus=None,): self.node = node self.startUpStatus = startUpStatus 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.node = Node() self.node.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: self.startUpStatus = StartUpStatus() self.startUpStatus.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('addNode_args') if self.node is not None: oprot.writeFieldBegin('node', TType.STRUCT, 1) self.node.write(oprot) oprot.writeFieldEnd() if self.startUpStatus is not None: oprot.writeFieldBegin('startUpStatus', TType.STRUCT, 2) self.startUpStatus.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(addNode_args) addNode_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'node', [Node, None], None, ), # 1 (2, TType.STRUCT, 'startUpStatus', [StartUpStatus, None], None, ), # 2 ) class addNode_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 = AddNodeResponse() 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('addNode_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(addNode_result) addNode_result.thrift_spec = ( (0, TType.STRUCT, 'success', [AddNodeResponse, None], None, ), # 0 ) class checkStatus_args(object): """ Attributes: - startUpStatus """ def __init__(self, startUpStatus=None,): self.startUpStatus = startUpStatus 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.startUpStatus = StartUpStatus() self.startUpStatus.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('checkStatus_args') if self.startUpStatus is not None: oprot.writeFieldBegin('startUpStatus', TType.STRUCT, 1) self.startUpStatus.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(checkStatus_args) checkStatus_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'startUpStatus', [StartUpStatus, None], None, ), # 1 ) class checkStatus_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 = CheckStatusResponse() 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('checkStatus_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(checkStatus_result) checkStatus_result.thrift_spec = ( (0, TType.STRUCT, 'success', [CheckStatusResponse, None], None, ), # 0 ) class removeNode_args(object): """ Attributes: - node """ def __init__(self, node=None,): self.node = node 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.node = Node() self.node.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('removeNode_args') if self.node is not None: oprot.writeFieldBegin('node', TType.STRUCT, 1) self.node.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(removeNode_args) removeNode_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'node', [Node, None], None, ), # 1 ) class removeNode_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('removeNode_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(removeNode_result) removeNode_result.thrift_spec = ( (0, TType.I64, 'success', None, None, ), # 0 ) class exile_args(object): """ Attributes: - removeNodeLog """ def __init__(self, removeNodeLog=None,): self.removeNodeLog = removeNodeLog 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.removeNodeLog = 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('exile_args') if self.removeNodeLog is not None: oprot.writeFieldBegin('removeNodeLog', TType.STRING, 1) oprot.writeBinary(self.removeNodeLog) 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(exile_args) exile_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'removeNodeLog', 'BINARY', None, ), # 1 ) class exile_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('exile_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(exile_result) exile_result.thrift_spec = ( ) class queryNodeStatus_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('queryNodeStatus_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(queryNodeStatus_args) queryNodeStatus_args.thrift_spec = ( ) class queryNodeStatus_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 = TNodeStatus() 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('queryNodeStatus_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(queryNodeStatus_result) queryNodeStatus_result.thrift_spec = ( (0, TType.STRUCT, 'success', [TNodeStatus, None], None, ), # 0 ) class checkAlive_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('checkAlive_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(checkAlive_args) checkAlive_args.thrift_spec = ( ) class checkAlive_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 = Node() 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('checkAlive_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(checkAlive_result) checkAlive_result.thrift_spec = ( (0, TType.STRUCT, 'success', [Node, None], None, ), # 0 ) class collectMigrationStatus_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('collectMigrationStatus_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(collectMigrationStatus_args) collectMigrationStatus_args.thrift_spec = ( ) class collectMigrationStatus_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('collectMigrationStatus_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(collectMigrationStatus_result) collectMigrationStatus_result.thrift_spec = ( (0, TType.STRING, 'success', 'BINARY', None, ), # 0 ) class handshake_args(object): """ Attributes: - sender """ def __init__(self, sender=None,): self.sender = sender 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.sender = Node() self.sender.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('handshake_args') if self.sender is not None: oprot.writeFieldBegin('sender', TType.STRUCT, 1) self.sender.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(handshake_args) handshake_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'sender', [Node, None], None, ), # 1 ) class handshake_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('handshake_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(handshake_result) handshake_result.thrift_spec = ( ) fix_spec(all_structs) del all_structs




© 2015 - 2025 Weber Informatics LLC | Privacy Policy