title: Multiples Hadoop FileSystem instances
body: <p>I have a class (I removes try/catch for readability):</p>
  
  <pre><code>public class HadoopFileSystem {
  
      private FileSystem m_fileSystem = null;
  
      public HadoopFileSystem() {
          Configuration l_configuration = new Configuration();
          l_configuration .set("fs.default.name", "hdfs://localhost:9100");
          l_configuration .set("mapred.job.tracker", "localhost:9101");
  
          m_fileSystem = FileSystem.get(l_configuration );
  
      }
  
      public void close() {
          m_fileSystem.close();
      }
  
      public void createFile(String a_pathDFS) {
          m_fileSystem.create(new Path(a_pathDFS));
      }
  
  }
  </code></pre>
  
  <p>In my program, I a first <code>HadoopFileSysem</code> object, <strong>I don't close it</strong>.</p>
  
  <p>Then I create a second <code>HadoopFileSysem</code> object, and I close it.</p>
  
  <p>Finally, when I want to use a function on <code>m_fileSystem</code> in my first object, I have the error : <code>java.io.IOException: Filesystem closed</code></p>
  
  <p>But I did'nt close it !</p>
  
  <p>Here's a little code to illustrate my problem :</p>
  
  <pre><code>HadoopFileSystem h1 = new HadoopFileSystem();
  HadoopFileSystem h2 = new HadoopFileSystem();
  
  if(h1 == h2)
      System.out.println("=="); // No print
  if(h1.equals(h2))
      System.out.println("equals"); // No print
  
  h2.close();
  h1.createFile("test.test"); // ERROR : java.io.IOException: Filesystem closed
  h1.close();
  </code></pre>
  
  <p>Why ?</p>