metamx/druid — pull request #931 by drcrallen (2014-12-03 19:40:50+00:00)
Title: Use thread priorities. (aka set `nice` values for background-like tasks)

There are some items which seem to cause resource contesting when they are running. This is an attempt to allow the OS / JVM to help figure out which tasks should be run realtime, and which can be interrupted.

* Defaults the thread priority to java.util.Thread.NORM_PRIORITY in io.druid.indexing.common.task.AbstractTask
* Each exec service has its own Task Factory which is assigned a priority for spawned task. Therefore each priority class has a unique exec service
* Added Task.Priority enum
* Can be either NORMAL or LOW
* Add options to ForkingTaskRunner
* Add "-XX:+UseThreadPriorities" default option
* Add "-XX:ThreadPriorityPolicy=42" default option
* AbstractTask - Removed unneded @JsonIgnore on priority
* Added priority to RealtimePlumber executors. All sub-executors (non query runners) get Thread.MIN_PRIORITY