diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java index 01d6cfe3204..9bb07bbae9c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java @@ -1645,11 +1645,10 @@ public abstract class FSUtils { } } - public static boolean renameAndSetModifyTime(final FileSystem fs, Path src, Path dest) + public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final Path dest) throws IOException { - if (!fs.rename(src, dest)) return false; // set the modify time for TimeToLive Cleaner - fs.setTimes(dest, EnvironmentEdgeManager.currentTimeMillis(), -1); - return true; + fs.setTimes(src, EnvironmentEdgeManager.currentTimeMillis(), -1); + return fs.rename(src, dest); } }