コード例 #1
0
 public static DistributedFileSystem getDFS(Configuration conf, FileSystem dfs)
     throws IOException {
   Configuration clientConf = new Configuration(conf);
   clientConf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
   clientConf.setBoolean("fs.hdfs.impl.disable.cache", true);
   URI dfsUri = dfs.getUri();
   FileSystem.closeAll();
   return (DistributedFileSystem) FileSystem.get(dfsUri, clientConf);
 }
コード例 #2
0
ファイル: HiveTestUtil.java プロジェクト: babartareen/phoenix
 public void shutdown() throws Exception {
   cleanUp();
   setup.tearDown();
   if (mr != null) {
     mr.shutdown();
     mr = null;
   }
   FileSystem.closeAll();
   if (dfs != null) {
     dfs.shutdown();
     dfs = null;
   }
 }
コード例 #3
0
 @After
 public void stopCluster() throws Exception {
   try {
     if (this.executor != null) {
       this.executor.stop();
       this.executor = null;
       FileSystem.closeAll();
       System.gc();
     }
   } finally {
     deleteAllTempFiles();
   }
 }
コード例 #4
0
  @AfterClass
  public static void teardownClass() throws Exception {
    System.clearProperty("solr.hdfs.blockcache.enabled");
    System.clearProperty("test.build.dir");
    System.clearProperty("test.build.data");
    System.clearProperty("test.cache.data");

    if (mrCluster != null) {
      mrCluster.shutdown();
      mrCluster = null;
    }
    if (dfsCluster != null) {
      dfsCluster.shutdown();
      dfsCluster = null;
    }

    FileSystem.closeAll();
  }
コード例 #5
0
ファイル: HdfsFileWriter.java プロジェクト: khsibr/hadoop
 public void close() throws IOException {
   FileSystem.closeAll();
 }