You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2015/08/10 01:55:23 UTC
svn commit: r1694935 - in /lucene/dev/trunk/solr: ./
core/src/java/org/apache/solr/handler/component/
core/src/java/org/apache/solr/request/
core/src/java/org/apache/solr/servlet/ core/src/java/org/apache/solr/util/
core/src/test/org/apache/solr/util/
Author: andyetitmoves
Date: Sun Aug 9 23:55:22 2015
New Revision: 1694935
URL: http://svn.apache.org/r1694935
Log:
SOLR-7902: Split out use of child timers from RTimer to a sub-class
Added:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimerTree.java
- copied, changed from r1694934, lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java
lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java
- copied, changed from r1694934, lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimer.java
Removed:
lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimer.java
Modified:
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Sun Aug 9 23:55:22 2015
@@ -145,6 +145,9 @@ Other Changes
even after all local replicas of that collection have been removed.
(Scott Blum via shalin)
+* SOLR-7902: Split out use of child timers from RTimer to a sub-class
+ (Ramkumar Aiyengar)
+
================== 5.3.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java Sun Aug 9 23:55:22 2015
@@ -35,7 +35,6 @@ import org.apache.solr.common.params.Mod
import org.apache.solr.common.params.ShardParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.common.util.StrUtils;
import org.apache.solr.core.CloseHook;
import org.apache.solr.core.PluginInfo;
import org.apache.solr.core.SolrCore;
@@ -44,7 +43,7 @@ import org.apache.solr.request.SolrQuery
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.SolrQueryTimeoutImpl;
import org.apache.solr.search.facet.FacetModule;
-import org.apache.solr.util.RTimer;
+import org.apache.solr.util.RTimerTree;
import org.apache.solr.util.SolrPluginUtils;
import org.apache.solr.util.plugin.PluginInfoInitialized;
import org.apache.solr.util.plugin.SolrCoreAware;
@@ -241,7 +240,7 @@ public class SearchHandler extends Reque
SolrPluginUtils.getDebugInterests(req.getParams().getParams(CommonParams.DEBUG), rb);
}
- final RTimer timer = rb.isDebug() ? req.getRequestTimer() : null;
+ final RTimerTree timer = rb.isDebug() ? req.getRequestTimer() : null;
final ShardHandler shardHandler1 = getAndPrepShardHandler(req, rb); // creates a ShardHandler object only if it's needed
@@ -252,7 +251,7 @@ public class SearchHandler extends Reque
}
} else {
// debugging prepare phase
- RTimer subt = timer.sub( "prepare" );
+ RTimerTree subt = timer.sub( "prepare" );
for( SearchComponent c : components ) {
rb.setTimer( subt.sub( c.getName() ) );
c.prepare(rb);
@@ -279,7 +278,7 @@ public class SearchHandler extends Reque
}
else {
// Process
- RTimer subt = timer.sub( "process" );
+ RTimerTree subt = timer.sub( "process" );
for( SearchComponent c : components ) {
rb.setTimer( subt.sub( c.getName() ) );
c.process(rb);
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java Sun Aug 9 23:55:22 2015
@@ -17,13 +17,12 @@
package org.apache.solr.request;
-import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.schema.IndexSchema;
-import org.apache.solr.util.RTimer;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.core.SolrCore;
+import org.apache.solr.util.RTimerTree;
import java.security.Principal;
import java.util.Map;
@@ -72,7 +71,7 @@ public interface SolrQueryRequest {
public long getStartTime();
/** The timer for this request, created when the request started being processed */
- public RTimer getRequestTimer();
+ public RTimerTree getRequestTimer();
/** The index searcher associated with this request */
public SolrIndexSearcher getSearcher();
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java Sun Aug 9 23:55:22 2015
@@ -18,9 +18,8 @@
package org.apache.solr.request;
import org.apache.solr.common.util.SuppressForbidden;
-import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.search.SolrIndexSearcher;
-import org.apache.solr.util.RTimer;
+import org.apache.solr.util.RTimerTree;
import org.apache.solr.util.RefCounted;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.common.params.SolrParams;
@@ -54,11 +53,11 @@ public abstract class SolrQueryRequestBa
protected Iterable<ContentStream> streams;
protected Map<String,Object> json;
- private final RTimer requestTimer;
+ private final RTimerTree requestTimer;
protected final long startTime;
@SuppressForbidden(reason = "Need currentTimeMillis to get start time for request (to be used for stats/debugging)")
- public SolrQueryRequestBase(SolrCore core, SolrParams params, RTimer requestTimer) {
+ public SolrQueryRequestBase(SolrCore core, SolrParams params, RTimerTree requestTimer) {
this.core = core;
this.schema = null == core ? null : core.getLatestSchema();
this.params = this.origParams = params;
@@ -67,7 +66,7 @@ public abstract class SolrQueryRequestBa
}
public SolrQueryRequestBase(SolrCore core, SolrParams params) {
- this(core, params, new RTimer());
+ this(core, params, new RTimerTree());
}
@Override
@@ -99,7 +98,8 @@ public abstract class SolrQueryRequestBa
return startTime;
}
- public RTimer getRequestTimer () {
+ @Override
+ public RTimerTree getRequestTimer () {
return requestTimer;
}
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java Sun Aug 9 23:55:22 2015
@@ -1,38 +1,5 @@
package org.apache.solr.servlet;
-import static org.apache.solr.common.cloud.ZkStateReader.BASE_URL_PROP;
-import static org.apache.solr.common.cloud.ZkStateReader.COLLECTION_PROP;
-import static org.apache.solr.common.cloud.ZkStateReader.CORE_NAME_PROP;
-import static org.apache.solr.common.cloud.ZkStateReader.NODE_NAME_PROP;
-import static org.apache.solr.common.params.CollectionParams.CollectionAction.CREATE;
-import static org.apache.solr.common.params.CollectionParams.CollectionAction.DELETE;
-import static org.apache.solr.common.params.CollectionParams.CollectionAction.RELOAD;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.ADMIN;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.FORWARD;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.PASSTHROUGH;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.PROCESS;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.REMOTEQUERY;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.RETRY;
-import static org.apache.solr.servlet.SolrDispatchFilter.Action.RETURN;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -50,9 +17,25 @@ import java.util.Set;
* limitations under the License.
*/
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
@@ -110,10 +93,25 @@ import org.apache.solr.servlet.SolrDispa
import org.apache.solr.servlet.cache.HttpCacheHeaderUtil;
import org.apache.solr.servlet.cache.Method;
import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
-import org.apache.solr.util.RTimer;
+import org.apache.solr.util.RTimerTree;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.slf4j.LoggerFactory;
+
+import static org.apache.solr.common.cloud.ZkStateReader.BASE_URL_PROP;
+import static org.apache.solr.common.cloud.ZkStateReader.COLLECTION_PROP;
+import static org.apache.solr.common.cloud.ZkStateReader.CORE_NAME_PROP;
+import static org.apache.solr.common.cloud.ZkStateReader.NODE_NAME_PROP;
+import static org.apache.solr.common.params.CollectionParams.CollectionAction.CREATE;
+import static org.apache.solr.common.params.CollectionParams.CollectionAction.DELETE;
+import static org.apache.solr.common.params.CollectionParams.CollectionAction.RELOAD;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.ADMIN;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.FORWARD;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.PASSTHROUGH;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.PROCESS;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.REMOTEQUERY;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.RETRY;
+import static org.apache.solr.servlet.SolrDispatchFilter.Action.RETURN;
/**
* This class represents a call made to Solr
@@ -195,7 +193,7 @@ public class HttpSolrCall {
String corename = "";
String origCorename = null;
// set a request timer which can be reused by requests if needed
- req.setAttribute(SolrRequestParsers.REQUEST_TIMER_SERVLET_ATTRIBUTE, new RTimer());
+ req.setAttribute(SolrRequestParsers.REQUEST_TIMER_SERVLET_ATTRIBUTE, new RTimerTree());
// put the core container in request attribute
req.setAttribute("org.apache.solr.CoreContainer", cores);
path = req.getServletPath();
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java Sun Aug 9 23:55:22 2015
@@ -57,6 +57,7 @@ import org.apache.solr.core.SolrCore;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrQueryRequestBase;
import org.apache.solr.util.RTimer;
+import org.apache.solr.util.RTimerTree;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -140,14 +141,14 @@ public class SolrRequestParsers
parsers.put( "", standard );
}
- private static RTimer getRequestTimer(HttpServletRequest req)
+ private static RTimerTree getRequestTimer(HttpServletRequest req)
{
final Object reqTimer = req.getAttribute(REQUEST_TIMER_SERVLET_ATTRIBUTE);
- if (reqTimer != null && reqTimer instanceof RTimer) {
- return ((RTimer) reqTimer);
+ if (reqTimer != null && reqTimer instanceof RTimerTree) {
+ return ((RTimerTree) reqTimer);
}
- return new RTimer();
+ return new RTimerTree();
}
public SolrQueryRequest parse( SolrCore core, String path, HttpServletRequest req ) throws Exception
@@ -173,11 +174,11 @@ public class SolrRequestParsers
}
public SolrQueryRequest buildRequestFrom(SolrCore core, SolrParams params, Collection<ContentStream> streams) throws Exception {
- return buildRequestFrom(core, params, streams, new RTimer(), null);
+ return buildRequestFrom(core, params, streams, new RTimerTree(), null);
}
private SolrQueryRequest buildRequestFrom(SolrCore core, SolrParams params, Collection<ContentStream> streams,
- RTimer requestTimer, final HttpServletRequest req) throws Exception {
+ RTimerTree requestTimer, final HttpServletRequest req) throws Exception {
// The content type will be applied to all streaming content
String contentType = params.get( CommonParams.STREAM_CONTENTTYPE );
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java?rev=1694935&r1=1694934&r2=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java Sun Aug 9 23:55:22 2015
@@ -17,16 +17,11 @@ package org.apache.solr.util;
* limitations under the License.
*/
-import java.util.Map;
import java.util.concurrent.TimeUnit;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SimpleOrderedMap;
-
-/** A recursive timer.
+/** A simple timer.
*
- * RTimers are started automatically when instantiated; subtimers are also
- * started automatically when created.
+ * RTimers are started automatically when instantiated.
*
* @since solr 1.3
*
@@ -38,10 +33,9 @@ public class RTimer {
public static final int PAUSED = 2;
protected int state;
- protected TimerImpl timerImpl;
- protected double time;
- protected double culmTime;
- protected SimpleOrderedMap<RTimer> children;
+ private TimerImpl timerImpl;
+ private double time;
+ private double culmTime;
protected interface TimerImpl {
void start();
@@ -62,32 +56,21 @@ public class RTimer {
return new NanoTimeTimerImpl();
}
- protected RTimer newTimer() {
- return new RTimer();
- }
-
public RTimer() {
time = 0;
culmTime = 0;
- children = new SimpleOrderedMap<>();
timerImpl = newTimerImpl();
timerImpl.start();
state = STARTED;
}
- /** Recursively stop timer and sub timers */
+ /** Stop this timer */
public double stop() {
assert state == STARTED || state == PAUSED;
time = culmTime;
if(state == STARTED)
time += timerImpl.elapsed();
state = STOPPED;
-
- for( Map.Entry<String,RTimer> entry : children ) {
- RTimer child = entry.getValue();
- if(child.state == STARTED || child.state == PAUSED)
- child.stop();
- }
return time;
}
@@ -114,41 +97,4 @@ public class RTimer {
return culmTime + timerImpl.elapsed();
}
}
-
- /** Create new subtimer with given name
- *
- * Subtimer will be started.
- */
- public RTimer sub(String desc) {
- RTimer child = children.get( desc );
- if( child == null ) {
- child = newTimer();
- children.add(desc, child);
- }
- return child;
- }
-
- @Override
- public String toString() {
- return asNamedList().toString();
- }
-
- public NamedList asNamedList() {
- NamedList<Object> m = new SimpleOrderedMap<>();
- m.add( "time", getTime() );
- if( children.size() > 0 ) {
- for( Map.Entry<String, RTimer> entry : children ) {
- m.add( entry.getKey(), entry.getValue().asNamedList() );
- }
- }
- return m;
- }
-
- /**
- * Manipulating this map may have undefined results.
- */
- public SimpleOrderedMap<RTimer> getChildren()
- {
- return children;
- }
}
Copied: lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimerTree.java (from r1694934, lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimerTree.java?p2=lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimerTree.java&p1=lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java&r1=1694934&r2=1694935&rev=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/util/RTimerTree.java Sun Aug 9 23:55:22 2015
@@ -18,109 +18,46 @@ package org.apache.solr.util;
*/
import java.util.Map;
-import java.util.concurrent.TimeUnit;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
/** A recursive timer.
- *
- * RTimers are started automatically when instantiated; subtimers are also
- * started automatically when created.
- *
- * @since solr 1.3
*
+ * RTimerTree's are started automatically when instantiated; sub-timers are also
+ * started automatically when created.
*/
-public class RTimer {
-
- public static final int STARTED = 0;
- public static final int STOPPED = 1;
- public static final int PAUSED = 2;
-
- protected int state;
- protected TimerImpl timerImpl;
- protected double time;
- protected double culmTime;
- protected SimpleOrderedMap<RTimer> children;
-
- protected interface TimerImpl {
- void start();
- double elapsed();
- }
-
- private class NanoTimeTimerImpl implements TimerImpl {
- private long start;
- public void start() {
- start = System.nanoTime();
- }
- public double elapsed() {
- return TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS);
- }
- }
+public class RTimerTree extends RTimer {
- protected TimerImpl newTimerImpl() {
- return new NanoTimeTimerImpl();
- }
+ protected SimpleOrderedMap<RTimerTree> children;
- protected RTimer newTimer() {
- return new RTimer();
- }
-
- public RTimer() {
- time = 0;
- culmTime = 0;
+ public RTimerTree() {
children = new SimpleOrderedMap<>();
- timerImpl = newTimerImpl();
- timerImpl.start();
- state = STARTED;
}
/** Recursively stop timer and sub timers */
+ @Override
public double stop() {
- assert state == STARTED || state == PAUSED;
- time = culmTime;
- if(state == STARTED)
- time += timerImpl.elapsed();
- state = STOPPED;
-
- for( Map.Entry<String,RTimer> entry : children ) {
+ double time = super.stop();
+
+ for( Map.Entry<String,RTimerTree> entry : children ) {
RTimer child = entry.getValue();
- if(child.state == STARTED || child.state == PAUSED)
+ if(child.state == STARTED || child.state == PAUSED)
child.stop();
}
return time;
}
- public void pause() {
- assert state == STARTED;
- culmTime += timerImpl.elapsed();
- state = PAUSED;
- }
-
- public void resume() {
- if(state == STARTED)
- return;
- assert state == PAUSED;
- state = STARTED;
- timerImpl.start();
- }
-
- /** Get total elapsed time for this timer. */
- public double getTime() {
- if (state == STOPPED) return time;
- else if (state == PAUSED) return culmTime;
- else {
- assert state == STARTED;
- return culmTime + timerImpl.elapsed();
- }
- }
+ protected RTimerTree newTimer() {
+ return new RTimerTree();
+ }
/** Create new subtimer with given name
*
* Subtimer will be started.
*/
- public RTimer sub(String desc) {
- RTimer child = children.get( desc );
+ public RTimerTree sub(String desc) {
+ RTimerTree child = children.get( desc );
if( child == null ) {
child = newTimer();
children.add(desc, child);
@@ -137,17 +74,17 @@ public class RTimer {
NamedList<Object> m = new SimpleOrderedMap<>();
m.add( "time", getTime() );
if( children.size() > 0 ) {
- for( Map.Entry<String, RTimer> entry : children ) {
+ for( Map.Entry<String, RTimerTree> entry : children ) {
m.add( entry.getKey(), entry.getValue().asNamedList() );
}
}
return m;
}
-
+
/**
* Manipulating this map may have undefined results.
*/
- public SimpleOrderedMap<RTimer> getChildren()
+ public SimpleOrderedMap<RTimerTree> getChildren()
{
return children;
}
Copied: lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java (from r1694934, lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimer.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java?p2=lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java&p1=lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimer.java&r1=1694934&r2=1694935&rev=1694935&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimer.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/util/TestRTimerTree.java Sun Aug 9 23:55:22 2015
@@ -20,7 +20,7 @@ package org.apache.solr.util;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.common.util.NamedList;
-public class TestRTimer extends LuceneTestCase {
+public class TestRTimerTree extends LuceneTestCase {
private static class MockTimerImpl implements RTimer.TimerImpl {
static private long systemTime;
@@ -37,19 +37,19 @@ public class TestRTimer extends LuceneTe
}
}
- private class MockRTimer extends RTimer {
+ private class MockRTimerTree extends RTimerTree {
@Override
protected TimerImpl newTimerImpl() {
return new MockTimerImpl();
}
@Override
- protected RTimer newTimer() {
- return new MockRTimer();
+ protected RTimerTree newTimer() {
+ return new MockRTimerTree();
}
}
public void test() {
- RTimer rt = new MockRTimer(), subt, st;
+ RTimerTree rt = new MockRTimerTree(), subt, st;
MockTimerImpl.incrementSystemTime(100);
assertEquals(100, (int) rt.getTime());