Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added flaptor.indextank.rpc generated py thrift

  • Loading branch information...
commit 6e0ff7588a5ea1c78a10da8c225fac361e1269c2 1 parent 99edd35
@ghosthack ghosthack authored
Showing with 13,638 additions and 0 deletions.
  1. 0  gen-py/__init__.py
  2. 0  gen-py/flaptor/__init__.py
  3. 0  gen-py/flaptor/indextank/__init__.py
  4. +155 −0 gen-py/flaptor/indextank/rpc/Controller-remote
  5. +2,050 −0 gen-py/flaptor/indextank/rpc/Controller.py
  6. +99 −0 gen-py/flaptor/indextank/rpc/DeployManager-remote
  7. +535 −0 gen-py/flaptor/indextank/rpc/DeployManager.py
  8. +92 −0 gen-py/flaptor/indextank/rpc/FrontendManager-remote
  9. +374 −0 gen-py/flaptor/indextank/rpc/FrontendManager.py
  10. +190 −0 gen-py/flaptor/indextank/rpc/Indexer-remote
  11. +2,727 −0 gen-py/flaptor/indextank/rpc/Indexer.py
  12. +120 −0 gen-py/flaptor/indextank/rpc/LogManager-remote
  13. +977 −0 gen-py/flaptor/indextank/rpc/LogManager.py
  14. +85 −0 gen-py/flaptor/indextank/rpc/LogReader-remote
  15. +232 −0 gen-py/flaptor/indextank/rpc/LogReader.py
  16. +85 −0 gen-py/flaptor/indextank/rpc/LogWriter-remote
  17. +197 −0 gen-py/flaptor/indextank/rpc/LogWriter.py
  18. +106 −0 gen-py/flaptor/indextank/rpc/Searcher-remote
  19. +950 −0 gen-py/flaptor/indextank/rpc/Searcher.py
  20. +120 −0 gen-py/flaptor/indextank/rpc/Storage-remote
  21. +1,313 −0 gen-py/flaptor/indextank/rpc/Storage.py
  22. +85 −0 gen-py/flaptor/indextank/rpc/Suggestor-remote
  23. +238 −0 gen-py/flaptor/indextank/rpc/Suggestor.py
  24. +99 −0 gen-py/flaptor/indextank/rpc/WorkerManager-remote
  25. +601 −0 gen-py/flaptor/indextank/rpc/WorkerManager.py
  26. +1 −0  gen-py/flaptor/indextank/rpc/__init__.py
  27. +9 −0 gen-py/flaptor/indextank/rpc/constants.py
  28. +2,198 −0 gen-py/flaptor/indextank/rpc/ttypes.py
