Package org.apache.hadoop.fs.FileSystem.Cache

Examples of org.apache.hadoop.fs.FileSystem.Cache.Key


    /** A variable that makes all objects in the cache unique */
    private static AtomicLong unique = new AtomicLong(1);

    FileSystem get(URI uri, Configuration conf) throws IOException{
      Key key = new Key(uri, conf);
      return getInternal(uri, conf, key);
    }
View Full Code Here


      return getInternal(uri, conf, key);
    }

    /** The objects inserted into the cache using this method are all unique */
    FileSystem getUnique(URI uri, Configuration conf) throws IOException{
      Key key = new Key(uri, conf, unique.getAndIncrement());
      return getInternal(uri, conf, key);
    }
View Full Code Here

    /**
     * Remove removes the given fs from the cache.
     */
    synchronized void remove(FileSystem fs) {
      Key key = fs.key;
      if (fs == map.get(key)) {
        map.remove(key);
        disableShutdownHook(fs);
      }
    }
View Full Code Here

      List<FileSystem> targetFSList = new ArrayList<FileSystem>();
      //Make a pass over the list and collect the filesystems to close
      //we cannot close inline since close() removes the entry from the Map
      synchronized(this) {
        for (Map.Entry<Key, FileSystem> entry : map.entrySet()) {
          final Key key = entry.getKey();
          final FileSystem fs = entry.getValue();
          if (select.needClose(fs)) {
            targetFSList.add(fs);
          }
        }
View Full Code Here

      public boolean equals(Object obj) {
        if (obj == this) {
          return true;
        }
        if (obj != null && obj instanceof Key) {
          Key that = (Key)obj;
          return isEqual(this.scheme, that.scheme)
                 && isEqual(this.authority, that.authority)
                 && isEqual(this.username, that.username)
                 && (this.unique == that.unique);
        }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.FileSystem.Cache.Key

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.