Skip to content

Instantly share code, notes, and snippets.

@wesfloyd
Created April 27, 2015 14:44
Show Gist options
  • Save wesfloyd/9001a65f5cdaf134352d to your computer and use it in GitHub Desktop.
Save wesfloyd/9001a65f5cdaf134352d to your computer and use it in GitHub Desktop.
Sample script used to Probe HS2 service for availability
import sys
import subprocess
from subprocess import call
###################################################
# Edit the variables below to match your environment
###################################################
hs2Host = 'localhost'
hs2Port = '10000'
userName = 'root'
###################################################
beelineArgs = ['beeline', '-u', 'jdbc:hive2://'+ hs2Host + ':' + hs2Port , '-n' , userName , '-e' , 'show tables' ];
cmd_out, cmd_err = subprocess.Popen(beelineArgs, stdout=subprocess.PIPE).communicate()
if cmd_out:
print 'cmd_out\n' + cmd_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment