SOLR-6030: Use System.nanoTime() instead of currentTimeInMills() in LRUCache.warm

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1591555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2014-05-01 07:39:39 +00:00
parent 2227cca025
commit a5c8d6b7a5
2 changed files with 6 additions and 2 deletions

View File

@ -123,6 +123,9 @@ Bug Fixes
* SOLR-6029: CollapsingQParserPlugin throws ArrayIndexOutOfBoundsException
if elevated doc has been deleted from a segment. (Greg Harris, Joel Bernstein)
* SOLR-6030: Use System.nanoTime() instead of currentTimeInMills() in LRUCache.warm.
(Tomás Fernández Löbbe via shalin)
Other Changes
---------------------

View File

@ -20,6 +20,7 @@ package org.apache.solr.search;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.solr.common.SolrException;
@ -151,7 +152,7 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V> {
@Override
public void warm(SolrIndexSearcher searcher, SolrCache<K,V> old) {
if (regenerator==null) return;
long warmingStartTime = System.currentTimeMillis();
long warmingStartTime = System.nanoTime();
LRUCache<K,V> other = (LRUCache<K,V>)old;
// warm entries
@ -194,7 +195,7 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V> {
}
}
warmupTime = System.currentTimeMillis() - warmingStartTime;
warmupTime = TimeUnit.MILLISECONDS.convert(System.nanoTime() - warmingStartTime, TimeUnit.NANOSECONDS);
}