use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestJdbcWithLocalClusterSpark method beforeTest.
@BeforeClass
public static void beforeTest() throws Exception {
Class.forName(MiniHS2.getJdbcDriverName());
conf = createHiveConf();
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(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
miniHS2 = new MiniHS2(conf, MiniClusterType.MR);
Map<String, String> overlayProps = new HashMap<String, String>();
overlayProps.put(ConfVars.HIVE_SERVER2_SESSION_HOOK.varname, LocalClusterSparkSessionHook.class.getName());
miniHS2.start(overlayProps);
createDb();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestMultiSessionsHS2WithLocalClusterSpark method beforeTest.
@BeforeClass
public static void beforeTest() throws Exception {
Class.forName(MiniHS2.getJdbcDriverName());
conf = createHiveConf();
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(ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
miniHS2 = new MiniHS2(conf, MiniClusterType.MR);
Map<String, String> overlayProps = new HashMap<String, String>();
overlayProps.put(ConfVars.HIVE_SERVER2_SESSION_HOOK.varname, LocalClusterSparkSessionHook.class.getName());
miniHS2.start(overlayProps);
createDb();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestNoSaslAuth method beforeTest.
@BeforeClass
public static void beforeTest() throws Exception {
Class.forName(MiniHS2.getJdbcDriverName());
HiveConf conf = new HiveConf();
conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
conf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false);
conf.setVar(ConfVars.HIVE_SERVER2_SESSION_HOOK, NoSaslSessionHook.class.getName());
conf.setVar(ConfVars.HIVE_SERVER2_AUTHENTICATION, "NOSASL");
miniHS2 = new MiniHS2(conf);
Map<String, String> overlayProps = new HashMap<String, String>();
miniHS2.start(overlayProps);
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestSSL method testMetastoreWithSSL.
/**
* Test HMS server with SSL
* @throws Exception
*/
@Test
public void testMetastoreWithSSL() throws Exception {
setMetastoreSslConf(conf);
setSslConfOverlay(confOverlay);
// Test in http mode
setHttpConfOverlay(confOverlay);
miniHS2 = new MiniHS2.Builder().withRemoteMetastore().withConf(conf).cleanupLocalDirOnStartup(false).build();
miniHS2.start(confOverlay);
String tableName = "sslTab";
Path dataFilePath = new Path(dataFileDir, "kv1.txt");
// make SSL connection
hs2Conn = DriverManager.getConnection(miniHS2.getJdbcURL("default", SSL_CONN_PARAMS), System.getProperty("user.name"), "bar");
// Set up test data
setupTestTableWithData(tableName, dataFilePath, hs2Conn);
Statement stmt = hs2Conn.createStatement();
ResultSet res = stmt.executeQuery("SELECT * FROM " + tableName);
int rowCount = 0;
while (res.next()) {
++rowCount;
assertEquals("val_" + res.getInt(1), res.getString(2));
}
// read result over SSL
assertEquals(500, rowCount);
hs2Conn.close();
}
use of org.apache.hive.jdbc.miniHS2.MiniHS2 in project hive by apache.
the class TestBeelinePasswordOption method preTests.
/**
* Start up a local Hive Server 2 for these tests
*/
@BeforeClass
public static void preTests() throws Exception {
HiveConf hiveConf = new HiveConf();
// Set to non-zk lock manager to prevent HS2 from trying to connect
hiveConf.setVar(HiveConf.ConfVars.HIVE_LOCK_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager");
miniHS2 = new MiniHS2(hiveConf);
miniHS2.start(new HashMap<String, String>());
createTable();
}
Aggregations