@Test public void listStatusClosed() throws IOException, AlluxioException { mThrown.expect(IOException.class); mThrown.expectMessage(FileSystemCache.InstanceCachingFileSystem.CLOSED_FS_ERROR_MESSAGE); Key key1 = createTestFSKey("user1"); FileSystem fs1 = mFileSystemCache.get(key1); fs1.close(); assertTrue(fs1.isClosed()); fs1.listStatus(new AlluxioURI("/")); }
public FileSystem get(Key key) { synchronized (mLock) { Value value = mCacheMap.get(key); FileSystem fs; if (value == null) { fs = FileSystem.Factory.create(FileSystemContext.create(key.mSubject, key.mConf)); mCacheMap.put(key, new Value(fs, 1)); } else { fs = value.mFileSystem; value.mRefCount.getAndIncrement(); } return new InstanceCachingFileSystem(fs, key); } }
FileSystemCache { public FileSystem get(Key key) { synchronized (mLock) { Value value = mCacheMap.get(key); FileSystem fs; if (value == null) { fs = FileSystem.Factory.create(FileSystemContext.create(key.mSubject, key.mConf)); mCacheMap.put(key, new Value(fs, 1)); } else { fs = value.mFileSystem; value.mRefCount.getAndIncrement(); } return new InstanceCachingFileSystem(fs, key); } } }
FileSystemCache { public FileSystem get(Key key) { synchronized (mLock) { Value value = mCacheMap.get(key); FileSystem fs; if (value == null) { fs = FileSystem.Factory.create(FileSystemContext.create(key.mSubject, key.mConf)); mCacheMap.put(key, new Value(fs, 1)); } else { fs = value.mFileSystem; value.mRefCount.getAndIncrement(); } return new InstanceCachingFileSystem(fs, key); } } FileSystemCache(); }
FileSystemCache { public FileSystem get(Key key) { synchronized (mLock) { Value value = mCacheMap.get(key); FileSystem fs; if (value == null) { fs = FileSystem.Factory.create(FileSystemContext.create(key.mSubject, key.mConf)); mCacheMap.put(key, new Value(fs, 1)); } else { fs = value.mFileSystem; value.mRefCount.getAndIncrement(); } return new InstanceCachingFileSystem(fs, key); } } FileSystemCache(); FileSystem get(Key key); }
FileSystemCache { public FileSystem get(Key key) { synchronized (mLock) { Value value = mCacheMap.get(key); FileSystem fs; if (value == null) { fs = FileSystem.Factory.create(FileSystemContext.create(key.mSubject, key.mConf)); mCacheMap.put(key, new Value(fs, 1)); } else { fs = value.mFileSystem; value.mRefCount.getAndIncrement(); } return new InstanceCachingFileSystem(fs, key); } } FileSystemCache(); FileSystem get(Key key);  }