diff --git a/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java b/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java index ec14aa1..aa04c4b 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java +++ b/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotFileCache.java @@ -94,7 +94,8 @@ public class SnapshotFileCache implements Stoppable { new HashMap(); private final Timer refreshTimer; - private long lastModifiedTime = Long.MIN_VALUE; + private long snapshotModifiedTime = Long.MIN_VALUE; + private long tempModifiedTime = Long.MIN_VALUE; /** * Create a snapshot file cache for all snapshots under the specified [root]/.snapshot on the @@ -202,8 +203,8 @@ public class SnapshotFileCache implements Stoppable { } // if the snapshot directory wasn't modified since we last check, we are done - if (dirStatus.getModificationTime() <= lastModifiedTime && - tempStatus.getModificationTime() <= lastModifiedTime) { + if (dirStatus.getModificationTime() <= snapshotModifiedTime && + tempStatus.getModificationTime() <= tempModifiedTime) { return; } @@ -213,8 +214,8 @@ public class SnapshotFileCache implements Stoppable { // However, snapshot directories are only created once, so this isn't an issue. // 1. update the modified time - this.lastModifiedTime = Math.min(dirStatus.getModificationTime(), - tempStatus.getModificationTime()); + this.snapshotModifiedTime = dirStatus.getModificationTime(); + this.tempModifiedTime = tempStatus.getModificationTime(); // 2.clear the cache this.cache.clear();