View
0  gen-py/__init__.py
No changes.
View
0  gen-py/flaptor/__init__.py
No changes.
View
0  gen-py/flaptor/indextank/__init__.py
No changes.
View
155 gen-py/flaptor/indextank/rpc/Controller-remote
@@ -0,0 +1,155 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+import sys
+import pprint
+from urlparse import urlparse
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+import Controller
+from ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+ print ''
+ print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
+ print ''
+ print 'Functions:'
+ print ' bool start_engine(string json_configuration)'
+ print ' i32 kill_engine(string index_code, i32 base_port)'
+ print ' WorkerMountStats get_worker_mount_stats()'
+ print ' WorkerLoadStats get_worker_load_stats()'
+ print ' IndexStats get_worker_index_stats(string index_code, i32 port)'
+ print ' void stats()'
+ print ' i32 update_worker(string source_host)'
+ print ' void restart_controller()'
+ print ' string head(string file, i32 lines, string index_code, i32 base_port)'
+ print ' string tail(string file, i32 lines, string index_code, i32 base_port)'
+ print ' string ps_info(string pidfile, string index_code, i32 base_port)'
+ print ''
+ sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent = 2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+ parts = sys.argv[argi+1].split(':')
+ host = parts[0]
+ port = int(parts[1])
+ argi += 2
+
+if sys.argv[argi] == '-u':
+ url = urlparse(sys.argv[argi+1])
+ parts = url[1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ else:
+ port = 80
+ uri = url[2]
+ if url[4]:
+ uri += '?%s' % url[4]
+ http = True
+ argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+ framed = True
+ argi += 1
+
+cmd = sys.argv[argi]
+args = sys.argv[argi+1:]
+
+if http:
+ transport = THttpClient.THttpClient(host, port, uri)
+else:
+ socket = TSocket.TSocket(host, port)
+ if framed:
+ transport = TTransport.TFramedTransport(socket)
+ else:
+ transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = Controller.Client(protocol)
+transport.open()
+
+if cmd == 'start_engine':
+ if len(args) != 1:
+ print 'start_engine requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.start_engine(args[0],))
+
+elif cmd == 'kill_engine':
+ if len(args) != 2:
+ print 'kill_engine requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.kill_engine(args[0],eval(args[1]),))
+
+elif cmd == 'get_worker_mount_stats':
+ if len(args) != 0:
+ print 'get_worker_mount_stats requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.get_worker_mount_stats())
+
+elif cmd == 'get_worker_load_stats':
+ if len(args) != 0:
+ print 'get_worker_load_stats requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.get_worker_load_stats())
+
+elif cmd == 'get_worker_index_stats':
+ if len(args) != 2:
+ print 'get_worker_index_stats requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.get_worker_index_stats(args[0],eval(args[1]),))
+
+elif cmd == 'stats':
+ if len(args) != 0:
+ print 'stats requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.stats())
+
+elif cmd == 'update_worker':
+ if len(args) != 1:
+ print 'update_worker requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.update_worker(args[0],))
+
+elif cmd == 'restart_controller':
+ if len(args) != 0:
+ print 'restart_controller requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.restart_controller())
+
+elif cmd == 'head':
+ if len(args) != 4:
+ print 'head requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.head(args[0],eval(args[1]),args[2],eval(args[3]),))
+
+elif cmd == 'tail':
+ if len(args) != 4:
+ print 'tail requires 4 args'
+ sys.exit(1)
+ pp.pprint(client.tail(args[0],eval(args[1]),args[2],eval(args[3]),))
+
+elif cmd == 'ps_info':
+ if len(args) != 3:
+ print 'ps_info requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.ps_info(args[0],args[1],eval(args[2]),))
+
+else:
+ print 'Unrecognized method %s' % cmd
+ sys.exit(1)
+
+transport.close()
View
2,050 gen-py/flaptor/indextank/rpc/Controller.py
@@ -0,0 +1,2050 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class Iface:
+ def start_engine(self, json_configuration):
+ """
+ Parameters:
+ - json_configuration
+ """
+ pass
+
+ def kill_engine(self, index_code, base_port):
+ """
+ Parameters:
+ - index_code
+ - base_port
+ """
+ pass
+
+ def get_worker_mount_stats(self, ):
+ pass
+
+ def get_worker_load_stats(self, ):
+ pass
+
+ def get_worker_index_stats(self, index_code, port):
+ """
+ Parameters:
+ - index_code
+ - port
+ """
+ pass
+
+ def stats(self, ):
+ pass
+
+ def update_worker(self, source_host):
+ """
+ Parameters:
+ - source_host
+ """
+ pass
+
+ def restart_controller(self, ):
+ pass
+
+ def head(self, file, lines, index_code, base_port):
+ """
+ Parameters:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+ pass
+
+ def tail(self, file, lines, index_code, base_port):
+ """
+ Parameters:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+ pass
+
+ def ps_info(self, pidfile, index_code, base_port):
+ """
+ Parameters:
+ - pidfile
+ - index_code
+ - base_port
+ """
+ pass
+
+
+class Client(Iface):
+ def __init__(self, iprot, oprot=None):
+ self._iprot = self._oprot = iprot
+ if oprot != None:
+ self._oprot = oprot
+ self._seqid = 0
+
+ def start_engine(self, json_configuration):
+ """
+ Parameters:
+ - json_configuration
+ """
+ self.send_start_engine(json_configuration)
+ return self.recv_start_engine()
+
+ def send_start_engine(self, json_configuration):
+ self._oprot.writeMessageBegin('start_engine', TMessageType.CALL, self._seqid)
+ args = start_engine_args()
+ args.json_configuration = json_configuration
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_start_engine(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = start_engine_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "start_engine failed: unknown result");
+
+ def kill_engine(self, index_code, base_port):
+ """
+ Parameters:
+ - index_code
+ - base_port
+ """
+ self.send_kill_engine(index_code, base_port)
+ return self.recv_kill_engine()
+
+ def send_kill_engine(self, index_code, base_port):
+ self._oprot.writeMessageBegin('kill_engine', TMessageType.CALL, self._seqid)
+ args = kill_engine_args()
+ args.index_code = index_code
+ args.base_port = base_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_kill_engine(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = kill_engine_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "kill_engine failed: unknown result");
+
+ def get_worker_mount_stats(self, ):
+ self.send_get_worker_mount_stats()
+ return self.recv_get_worker_mount_stats()
+
+ def send_get_worker_mount_stats(self, ):
+ self._oprot.writeMessageBegin('get_worker_mount_stats', TMessageType.CALL, self._seqid)
+ args = get_worker_mount_stats_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_get_worker_mount_stats(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = get_worker_mount_stats_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "get_worker_mount_stats failed: unknown result");
+
+ def get_worker_load_stats(self, ):
+ self.send_get_worker_load_stats()
+ return self.recv_get_worker_load_stats()
+
+ def send_get_worker_load_stats(self, ):
+ self._oprot.writeMessageBegin('get_worker_load_stats', TMessageType.CALL, self._seqid)
+ args = get_worker_load_stats_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_get_worker_load_stats(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = get_worker_load_stats_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "get_worker_load_stats failed: unknown result");
+
+ def get_worker_index_stats(self, index_code, port):
+ """
+ Parameters:
+ - index_code
+ - port
+ """
+ self.send_get_worker_index_stats(index_code, port)
+ return self.recv_get_worker_index_stats()
+
+ def send_get_worker_index_stats(self, index_code, port):
+ self._oprot.writeMessageBegin('get_worker_index_stats', TMessageType.CALL, self._seqid)
+ args = get_worker_index_stats_args()
+ args.index_code = index_code
+ args.port = port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_get_worker_index_stats(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = get_worker_index_stats_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "get_worker_index_stats failed: unknown result");
+
+ def stats(self, ):
+ self.send_stats()
+ self.recv_stats()
+
+ def send_stats(self, ):
+ self._oprot.writeMessageBegin('stats', TMessageType.CALL, self._seqid)
+ args = stats_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_stats(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = stats_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.ne != None:
+ raise result.ne
+ return
+
+ def update_worker(self, source_host):
+ """
+ Parameters:
+ - source_host
+ """
+ self.send_update_worker(source_host)
+ return self.recv_update_worker()
+
+ def send_update_worker(self, source_host):
+ self._oprot.writeMessageBegin('update_worker', TMessageType.CALL, self._seqid)
+ args = update_worker_args()
+ args.source_host = source_host
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_update_worker(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = update_worker_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "update_worker failed: unknown result");
+
+ def restart_controller(self, ):
+ self.send_restart_controller()
+ self.recv_restart_controller()
+
+ def send_restart_controller(self, ):
+ self._oprot.writeMessageBegin('restart_controller', TMessageType.CALL, self._seqid)
+ args = restart_controller_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_restart_controller(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = restart_controller_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ return
+
+ def head(self, file, lines, index_code, base_port):
+ """
+ Parameters:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+ self.send_head(file, lines, index_code, base_port)
+ return self.recv_head()
+
+ def send_head(self, file, lines, index_code, base_port):
+ self._oprot.writeMessageBegin('head', TMessageType.CALL, self._seqid)
+ args = head_args()
+ args.file = file
+ args.lines = lines
+ args.index_code = index_code
+ args.base_port = base_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_head(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = head_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "head failed: unknown result");
+
+ def tail(self, file, lines, index_code, base_port):
+ """
+ Parameters:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+ self.send_tail(file, lines, index_code, base_port)
+ return self.recv_tail()
+
+ def send_tail(self, file, lines, index_code, base_port):
+ self._oprot.writeMessageBegin('tail', TMessageType.CALL, self._seqid)
+ args = tail_args()
+ args.file = file
+ args.lines = lines
+ args.index_code = index_code
+ args.base_port = base_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_tail(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = tail_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "tail failed: unknown result");
+
+ def ps_info(self, pidfile, index_code, base_port):
+ """
+ Parameters:
+ - pidfile
+ - index_code
+ - base_port
+ """
+ self.send_ps_info(pidfile, index_code, base_port)
+ return self.recv_ps_info()
+
+ def send_ps_info(self, pidfile, index_code, base_port):
+ self._oprot.writeMessageBegin('ps_info', TMessageType.CALL, self._seqid)
+ args = ps_info_args()
+ args.pidfile = pidfile
+ args.index_code = index_code
+ args.base_port = base_port
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_ps_info(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = ps_info_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ne != None:
+ raise result.ne
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "ps_info failed: unknown result");
+
+
+class Processor(Iface, TProcessor):
+ def __init__(self, handler):
+ self._handler = handler
+ self._processMap = {}
+ self._processMap["start_engine"] = Processor.process_start_engine
+ self._processMap["kill_engine"] = Processor.process_kill_engine
+ self._processMap["get_worker_mount_stats"] = Processor.process_get_worker_mount_stats
+ self._processMap["get_worker_load_stats"] = Processor.process_get_worker_load_stats
+ self._processMap["get_worker_index_stats"] = Processor.process_get_worker_index_stats
+ self._processMap["stats"] = Processor.process_stats
+ self._processMap["update_worker"] = Processor.process_update_worker
+ self._processMap["restart_controller"] = Processor.process_restart_controller
+ self._processMap["head"] = Processor.process_head
+ self._processMap["tail"] = Processor.process_tail
+ self._processMap["ps_info"] = Processor.process_ps_info
+
+ def process(self, iprot, oprot):
+ (name, type, seqid) = iprot.readMessageBegin()
+ if name not in self._processMap:
+ iprot.skip(TType.STRUCT)
+ iprot.readMessageEnd()
+ x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+ oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+ x.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+ return
+ else:
+ self._processMap[name](self, seqid, iprot, oprot)
+ return True
+
+ def process_start_engine(self, seqid, iprot, oprot):
+ args = start_engine_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = start_engine_result()
+ try:
+ result.success = self._handler.start_engine(args.json_configuration)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("start_engine", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_kill_engine(self, seqid, iprot, oprot):
+ args = kill_engine_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = kill_engine_result()
+ try:
+ result.success = self._handler.kill_engine(args.index_code, args.base_port)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("kill_engine", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_worker_mount_stats(self, seqid, iprot, oprot):
+ args = get_worker_mount_stats_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_worker_mount_stats_result()
+ try:
+ result.success = self._handler.get_worker_mount_stats()
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("get_worker_mount_stats", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_worker_load_stats(self, seqid, iprot, oprot):
+ args = get_worker_load_stats_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_worker_load_stats_result()
+ try:
+ result.success = self._handler.get_worker_load_stats()
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("get_worker_load_stats", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_worker_index_stats(self, seqid, iprot, oprot):
+ args = get_worker_index_stats_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_worker_index_stats_result()
+ try:
+ result.success = self._handler.get_worker_index_stats(args.index_code, args.port)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("get_worker_index_stats", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_stats(self, seqid, iprot, oprot):
+ args = stats_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = stats_result()
+ try:
+ self._handler.stats()
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("stats", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_update_worker(self, seqid, iprot, oprot):
+ args = update_worker_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = update_worker_result()
+ result.success = self._handler.update_worker(args.source_host)
+ oprot.writeMessageBegin("update_worker", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_restart_controller(self, seqid, iprot, oprot):
+ args = restart_controller_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = restart_controller_result()
+ self._handler.restart_controller()
+ oprot.writeMessageBegin("restart_controller", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_head(self, seqid, iprot, oprot):
+ args = head_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = head_result()
+ try:
+ result.success = self._handler.head(args.file, args.lines, args.index_code, args.base_port)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("head", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_tail(self, seqid, iprot, oprot):
+ args = tail_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = tail_result()
+ try:
+ result.success = self._handler.tail(args.file, args.lines, args.index_code, args.base_port)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("tail", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_ps_info(self, seqid, iprot, oprot):
+ args = ps_info_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = ps_info_result()
+ try:
+ result.success = self._handler.ps_info(args.pidfile, args.index_code, args.base_port)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("ps_info", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class start_engine_args:
+ """
+ Attributes:
+ - json_configuration
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'json_configuration', None, None, ), # 1
+ )
+
+ def __init__(self, json_configuration=None,):
+ self.json_configuration = json_configuration
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.json_configuration = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('start_engine_args')
+ if self.json_configuration != None:
+ oprot.writeFieldBegin('json_configuration', TType.STRING, 1)
+ oprot.writeString(self.json_configuration)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class start_engine_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.BOOL, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.BOOL:
+ self.success = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('start_engine_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.BOOL, 0)
+ oprot.writeBool(self.success)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class kill_engine_args:
+ """
+ Attributes:
+ - index_code
+ - base_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'index_code', None, None, ), # 1
+ (2, TType.I32, 'base_port', None, None, ), # 2
+ )
+
+ def __init__(self, index_code=None, base_port=None,):
+ self.index_code = index_code
+ self.base_port = base_port
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.index_code = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.base_port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('kill_engine_args')
+ if self.index_code != None:
+ oprot.writeFieldBegin('index_code', TType.STRING, 1)
+ oprot.writeString(self.index_code)
+ oprot.writeFieldEnd()
+ if self.base_port != None:
+ oprot.writeFieldBegin('base_port', TType.I32, 2)
+ oprot.writeI32(self.base_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class kill_engine_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('kill_engine_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class get_worker_mount_stats_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_mount_stats_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class get_worker_mount_stats_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (WorkerMountStats, WorkerMountStats.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = WorkerMountStats()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_mount_stats_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class get_worker_load_stats_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_load_stats_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class get_worker_load_stats_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (WorkerLoadStats, WorkerLoadStats.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = WorkerLoadStats()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_load_stats_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class get_worker_index_stats_args:
+ """
+ Attributes:
+ - index_code
+ - port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'index_code', None, None, ), # 1
+ (2, TType.I32, 'port', None, None, ), # 2
+ )
+
+ def __init__(self, index_code=None, port=None,):
+ self.index_code = index_code
+ self.port = port
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.index_code = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_index_stats_args')
+ if self.index_code != None:
+ oprot.writeFieldBegin('index_code', TType.STRING, 1)
+ oprot.writeString(self.index_code)
+ oprot.writeFieldEnd()
+ if self.port != None:
+ oprot.writeFieldBegin('port', TType.I32, 2)
+ oprot.writeI32(self.port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class get_worker_index_stats_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (IndexStats, IndexStats.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = IndexStats()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_worker_index_stats_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class stats_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('stats_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class stats_result:
+ """
+ Attributes:
+ - ne
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, ne=None,):
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('stats_result')
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class update_worker_args:
+ """
+ Attributes:
+ - source_host
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'source_host', None, None, ), # 1
+ )
+
+ def __init__(self, source_host=None,):
+ self.source_host = source_host
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.source_host = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('update_worker_args')
+ if self.source_host != None:
+ oprot.writeFieldBegin('source_host', TType.STRING, 1)
+ oprot.writeString(self.source_host)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class update_worker_result:
+ """
+ Attributes:
+ - success
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('update_worker_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(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__.iteritems()]
+ 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)
+
+class restart_controller_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('restart_controller_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class restart_controller_result:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('restart_controller_result')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class head_args:
+ """
+ Attributes:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'file', None, None, ), # 1
+ (2, TType.I32, 'lines', None, 10, ), # 2
+ (3, TType.STRING, 'index_code', None, "", ), # 3
+ (4, TType.I32, 'base_port', None, 0, ), # 4
+ )
+
+ def __init__(self, file=None, lines=thrift_spec[2][4], index_code=thrift_spec[3][4], base_port=thrift_spec[4][4],):
+ self.file = file
+ self.lines = lines
+ self.index_code = index_code
+ self.base_port = base_port
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.file = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.lines = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.index_code = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.base_port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('head_args')
+ if self.file != None:
+ oprot.writeFieldBegin('file', TType.STRING, 1)
+ oprot.writeString(self.file)
+ oprot.writeFieldEnd()
+ if self.lines != None:
+ oprot.writeFieldBegin('lines', TType.I32, 2)
+ oprot.writeI32(self.lines)
+ oprot.writeFieldEnd()
+ if self.index_code != None:
+ oprot.writeFieldBegin('index_code', TType.STRING, 3)
+ oprot.writeString(self.index_code)
+ oprot.writeFieldEnd()
+ if self.base_port != None:
+ oprot.writeFieldBegin('base_port', TType.I32, 4)
+ oprot.writeI32(self.base_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class head_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('head_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class tail_args:
+ """
+ Attributes:
+ - file
+ - lines
+ - index_code
+ - base_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'file', None, None, ), # 1
+ (2, TType.I32, 'lines', None, 10, ), # 2
+ (3, TType.STRING, 'index_code', None, "", ), # 3
+ (4, TType.I32, 'base_port', None, 0, ), # 4
+ )
+
+ def __init__(self, file=None, lines=thrift_spec[2][4], index_code=thrift_spec[3][4], base_port=thrift_spec[4][4],):
+ self.file = file
+ self.lines = lines
+ self.index_code = index_code
+ self.base_port = base_port
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.file = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.lines = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.index_code = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.base_port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('tail_args')
+ if self.file != None:
+ oprot.writeFieldBegin('file', TType.STRING, 1)
+ oprot.writeString(self.file)
+ oprot.writeFieldEnd()
+ if self.lines != None:
+ oprot.writeFieldBegin('lines', TType.I32, 2)
+ oprot.writeI32(self.lines)
+ oprot.writeFieldEnd()
+ if self.index_code != None:
+ oprot.writeFieldBegin('index_code', TType.STRING, 3)
+ oprot.writeString(self.index_code)
+ oprot.writeFieldEnd()
+ if self.base_port != None:
+ oprot.writeFieldBegin('base_port', TType.I32, 4)
+ oprot.writeI32(self.base_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class tail_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('tail_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
+
+class ps_info_args:
+ """
+ Attributes:
+ - pidfile
+ - index_code
+ - base_port
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'pidfile', None, "", ), # 1
+ (2, TType.STRING, 'index_code', None, "", ), # 2
+ (3, TType.I32, 'base_port', None, 0, ), # 3
+ )
+
+ def __init__(self, pidfile=thrift_spec[1][4], index_code=thrift_spec[2][4], base_port=thrift_spec[3][4],):
+ self.pidfile = pidfile
+ self.index_code = index_code
+ self.base_port = base_port
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.pidfile = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.index_code = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.base_port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ps_info_args')
+ if self.pidfile != None:
+ oprot.writeFieldBegin('pidfile', TType.STRING, 1)
+ oprot.writeString(self.pidfile)
+ oprot.writeFieldEnd()
+ if self.index_code != None:
+ oprot.writeFieldBegin('index_code', TType.STRING, 2)
+ oprot.writeString(self.index_code)
+ oprot.writeFieldEnd()
+ if self.base_port != None:
+ oprot.writeFieldBegin('base_port', TType.I32, 3)
+ oprot.writeI32(self.base_port)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class ps_info_result:
+ """
+ Attributes:
+ - success
+ - ne
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ne=None,):
+ self.success = success
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ne = NebuException()
+ self.ne.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ps_info_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ne != None:
+ oprot.writeFieldBegin('ne', TType.STRUCT, 1)
+ self.ne.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__.iteritems()]
+ 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)
View
99 gen-py/flaptor/indextank/rpc/DeployManager-remote
@@ -0,0 +1,99 @@
+#!/usr/bin/env python
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+import sys
+import pprint
+from urlparse import urlparse
+from thrift.transport import TTransport
+from thrift.transport import TSocket
+from thrift.transport import THttpClient
+from thrift.protocol import TBinaryProtocol
+
+import DeployManager
+from ttypes import *
+
+if len(sys.argv) <= 1 or sys.argv[1] == '--help':
+ print ''
+ print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
+ print ''
+ print 'Functions:'
+ print ' void service_deploys()'
+ print ' void delete_index(string index_code)'
+ print ' void redeploy_index(string index_code)'
+ print ''
+ sys.exit(0)
+
+pp = pprint.PrettyPrinter(indent = 2)
+host = 'localhost'
+port = 9090
+uri = ''
+framed = False
+http = False
+argi = 1
+
+if sys.argv[argi] == '-h':
+ parts = sys.argv[argi+1].split(':')
+ host = parts[0]
+ port = int(parts[1])
+ argi += 2
+
+if sys.argv[argi] == '-u':
+ url = urlparse(sys.argv[argi+1])
+ parts = url[1].split(':')
+ host = parts[0]
+ if len(parts) > 1:
+ port = int(parts[1])
+ else:
+ port = 80
+ uri = url[2]
+ if url[4]:
+ uri += '?%s' % url[4]
+ http = True
+ argi += 2
+
+if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
+ framed = True
+ argi += 1
+
+cmd = sys.argv[argi]
+args = sys.argv[argi+1:]
+
+if http:
+ transport = THttpClient.THttpClient(host, port, uri)
+else:
+ socket = TSocket.TSocket(host, port)
+ if framed:
+ transport = TTransport.TFramedTransport(socket)
+ else:
+ transport = TTransport.TBufferedTransport(socket)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = DeployManager.Client(protocol)
+transport.open()
+
+if cmd == 'service_deploys':
+ if len(args) != 0:
+ print 'service_deploys requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.service_deploys())
+
+elif cmd == 'delete_index':
+ if len(args) != 1:
+ print 'delete_index requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.delete_index(args[0],))
+
+elif cmd == 'redeploy_index':
+ if len(args) != 1:
+ print 'redeploy_index requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.redeploy_index(args[0],))
+
+else:
+ print 'Unrecognized method %s' % cmd
+ sys.exit(1)
+
+transport.close()
View
535 gen-py/flaptor/indextank/rpc/DeployManager.py
@@ -0,0 +1,535 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class Iface:
+ def service_deploys(self, ):
+ pass
+
+ def delete_index(self, index_code):
+ """
+ Parameters:
+ - index_code
+ """
+ pass
+
+ def redeploy_index(self, index_code):
+ """
+ Parameters:
+ - index_code
+ """
+ pass
+
+
+class Client(Iface):
+ def __init__(self, iprot, oprot=None):
+ self._iprot = self._oprot = iprot
+ if oprot != None:
+ self._oprot = oprot
+ self._seqid = 0
+
+ def service_deploys(self, ):
+ self.send_service_deploys()
+ self.recv_service_deploys()
+
+ def send_service_deploys(self, ):
+ self._oprot.writeMessageBegin('service_deploys', TMessageType.CALL, self._seqid)
+ args = service_deploys_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_service_deploys(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = service_deploys_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.ne != None:
+ raise result.ne
+ return
+
+ def delete_index(self, index_code):
+ """
+ Parameters:
+ - index_code
+ """
+ self.send_delete_index(index_code)
+ self.recv_delete_index()
+
+ def send_delete_index(self, index_code):
+ self._oprot.writeMessageBegin('delete_index', TMessageType.CALL, self._seqid)
+ args = delete_index_args()
+ args.index_code = index_code
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_delete_index(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = delete_index_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.ne != None:
+ raise result.ne
+ return
+
+ def redeploy_index(self, index_code):
+ """
+ Parameters:
+ - index_code
+ """
+ self.send_redeploy_index(index_code)
+ self.recv_redeploy_index()
+
+ def send_redeploy_index(self, index_code):
+ self._oprot.writeMessageBegin('redeploy_index', TMessageType.CALL, self._seqid)
+ args = redeploy_index_args()
+ args.index_code = index_code
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_redeploy_index(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = redeploy_index_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.ne != None:
+ raise result.ne
+ return
+
+
+class Processor(Iface, TProcessor):
+ def __init__(self, handler):
+ self._handler = handler
+ self._processMap = {}
+ self._processMap["service_deploys"] = Processor.process_service_deploys
+ self._processMap["delete_index"] = Processor.process_delete_index
+ self._processMap["redeploy_index"] = Processor.process_redeploy_index
+
+ def process(self, iprot, oprot):
+ (name, type, seqid) = iprot.readMessageBegin()
+ if name not in self._processMap:
+ iprot.skip(TType.STRUCT)
+ iprot.readMessageEnd()
+ x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+ oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+ x.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+ return
+ else:
+ self._processMap[name](self, seqid, iprot, oprot)
+ return True
+
+ def process_service_deploys(self, seqid, iprot, oprot):
+ args = service_deploys_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = service_deploys_result()
+ try:
+ self._handler.service_deploys()
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("service_deploys", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_delete_index(self, seqid, iprot, oprot):
+ args = delete_index_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = delete_index_result()
+ try:
+ self._handler.delete_index(args.index_code)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("delete_index", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_redeploy_index(self, seqid, iprot, oprot):
+ args = redeploy_index_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = redeploy_index_result()
+ try:
+ self._handler.redeploy_index(args.index_code)
+ except NebuException, ne:
+ result.ne = ne
+ oprot.writeMessageBegin("redeploy_index", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class service_deploys_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('service_deploys_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ 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)
+
+class service_deploys_result:
+ """
+ Attributes:
+ - ne
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ne', (NebuException, NebuException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, ne=None,):
+ self.ne = ne
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary i