Beispiel #1
0
  public void initConf() throws Exception {
    // Plug verifying metastore in for testing.
    conf.setVar(
        HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL,
        "org.apache.hadoop.hive.metastore.VerifyingObjectStore");

    if (mr != null) {
      assert dfs != null;

      mr.setupConfiguration(conf);

      // set fs.default.name to the uri of mini-dfs
      String dfsUriString =
          WindowsPathUtil.getHdfsUriString(dfs.getFileSystem().getUri().toString());
      conf.setVar(HiveConf.ConfVars.HADOOPFS, dfsUriString);
      // hive.metastore.warehouse.dir needs to be set relative to the mini-dfs
      conf.setVar(
          HiveConf.ConfVars.METASTOREWAREHOUSE,
          (new Path(dfsUriString, "/build/ql/test/data/warehouse/")).toString());
    }

    // Windows paths should be converted after MiniMrShim.setupConfiguration()
    // since setupConfiguration may overwrite configuration values.
    if (Shell.WINDOWS) {
      WindowsPathUtil.convertPathsFromWindowsToHdfs(conf);
    }
  }
Beispiel #2
0
 public void shutdown() throws Exception {
   cleanUp();
   setup.tearDown();
   if (mr != null) {
     mr.shutdown();
     mr = null;
   }
   FileSystem.closeAll();
   if (dfs != null) {
     dfs.shutdown();
     dfs = null;
   }
 }