Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.druid.java.util.common.logger.Logger;

import java.io.IOException;
import java.lang.reflect.Method;

/**
* This wrapper class is created to be able to access some of the the "protected" methods inside Hadoop's
Expand All @@ -48,10 +49,11 @@ private HadoopFsWrapper() {}
public static boolean rename(FileSystem fs, Path from, Path to) throws IOException
{
try {
fs.rename(from, to, Options.Rename.NONE);
Method renameMethod = fs.getClass().getMethod("rename", Path.class, Path.class, Options.Rename[].class);
renameMethod.invoke(fs, from, to, new Options.Rename[]{Options.Rename.NONE});
return true;
}
catch (IOException ex) {
catch (Exception ex) {
log.warn(ex, "Failed to rename [%s] to [%s].", from, to);
return false;
}
Expand Down