HDFS-12526. FSDirectory should use Time.monotonicNow for durations. Contributed by Bharat Viswanadham.

This commit is contained in:
Akira Ajisaka 2017-09-21 19:27:48 +09:00
parent 8b336632ac
commit 50849ec9eb
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50

View File

@ -752,7 +752,7 @@ void updateCountForQuota(int initThreads) {
try {
int threads = (initThreads < 1) ? 1 : initThreads;
LOG.info("Initializing quota with " + threads + " thread(s)");
long start = Time.now();
long start = Time.monotonicNow();
QuotaCounts counts = new QuotaCounts.Builder().build();
ForkJoinPool p = new ForkJoinPool(threads);
RecursiveAction task = new InitQuotaTask(getBlockStoragePolicySuite(),
@ -760,7 +760,7 @@ void updateCountForQuota(int initThreads) {
p.execute(task);
task.join();
p.shutdown();
LOG.info("Quota initialization completed in " + (Time.now() - start) +
LOG.info("Quota initialization completed in " + (Time.monotonicNow() - start) +
" milliseconds\n" + counts);
} finally {
writeUnlock();