PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/metastore/scripts/hive.metastore_ctrl

#
text | 32 lines | 27 code | 5 blank | 0 comment | 0 complexity | 02b0484f4592f2b7bc0d524f37963f66 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. #!/usr/bin/env python
  2. # chkconfig: 2345 90 20
  3. # description: hive metastore
  4. import sys
  5. sys.path.append('/usr/local/fbprojects/fb303/scripts')
  6. import fb303_scripts
  7. # thrift python packages need to be installed
  8. import thrift
  9. from thrift import protocol, transport
  10. from thrift.transport import TTransport
  11. from thrift.protocol import TBinaryProtocol
  12. from thrift.transport import *
  13. if (len(sys.argv) > 2):
  14. port = int(sys.argv[2])
  15. else:
  16. port = 9082
  17. if (len(sys.argv) > 1):
  18. retval = fb303_scripts.service_ctrl('hive.metastore',
  19. port,
  20. sys.argv[1],
  21. binary_name = "start_meta_store_thrift_server.sh",
  22. trans_factory = thrift.transport.TTransport.TBufferedTransportFactory(),
  23. prot_factory = TBinaryProtocol.TBinaryProtocolFactory())
  24. sys.exit(retval)
  25. else:
  26. print 'metastore_ctrl requires a command: start, stop, restart, reload, force-reload, status, or version'
  27. sys.exit(2)