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

(cherry picked from commit 50849ec9eb9bad90586a95d2b2380ee6e8724d6b)
(cherry picked from commit 3527327f349264ae62f3673ab368505a16cc0a34)
This commit is contained in:
Akira Ajisaka 2017-09-21 19:27:48 +09:00
parent 6d6758f751
commit 4ac3fc10c2
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50

View File

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