From 4c8dac4db6d46e5b61affa35c3d6856352ccdafd Mon Sep 17 00:00:00 2001 From: Maarten Wullink Date: Tue, 9 Jun 2020 10:47:25 +0200 Subject: [PATCH] Fixes #126 --- .../entrada/file/HDFSFileManagerImpl.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/nl/sidnlabs/entrada/file/HDFSFileManagerImpl.java b/src/main/java/nl/sidnlabs/entrada/file/HDFSFileManagerImpl.java index a010a8c..eb353de 100644 --- a/src/main/java/nl/sidnlabs/entrada/file/HDFSFileManagerImpl.java +++ b/src/main/java/nl/sidnlabs/entrada/file/HDFSFileManagerImpl.java @@ -64,17 +64,15 @@ public String schema() { @Override public void close() { // close filesystem - if (fs == null) { - // do nothing, not using hdfs fs - return; + if (fs != null) { + try { + fs.close(); + fs = null; + } catch (Exception e) { + log.error("Error while closing filesystem", e); + } } - try { - fs.close(); - fs = null; - } catch (Exception e) { - log.error("Error while closing filesystem", e); - } // close filesystem internal cache try { FileSystem.closeAll();