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 between System.nanoTime() at the time of creation, and System.nanoTime() at the time of invocation of this method
    long getCreationDateInNanos()  
    Priority priority()  
    static WrappedRunnable wrap​(java.lang.Runnable runnable, Priority priority)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Runnable

    run
  • Constructor Details

    • PrioritizedRunnable

      protected PrioritizedRunnable​(Priority priority)
  • Method Details

    • 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 between System.nanoTime() at the time of creation, and System.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 interface java.lang.Comparable<PrioritizedRunnable>
    • priority

      public Priority priority()