Class PrioritizedRunnable
java.lang.Object
org.elasticsearch.common.util.concurrent.PrioritizedRunnable
- All Implemented Interfaces:
Comparable<PrioritizedRunnable>
,Runnable
- Direct Known Subclasses:
SourcePrioritizedRunnable
public abstract class PrioritizedRunnable
extends Object
implements Runnable, Comparable<PrioritizedRunnable>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
long
The elapsed time in milliseconds since this instance was created, as calculated by the difference betweenSystem.nanoTime()
at the time of creation, andSystem.nanoTime()
at the time of invocation of this methodlong
priority()
static WrappedRunnable
-
Constructor Details
-
PrioritizedRunnable
-
-
Method Details
-
wrap
-
getCreationDateInNanos
public long getCreationDateInNanos() -
getAgeInMillis
public long getAgeInMillis()The elapsed time in milliseconds since this instance was created, as calculated by the difference betweenSystem.nanoTime()
at the time of creation, andSystem.nanoTime()
at the time of invocation of this method- Returns:
- the age in milliseconds calculated
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PrioritizedRunnable>
-
priority
-