From a8820b3edb836696cb829463d8941adac5ecb240 Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Tue, 23 Feb 2021 16:51:07 +0100 Subject: [PATCH] logs --- .../dnetlib/data/mdstore/manager/utils/HdfsClient.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/utils/HdfsClient.java b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/utils/HdfsClient.java index a761697a..170e060e 100644 --- a/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/utils/HdfsClient.java +++ b/apps/dhp-mdstore-manager/src/main/java/eu/dnetlib/data/mdstore/manager/utils/HdfsClient.java @@ -1,5 +1,6 @@ package eu.dnetlib.data.mdstore.manager.utils; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -42,6 +43,8 @@ public class HdfsClient { try (final FileSystem fs = FileSystem.get(conf())) { fs.delete(new Path(path), true); log.info("HDFS Path deleted: " + path); + } catch (final FileNotFoundException e) { + log.warn("Missing path: " + hdfsBasePath); } catch (IllegalArgumentException | IOException e) { log.error("Eror deleting path: " + path, e); throw new MDStoreManagerException("Eror deleting path: " + path, e); @@ -62,6 +65,8 @@ public class HdfsClient { } } } + } catch (final FileNotFoundException e) { + log.warn("Missing path: " + hdfsBasePath); } catch (final Exception e) { log.error("Error Listing path: " + hdfsBasePath, e); } @@ -82,6 +87,8 @@ public class HdfsClient { res.add(String.format("%s/%s", path, f.getPath().getName())); } } + } catch (final FileNotFoundException e) { + log.warn("Missing path: " + hdfsBasePath); } catch (final Exception e) { log.error("Error Listing path: " + path, e); } @@ -120,6 +127,8 @@ public class HdfsClient { list.add(map); log.debug("added record"); } + } catch (final FileNotFoundException e) { + log.warn("Missing path: " + hdfsBasePath); } catch (final Throwable e) { log.error("Error reading parquet file: " + f, e); throw new MDStoreManagerException("Error reading parquet file: " + f, e);