diff --git a/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java b/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java index c73b57b7a07..1ece0929fd4 100644 --- a/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java +++ b/solr/core/src/java/org/apache/solr/update/IndexFingerprint.java @@ -19,55 +19,23 @@ package org.apache.solr.update; import java.io.IOException; import java.lang.invoke.MethodHandles; -import java.net.ConnectException; -import java.net.SocketException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; -import java.util.Set; -import org.apache.http.NoHttpResponseException; -import org.apache.http.client.HttpClient; -import org.apache.http.conn.ConnectTimeoutException; -import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.queries.function.FunctionValues; import org.apache.lucene.queries.function.ValueSource; import org.apache.lucene.util.Bits; -import org.apache.lucene.util.BytesRef; -import org.apache.solr.client.solrj.SolrServerException; -import org.apache.solr.cloud.ZkController; -import org.apache.solr.common.SolrException; -import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.util.Hash; import org.apache.solr.common.util.NamedList; -import org.apache.solr.common.util.StrUtils; import org.apache.solr.core.SolrCore; -import org.apache.solr.handler.component.HttpShardHandlerFactory; -import org.apache.solr.handler.component.ShardHandler; -import org.apache.solr.handler.component.ShardHandlerFactory; -import org.apache.solr.handler.component.ShardRequest; -import org.apache.solr.handler.component.ShardResponse; -import org.apache.solr.logging.MDCLoggingContext; -import org.apache.solr.request.LocalSolrQueryRequest; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.response.SolrQueryResponse; import org.apache.solr.schema.SchemaField; import org.apache.solr.search.SolrIndexSearcher; -import org.apache.solr.update.processor.UpdateRequestProcessor; -import org.apache.solr.update.processor.UpdateRequestProcessorChain; +import org.apache.solr.util.RTimer; import org.apache.solr.util.RefCounted; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.solr.update.processor.DistributedUpdateProcessor.DistribPhase.FROMLEADER; -import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM; - /** @lucene.internal */ public class IndexFingerprint { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); @@ -122,7 +90,7 @@ public class IndexFingerprint { } public static IndexFingerprint getFingerprint(SolrIndexSearcher searcher, long maxVersion) throws IOException { - long start = System.currentTimeMillis(); + RTimer timer = new RTimer(); SchemaField versionField = VersionInfo.getAndCheckVersionField(searcher.getSchema()); @@ -151,8 +119,8 @@ public class IndexFingerprint { } } - long end = System.currentTimeMillis(); - log.info("IndexFingerprint millis:" + (end-start) + " result:" + f); + final double duration = timer.stop(); + log.info("IndexFingerprint millis:" + duration + " result:" + f); return f; }