Permalink
Browse files

Added flaptor.indextank.rpc generated py thrift

  • Loading branch information...
1 parent 99edd35 commit 6e0ff7588a5ea1c78a10da8c225fac361e1269c2 @ghosthack ghosthack committed Dec 26, 2011
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
No changes.
No changes.
No changes.
@@ -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()
Oops, something went wrong.

0 comments on commit 6e0ff75

Please sign in to comment.