Class PrioritizedRunnable
java.lang.Object
org.elasticsearch.common.util.concurrent.PrioritizedRunnable
- All Implemented Interfaces:
java.lang.Comparable<PrioritizedRunnable>
,java.lang.Runnable
- Direct Known Subclasses:
SourcePrioritizedRunnable
public abstract class PrioritizedRunnable extends java.lang.Object implements java.lang.Runnable, java.lang.Comparable<PrioritizedRunnable>
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrioritizedRunnable(Priority priority)
-
Method Summary
Modifier and Type Method Description int
compareTo(PrioritizedRunnable pr)
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 methodlong
getCreationDateInNanos()
Priority
priority()
static WrappedRunnable
wrap(java.lang.Runnable runnable, Priority priority)
-
Constructor Details
-
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 interfacejava.lang.Comparable<PrioritizedRunnable>
-
priority
-