package hadoopmongo;

import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hive.service.server.HiveServer2;

public class HiveServer2Launcher {

    public static void main(String[] args) {
        HiveConf hiveConf = new HiveConf();
        hiveConf.set("javax.jdo.option.ConnectionURL", "jdbc:derby:;databaseName=metastore_db;create=true");
        hiveConf.set("javax.jdo.option.ConnectionDriverName", "org.apache.derby.jdbc.EmbeddedDriver");
        hiveConf.set("hive.metastore.warehouse.dir", "file:///tmp");
        hiveConf.set("hive.server2.thrift.port", "11000");

        /*<!--hive.metastore.local=true
                mapreduce.framework.name=yarn
                hive.exec.submitviachild=false-->
                hive.debug.localtask=true
                hive.auto.convert.join.use.nonstaged=true*/
        HiveServer2 server = new HiveServer2();
        server.init(hiveConf);
        server.start();
    }
}

@@ -60,16 +60,133 @@
 veConf;%0A
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars;%0Aimport org.apache.hive.service.auth.HiveAuthFactory.AuthTypes;%0A
 import o
@@ -228,16 +228,16 @@
 erver2;%0A
-
 %0Apublic 
@@ -635,32 +635,34 @@
 /tmp%22);%0A        
+//
 hiveConf.set(%22hi
@@ -693,11 +693,393 @@
  %2211
+1
 00
-0
+%22);%0A        hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false);%0A        hiveConf.setVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST, %22localhost%22);%0A        hiveConf.setIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT, 11100);%0A        hiveConf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION, AuthTypes.NONE.toString());%0A        hiveConf.setVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE, %22binary
 %22);%0A

Add HiveServer2 launcher