Exemple #1
0
    if childProc is not None:
        childProc.terminate()
        childProc.kill()
        if os.name != 'nt':
            os.system("reset")
atexit.register(kill_child)

phoenix_utils.setPath()

parser = argparse.ArgumentParser(description='Launches the Apache Phoenix Client.')
# Positional argument 'zookeepers' is optional
parser.add_argument('zookeepers', nargs='?', help='The ZooKeeper quorum string', default='localhost:2181:/hbase')
# Positional argument 'sqlfile' is optional
parser.add_argument('sqlfile', nargs='?', help='A file of SQL commands to execute', default='')
# Common arguments across sqlline.py and sqlline-thin.py
phoenix_utils.common_sqlline_args(parser)
# Parse the args
args=parser.parse_args()

zookeeper = args.zookeepers
sqlfile = args.sqlfile

# HBase configuration folder path (where hbase-site.xml reside) for
# HBase/Phoenix client side property override
hbase_config_path = os.getenv('HBASE_CONF_DIR', phoenix_utils.current_dir)

if sqlfile and not os.path.isfile(sqlfile):
    parser.print_help()
    sys.exit(-1)

if sqlfile:
Exemple #2
0
parser.add_argument('-au',
                    '--auth-user',
                    help='Username for HTTP authentication.')
parser.add_argument('-ap',
                    '--auth-password',
                    help='Password for HTTP authentication.')
# Avatica HTTPS truststore
parser.add_argument(
    '-t',
    '--truststore',
    help='Truststore file that contains the TLS certificate of the server.')
parser.add_argument('-tp',
                    '--truststore-password',
                    help='Password for the server TLS certificate truststore')
# Common arguments across sqlline.py and sqlline-thin.py
phoenix_utils.common_sqlline_args(parser)
# Parse the args
args = parser.parse_args()

phoenix_utils.setPath()

url = args.url
sqlfile = args.sqlfile
serialization_key = 'phoenix.queryserver.serialization'


def cleanup_url(url):
    parsed = urlparse.urlparse(url)
    if parsed.scheme == "":
        url = "http://" + url
        parsed = urlparse.urlparse(url)