Handle MountPointNotFoundException when determining files in target for File Distcp
Handle scenario where target directory cannot
determine target files to copy but does not return
a file not found exception for viewfs support
Add logging of exception caught
Closes from Will-Lo/use-ioexception-file-
distcp
package org.apache.gobblin.data.management.copy;
+import lombok.extern.slf4j.Slf4j;
import org.apache.gobblin.commit.CommitStep;
import org.apache.gobblin.data.management.copy.entities.PrePublishStep;
import org.apache.gobblin.data.management.dataset.DatasetUtils;
@@ -47,6 +48,7 @@ import com.google.common.collect.Maps;
* Implementation of {@link CopyableDataset} that creates a {@link CopyableFile} for every file that is a descendant if
* the root directory.
*/
+@Slf4j
public class RecursiveCopyableDataset implements CopyableDataset, FileSystemDataset {
private static final String CONFIG_PREFIX = CopyConfiguration.COPY_PREFIX + ".recursive";
@@ -179,7 +181,8 @@ public class RecursiveCopyableDataset implements CopyableDataset, FileSystemData
try {
return FileListUtils
.listFilesToCopyAtPath(fs, path, fileFilter, applyFilterToDirectories, includeEmptyDirectories);
- } catch (FileNotFoundException fnfe) {
+ } catch (IOException e) {
+ log.info(String.format("Could not find any files on target path due to %s. Returning an empty list of files.", e.getClass().getCanonicalName()));
return Lists.newArrayList();
}
}
