@Override
    public int compareTo(final PriorityFutureTask<T> task) {
      long priorityDiff = task.priority.getPriority() - this.priority.getPriority();
      return ((priorityDiff == 0) ? 0 : (priorityDiff < 0) ? -1 : 1);
    }
Priority based thread pool executor which takes priority of the task to be executed into account.
app/com/linkedin/drelephant/priorityexecutor/PriorityBasedThreadPoolExecutor.java