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

iotdb.thrift.cluster.RaftService.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 logging
from .ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
all_structs = []


class Iface(object):
    def sendHeartbeat(self, request):
        """
        Leader will call this method to all followers to ensure its authority.
        
For the receiver, The method will check the authority of the leader. @param request information of the leader @return if the leader is valid, HeartBeatResponse.term will set -1, and the follower will tell leader its lastLogIndex; otherwise, the follower will tell the fake leader its term. Parameters: - request """ pass def startElection(self, request): """ If a node wants to be a leader, it'll call the method to other nodes to get a vote.
For the receiver, The method will check whether the node can be a leader. @param voteRequest a candidate that wants to be a leader. @return -1 means agree, otherwise return the voter's term Parameters: - request """ pass def appendEntries(self, request): """ Leader will call this method to send a batch of entries to all followers.
For the receiver, The method will check the authority of the leader and if the local log is complete. If the leader is valid and local log is complete, the follower will append these entries to local log. @param request entries that need to be appended and the information of the leader. @return -1: agree, -2: log index mismatch , otherwise return the follower's term Parameters: - request """ pass def appendEntry(self, request): """ Leader will call this method to send a entry to all followers.
For the receiver, The method will check the authority of the leader and if the local log is complete. If the leader is valid and local log is complete, the follower will append the entry to local log. @param request entry that needs to be appended and the information of the leader. @return -1: agree, -2: log index mismatch , otherwise return the follower's term Parameters: - request """ pass def sendSnapshot(self, request): """ Parameters: - request """ pass def executeNonQueryPlan(self, request): """ Execute a binarized non-query PhysicalPlan Parameters: - request """ pass def requestCommitIndex(self, header): """ Ask the leader for its commit index, used to check whether the node has caught up with the leader. Parameters: - header """ pass def readFile(self, filePath, offset, length): """ Read a chunk of a file from the client. If the remaining of the file does not have enough bytes, only the remaining will be returned. Notice that when the last chunk of the file is read, the file will be deleted immediately. Parameters: - filePath - offset - length """ pass def matchTerm(self, index, term, header): """ Test if a log of "index" and "term" exists. Parameters: - index - term - header """ pass def removeHardLink(self, hardLinkPath): """ When a follower finds that it already has a file in a snapshot locally, it calls this interface to notify the leader to remove the associated hardlink. Parameters: - hardLinkPath """ 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 sendHeartbeat(self, request): """ Leader will call this method to all followers to ensure its authority.
For the receiver, The method will check the authority of the leader. @param request information of the leader @return if the leader is valid, HeartBeatResponse.term will set -1, and the follower will tell leader its lastLogIndex; otherwise, the follower will tell the fake leader its term. Parameters: - request """ self.send_sendHeartbeat(request) return self.recv_sendHeartbeat() def send_sendHeartbeat(self, request): self._oprot.writeMessageBegin('sendHeartbeat', TMessageType.CALL, self._seqid) args = sendHeartbeat_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sendHeartbeat(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sendHeartbeat_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "sendHeartbeat failed: unknown result") def startElection(self, request): """ If a node wants to be a leader, it'll call the method to other nodes to get a vote.
For the receiver, The method will check whether the node can be a leader. @param voteRequest a candidate that wants to be a leader. @return -1 means agree, otherwise return the voter's term Parameters: - request """ self.send_startElection(request) return self.recv_startElection() def send_startElection(self, request): self._oprot.writeMessageBegin('startElection', TMessageType.CALL, self._seqid) args = startElection_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_startElection(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = startElection_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "startElection failed: unknown result") def appendEntries(self, request): """ Leader will call this method to send a batch of entries to all followers.
For the receiver, The method will check the authority of the leader and if the local log is complete. If the leader is valid and local log is complete, the follower will append these entries to local log. @param request entries that need to be appended and the information of the leader. @return -1: agree, -2: log index mismatch , otherwise return the follower's term Parameters: - request """ self.send_appendEntries(request) return self.recv_appendEntries() def send_appendEntries(self, request): self._oprot.writeMessageBegin('appendEntries', TMessageType.CALL, self._seqid) args = appendEntries_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_appendEntries(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = appendEntries_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "appendEntries failed: unknown result") def appendEntry(self, request): """ Leader will call this method to send a entry to all followers.
For the receiver, The method will check the authority of the leader and if the local log is complete. If the leader is valid and local log is complete, the follower will append the entry to local log. @param request entry that needs to be appended and the information of the leader. @return -1: agree, -2: log index mismatch , otherwise return the follower's term Parameters: - request """ self.send_appendEntry(request) return self.recv_appendEntry() def send_appendEntry(self, request): self._oprot.writeMessageBegin('appendEntry', TMessageType.CALL, self._seqid) args = appendEntry_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_appendEntry(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = appendEntry_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "appendEntry failed: unknown result") def sendSnapshot(self, request): """ Parameters: - request """ self.send_sendSnapshot(request) self.recv_sendSnapshot() def send_sendSnapshot(self, request): self._oprot.writeMessageBegin('sendSnapshot', TMessageType.CALL, self._seqid) args = sendSnapshot_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_sendSnapshot(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = sendSnapshot_result() result.read(iprot) iprot.readMessageEnd() return def executeNonQueryPlan(self, request): """ Execute a binarized non-query PhysicalPlan Parameters: - request """ self.send_executeNonQueryPlan(request) return self.recv_executeNonQueryPlan() def send_executeNonQueryPlan(self, request): self._oprot.writeMessageBegin('executeNonQueryPlan', TMessageType.CALL, self._seqid) args = executeNonQueryPlan_args() args.request = request args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_executeNonQueryPlan(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = executeNonQueryPlan_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "executeNonQueryPlan failed: unknown result") def requestCommitIndex(self, header): """ Ask the leader for its commit index, used to check whether the node has caught up with the leader. Parameters: - header """ self.send_requestCommitIndex(header) return self.recv_requestCommitIndex() def send_requestCommitIndex(self, header): self._oprot.writeMessageBegin('requestCommitIndex', TMessageType.CALL, self._seqid) args = requestCommitIndex_args() args.header = header args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_requestCommitIndex(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = requestCommitIndex_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "requestCommitIndex failed: unknown result") def readFile(self, filePath, offset, length): """ Read a chunk of a file from the client. If the remaining of the file does not have enough bytes, only the remaining will be returned. Notice that when the last chunk of the file is read, the file will be deleted immediately. Parameters: - filePath - offset - length """ self.send_readFile(filePath, offset, length) return self.recv_readFile() def send_readFile(self, filePath, offset, length): self._oprot.writeMessageBegin('readFile', TMessageType.CALL, self._seqid) args = readFile_args() args.filePath = filePath args.offset = offset args.length = length args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_readFile(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = readFile_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "readFile failed: unknown result") def matchTerm(self, index, term, header): """ Test if a log of "index" and "term" exists. Parameters: - index - term - header """ self.send_matchTerm(index, term, header) return self.recv_matchTerm() def send_matchTerm(self, index, term, header): self._oprot.writeMessageBegin('matchTerm', TMessageType.CALL, self._seqid) args = matchTerm_args() args.index = index args.term = term args.header = header args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_matchTerm(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = matchTerm_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "matchTerm failed: unknown result") def removeHardLink(self, hardLinkPath): """ When a follower finds that it already has a file in a snapshot locally, it calls this interface to notify the leader to remove the associated hardlink. Parameters: - hardLinkPath """ self.send_removeHardLink(hardLinkPath) self.recv_removeHardLink() def send_removeHardLink(self, hardLinkPath): self._oprot.writeMessageBegin('removeHardLink', TMessageType.CALL, self._seqid) args = removeHardLink_args() args.hardLinkPath = hardLinkPath args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() def recv_removeHardLink(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() x.read(iprot) iprot.readMessageEnd() raise x result = removeHardLink_result() result.read(iprot) iprot.readMessageEnd() return class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["sendHeartbeat"] = Processor.process_sendHeartbeat self._processMap["startElection"] = Processor.process_startElection self._processMap["appendEntries"] = Processor.process_appendEntries self._processMap["appendEntry"] = Processor.process_appendEntry self._processMap["sendSnapshot"] = Processor.process_sendSnapshot self._processMap["executeNonQueryPlan"] = Processor.process_executeNonQueryPlan self._processMap["requestCommitIndex"] = Processor.process_requestCommitIndex self._processMap["readFile"] = Processor.process_readFile self._processMap["matchTerm"] = Processor.process_matchTerm self._processMap["removeHardLink"] = Processor.process_removeHardLink 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_sendHeartbeat(self, seqid, iprot, oprot): args = sendHeartbeat_args() args.read(iprot) iprot.readMessageEnd() result = sendHeartbeat_result() try: result.success = self._handler.sendHeartbeat(args.request) 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("sendHeartbeat", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_startElection(self, seqid, iprot, oprot): args = startElection_args() args.read(iprot) iprot.readMessageEnd() result = startElection_result() try: result.success = self._handler.startElection(args.request) 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("startElection", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_appendEntries(self, seqid, iprot, oprot): args = appendEntries_args() args.read(iprot) iprot.readMessageEnd() result = appendEntries_result() try: result.success = self._handler.appendEntries(args.request) 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("appendEntries", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_appendEntry(self, seqid, iprot, oprot): args = appendEntry_args() args.read(iprot) iprot.readMessageEnd() result = appendEntry_result() try: result.success = self._handler.appendEntry(args.request) 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("appendEntry", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_sendSnapshot(self, seqid, iprot, oprot): args = sendSnapshot_args() args.read(iprot) iprot.readMessageEnd() result = sendSnapshot_result() try: self._handler.sendSnapshot(args.request) 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("sendSnapshot", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_executeNonQueryPlan(self, seqid, iprot, oprot): args = executeNonQueryPlan_args() args.read(iprot) iprot.readMessageEnd() result = executeNonQueryPlan_result() try: result.success = self._handler.executeNonQueryPlan(args.request) 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("executeNonQueryPlan", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_requestCommitIndex(self, seqid, iprot, oprot): args = requestCommitIndex_args() args.read(iprot) iprot.readMessageEnd() result = requestCommitIndex_result() try: result.success = self._handler.requestCommitIndex(args.header) 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("requestCommitIndex", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_readFile(self, seqid, iprot, oprot): args = readFile_args() args.read(iprot) iprot.readMessageEnd() result = readFile_result() try: result.success = self._handler.readFile(args.filePath, args.offset, args.length) 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("readFile", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_matchTerm(self, seqid, iprot, oprot): args = matchTerm_args() args.read(iprot) iprot.readMessageEnd() result = matchTerm_result() try: result.success = self._handler.matchTerm(args.index, args.term, args.header) 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("matchTerm", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() def process_removeHardLink(self, seqid, iprot, oprot): args = removeHardLink_args() args.read(iprot) iprot.readMessageEnd() result = removeHardLink_result() try: self._handler.removeHardLink(args.hardLinkPath) 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("removeHardLink", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() # HELPER FUNCTIONS AND STRUCTURES class sendHeartbeat_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = HeartBeatRequest() self.request.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('sendHeartbeat_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(sendHeartbeat_args) sendHeartbeat_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [HeartBeatRequest, None], None, ), # 1 ) class sendHeartbeat_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 = HeartBeatResponse() 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('sendHeartbeat_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(sendHeartbeat_result) sendHeartbeat_result.thrift_spec = ( (0, TType.STRUCT, 'success', [HeartBeatResponse, None], None, ), # 0 ) class startElection_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = ElectionRequest() self.request.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('startElection_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(startElection_args) startElection_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [ElectionRequest, None], None, ), # 1 ) class startElection_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('startElection_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(startElection_result) startElection_result.thrift_spec = ( (0, TType.I64, 'success', None, None, ), # 0 ) class appendEntries_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = AppendEntriesRequest() self.request.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('appendEntries_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(appendEntries_args) appendEntries_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [AppendEntriesRequest, None], None, ), # 1 ) class appendEntries_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('appendEntries_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(appendEntries_result) appendEntries_result.thrift_spec = ( (0, TType.I64, 'success', None, None, ), # 0 ) class appendEntry_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = AppendEntryRequest() self.request.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('appendEntry_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(appendEntry_args) appendEntry_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [AppendEntryRequest, None], None, ), # 1 ) class appendEntry_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('appendEntry_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(appendEntry_result) appendEntry_result.thrift_spec = ( (0, TType.I64, 'success', None, None, ), # 0 ) class sendSnapshot_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = SendSnapshotRequest() self.request.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('sendSnapshot_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(sendSnapshot_args) sendSnapshot_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [SendSnapshotRequest, None], None, ), # 1 ) class sendSnapshot_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('sendSnapshot_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(sendSnapshot_result) sendSnapshot_result.thrift_spec = ( ) class executeNonQueryPlan_args(object): """ Attributes: - request """ def __init__(self, request=None,): self.request = request 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.request = ExecutNonQueryReq() self.request.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('executeNonQueryPlan_args') if self.request is not None: oprot.writeFieldBegin('request', TType.STRUCT, 1) self.request.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(executeNonQueryPlan_args) executeNonQueryPlan_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'request', [ExecutNonQueryReq, None], None, ), # 1 ) class executeNonQueryPlan_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 = iotdb.thrift.rpc.ttypes.TSStatus() 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('executeNonQueryPlan_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(executeNonQueryPlan_result) executeNonQueryPlan_result.thrift_spec = ( (0, TType.STRUCT, 'success', [iotdb.thrift.rpc.ttypes.TSStatus, None], None, ), # 0 ) class requestCommitIndex_args(object): """ Attributes: - header """ def __init__(self, header=None,): self.header = header 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.header = RaftNode() self.header.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('requestCommitIndex_args') if self.header is not None: oprot.writeFieldBegin('header', TType.STRUCT, 1) self.header.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(requestCommitIndex_args) requestCommitIndex_args.thrift_spec = ( None, # 0 (1, TType.STRUCT, 'header', [RaftNode, None], None, ), # 1 ) class requestCommitIndex_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 = RequestCommitIndexResponse() 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('requestCommitIndex_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(requestCommitIndex_result) requestCommitIndex_result.thrift_spec = ( (0, TType.STRUCT, 'success', [RequestCommitIndexResponse, None], None, ), # 0 ) class readFile_args(object): """ Attributes: - filePath - offset - length """ def __init__(self, filePath=None, offset=None, length=None,): self.filePath = filePath self.offset = offset self.length = length 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.filePath = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.offset = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: self.length = 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('readFile_args') if self.filePath is not None: oprot.writeFieldBegin('filePath', TType.STRING, 1) oprot.writeString(self.filePath.encode('utf-8') if sys.version_info[0] == 2 else self.filePath) oprot.writeFieldEnd() if self.offset is not None: oprot.writeFieldBegin('offset', TType.I64, 2) oprot.writeI64(self.offset) oprot.writeFieldEnd() if self.length is not None: oprot.writeFieldBegin('length', TType.I32, 3) oprot.writeI32(self.length) 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(readFile_args) readFile_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'filePath', 'UTF8', None, ), # 1 (2, TType.I64, 'offset', None, None, ), # 2 (3, TType.I32, 'length', None, None, ), # 3 ) class readFile_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('readFile_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(readFile_result) readFile_result.thrift_spec = ( (0, TType.STRING, 'success', 'BINARY', None, ), # 0 ) class matchTerm_args(object): """ Attributes: - index - term - header """ def __init__(self, index=None, term=None, header=None,): self.index = index self.term = term self.header = header 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.index = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: self.term = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: self.header = RaftNode() self.header.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('matchTerm_args') if self.index is not None: oprot.writeFieldBegin('index', TType.I64, 1) oprot.writeI64(self.index) oprot.writeFieldEnd() if self.term is not None: oprot.writeFieldBegin('term', TType.I64, 2) oprot.writeI64(self.term) oprot.writeFieldEnd() if self.header is not None: oprot.writeFieldBegin('header', TType.STRUCT, 3) self.header.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(matchTerm_args) matchTerm_args.thrift_spec = ( None, # 0 (1, TType.I64, 'index', None, None, ), # 1 (2, TType.I64, 'term', None, None, ), # 2 (3, TType.STRUCT, 'header', [RaftNode, None], None, ), # 3 ) class matchTerm_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('matchTerm_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(matchTerm_result) matchTerm_result.thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), # 0 ) class removeHardLink_args(object): """ Attributes: - hardLinkPath """ def __init__(self, hardLinkPath=None,): self.hardLinkPath = hardLinkPath 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.hardLinkPath = iprot.readString().decode('utf-8', errors='replace') 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('removeHardLink_args') if self.hardLinkPath is not None: oprot.writeFieldBegin('hardLinkPath', TType.STRING, 1) oprot.writeString(self.hardLinkPath.encode('utf-8') if sys.version_info[0] == 2 else self.hardLinkPath) 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(removeHardLink_args) removeHardLink_args.thrift_spec = ( None, # 0 (1, TType.STRING, 'hardLinkPath', 'UTF8', None, ), # 1 ) class removeHardLink_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('removeHardLink_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(removeHardLink_result) removeHardLink_result.thrift_spec = ( ) fix_spec(all_structs) del all_structs




© 2015 - 2025 Weber Informatics LLC | Privacy Policy