List of usage examples for org.apache.hadoop.hdfs DFSUtil getNamenodeNameServiceId
public static String getNamenodeNameServiceId(Configuration conf)
From source file:org.apache.hive.jdbc.TestJdbcWithMiniHA.java
License:Apache License
@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);//ww w . j a v a 2 s . co m assertTrue(HAUtil.isHAEnabled(conf, DFSUtil.getNamenodeNameServiceId(conf))); createDb(); }