org.hibernate.search.engine.spi
Interface TimingSource

All Known Implementing Classes:
DefaultTimingSource

public interface TimingSource

Lucene delegates responsibility for efficient time tracking to an external service; this is needed for example by the TimeLimitingCollector.TimeLimitingCollector(Collector, Counter, long) used by Hibernate Search when time limits are enabled on fulltext queries.

Since:
4.1
Author:
Sanne Grinovero (C) 2012 Red Hat Inc.

Method Summary
 void ensureInitialized()
          Needs to be invoked at least once before getMonotonicTimeEstimate() can be used.
 long getMonotonicTimeEstimate()
          Returns and approximation of System.nanoTime().
 void stop()
          Invoked on SearchFactory shutdown.
 

Method Detail

getMonotonicTimeEstimate

long getMonotonicTimeEstimate()
Returns and approximation of System.nanoTime(). Performance should be preferred over accuracy by the implementation, but the value is monotonic and expresses time in milliseconds, however, subsequent invocations could return the same value.

Returns:
an increasing value related to time in milliseconds. Only meaningful to compare time intervals, with no guarantees of high precision.

stop

void stop()
Invoked on SearchFactory shutdown. There is no start method as it's expected to be lazily initialized


ensureInitialized

void ensureInitialized()
Needs to be invoked at least once before getMonotonicTimeEstimate() can be used. Safe to be invoked multiple times.



Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved