HDFS-13529. Fix default trash policy emptier trigger time correctly. Contributed by He Xiaoqiao.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>
(cherry picked from commit f86de6f76a)
(cherry picked from commit 555b56c0421be84efd09221db2b3f26c8b44ed45)
This commit is contained in:
He Xiaoqiao 2019-08-01 14:53:56 -07:00 committed by Wei-Chiu Chuang
parent 639763c561
commit 5d35393912
1 changed files with 2 additions and 2 deletions

View File

@ -262,9 +262,9 @@ public class TrashPolicyDefault extends TrashPolicy {
public void run() {
if (emptierInterval == 0)
return; // trash disabled
long now = Time.now();
long end;
long now, end;
while (true) {
now = Time.now();
end = ceiling(now, emptierInterval);
try { // sleep for interval
Thread.sleep(end - now);