use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestJdbcWithMiniHA method beforeTest.
@BeforeClass
public static void beforeTest() throws Exception {
Class.forName(MiniHS2.getJdbcDriverName());
conf = new HiveConf();
conf.setBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
String dataFileDir = conf.get("test.data.files").replace('\\', '/').replace("c:", "");
dataFilePath = new Path(dataFileDir, "kv1.txt");
DriverManager.setLoginTimeout(0);
conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
miniHS2 = new MiniHS2.Builder().withConf(conf).withMiniMR().withHA().build();
Map<String, String> overlayProps = new HashMap<String, String>();
overlayProps.put(ConfVars.HIVE_SERVER2_SESSION_HOOK.varname, HATestSessionHook.class.getName());
miniHS2.start(overlayProps);
assertTrue(HAUtil.isHAEnabled(conf, DFSUtil.getNamenodeNameServiceId(conf)));
createDb();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestJdbcMetadataApiAuth method beforeTest.
@BeforeClass
public static void beforeTest() throws Exception {
Class.forName(MiniHS2.getJdbcDriverName());
HiveConf conf = new HiveConf();
conf.setVar(ConfVars.HIVE_AUTHORIZATION_MANAGER, TestAuthorizerFactory.class.getName());
conf.setVar(ConfVars.HIVE_AUTHENTICATOR_MANAGER, SessionStateUserAuthenticator.class.getName());
conf.setBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
conf.setBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
conf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false);
miniHS2 = new MiniHS2(conf);
miniHS2.start(new HashMap<String, String>());
TestAuthValidator.allowActions = true;
// set up a db and table
String tableName1 = TestJdbcMetadataApiAuth.class.getSimpleName() + "_tab";
String dbName1 = TestJdbcMetadataApiAuth.class.getSimpleName() + "_db";
// create connection as user1
Connection hs2Conn = getConnection("user1");
Statement stmt = hs2Conn.createStatement();
// create table, db
stmt.execute("create table " + tableName1 + "(i int) ");
stmt.execute("create database " + dbName1);
stmt.close();
hs2Conn.close();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestBeeLineWithArgs method preTests.
/**
* Start up a local Hive Server 2 for these tests
*/
@BeforeClass
public static void preTests() throws Exception {
HiveConf hiveConf = new HiveConf();
hiveConf.setVar(HiveConf.ConfVars.HIVE_LOCK_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager");
hiveConf.setBoolVar(HiveConf.ConfVars.HIVEOPTIMIZEMETADATAQUERIES, false);
hiveConf.set(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL.varname, "verbose");
miniHS2 = new MiniHS2(hiveConf, MiniClusterType.TEZ);
Map<String, String> confOverlay = new HashMap<String, String>();
miniHS2.start(confOverlay);
createTable();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestOperationLoggingLayout method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
tableName = "TestOperationLoggingLayout_table";
hiveConf = new HiveConf();
hiveConf.set(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL.varname, "execution");
miniHS2 = new MiniHS2(hiveConf);
confOverlay = new HashMap<String, String>();
confOverlay.put(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
miniHS2.start(confOverlay);
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestOperationLoggingAPIWithMr method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws Exception {
tableName = "testOperationLoggingAPIWithMr_table";
expectedLogsVerbose = new String[] { "Starting Semantic Analysis" };
expectedLogsExecution = new String[] { "Compiling command", "Completed compiling command", "Total jobs", "Executing command", "Completed executing command", "Semantic Analysis Completed", "Number of reduce tasks determined at compile time", "number of splits", "Submitting tokens for job", "Ended Job" };
expectedLogsPerformance = new String[] { "<PERFLOG method=compile from=org.apache.hadoop.hive.ql.Driver>", "<PERFLOG method=parse from=org.apache.hadoop.hive.ql.Driver>", "<PERFLOG method=Driver.run from=org.apache.hadoop.hive.ql.Driver>", "<PERFLOG method=runTasks from=org.apache.hadoop.hive.ql.Driver>" };
hiveConf = new HiveConf();
hiveConf.set(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL.varname, "verbose");
miniHS2 = new MiniHS2(hiveConf);
confOverlay = new HashMap<String, String>();
confOverlay.put(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
miniHS2.start(confOverlay);
}
Aggregations