use of org.pentaho.di.core.osgi.api.VfsEmbeddedFileSystemCloser in project pentaho-kettle by pentaho.
the class ConcurrentFileSystemManager method closeEmbeddedFileSystem.
public void closeEmbeddedFileSystem(String embeddedMetastoreKey) {
lock.readLock().lock();
Map<String, FileProvider> providers;
try {
// Close the file system
java.lang.reflect.Field field = null;
try {
field = this.getClass().getSuperclass().getSuperclass().getDeclaredField("providers");
field.setAccessible(true);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
providers = (Map<String, FileProvider>) field.get(this);
FileProvider provider = providers.get("hc");
if (provider != null) {
((VfsEmbeddedFileSystemCloser) provider).closeFileSystem(embeddedMetastoreKey);
}
} catch (IllegalAccessException e) {
e.printStackTrace();
} finally {
lock.readLock().unlock();
}
}
Aggregations