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
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
PrioritizedRunnable
protected PrioritizedRunnable(Priority priority)
-
-
Method Detail
-
wrap
public static WrappedRunnable wrap(java.lang.Runnable runnable, Priority priority)
-
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
public int compareTo(PrioritizedRunnable pr)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PrioritizedRunnable>
-
priority
public Priority priority()
-
-