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 protectedPrioritizedRunnable(Priority priority) -
Method Summary
Modifier and Type Method Description intcompareTo(PrioritizedRunnable pr)longgetAgeInMillis()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 methodlonggetCreationDateInNanos()Prioritypriority()static WrappedRunnablewrap(java.lang.Runnable runnable, Priority priority)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Runnable
run
-
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:
compareToin interfacejava.lang.Comparable<PrioritizedRunnable>
-
priority
-