use of org.apache.hive.service.server.HiveServer2 in project hive by apache.
the class ThriftCliServiceTestWithCookie method setUpBeforeClass.
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
// Find a free port
port = MetaStoreTestUtils.findFreePort();
hiveServer2 = new HiveServer2();
hiveConf = new HiveConf();
hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_AUTH_ENABLED, true);
// Set the cookie max age to a very low value so that
// the server sends 401 very frequently
hiveConf.setTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_MAX_AGE, 1, TimeUnit.SECONDS);
hiveConf.setVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE, "http");
hiveConf.setVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH, "cliservice");
assertNotNull(port);
assertNotNull(hiveServer2);
assertNotNull(hiveConf);
hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false);
hiveConf.setVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST, host);
hiveConf.setIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT, port);
hiveConf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION, HiveAuthConstants.AuthTypes.NOSASL.toString());
startHiveServer2WithConf(hiveConf);
client = getServiceClientInternal();
}
Aggregations