System.exit(1);
}
}
HBaseConfiguration conf = new HBaseConfiguration();
ConsoleReader reader = new ConsoleReader();
System.setSecurityManager(new HQLSecurityManager());
reader.setBellEnabled(conf.getBoolean("hbaseshell.jline.bell.enabled",
DEFAULT_BELL_ENABLED));
Writer out = new OutputStreamWriter(System.out, "UTF-8");
TableFormatter tableFormater = new TableFormatterFactory(out, conf).get();
if (MASTER_ADDRESS != null) {
conf.set("hbase.master", MASTER_ADDRESS.substring(9, MASTER_ADDRESS.length()));
}
if (HTML_OPTION != null) {
tableFormater = new HtmlTableFormatter(out);
}
HelpCommand help = new HelpCommand(out, tableFormater);
if (args.length == 0 || !args[0].equals(String.valueOf(Shell.RELAUNCH_FLAG))) {
help.printVersion();
}
StringBuilder queryStr = new StringBuilder();
String extendedLine;
while ((extendedLine = reader.readLine(getPrompt(queryStr))) != null) {
if (isEndOfCommand(extendedLine)) {
queryStr.append(" " + extendedLine);
long start = System.currentTimeMillis();
HQLClient hql = new HQLClient(conf, MASTER_ADDRESS, out, tableFormater);