@ThreadSafe public class MultilevelSplitQueue extends Object
| Constructor and Description |
|---|
MultilevelSplitQueue(double levelTimeMultiplier) |
MultilevelSplitQueue(TaskManagerConfig taskManagerConfig) |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeLevel(long threadUsageNanos) |
long |
getLevel0Time() |
long |
getLevel1Time() |
long |
getLevel2Time() |
long |
getLevel3Time() |
long |
getLevel4Time() |
long |
getLevelMinPriority(int level,
long taskThreadUsageNanos) |
io.airlift.stats.CounterStat |
getSelectedCountLevel0() |
io.airlift.stats.CounterStat |
getSelectedCountLevel1() |
io.airlift.stats.CounterStat |
getSelectedCountLevel2() |
io.airlift.stats.CounterStat |
getSelectedCountLevel3() |
io.airlift.stats.CounterStat |
getSelectedCountLevel4() |
void |
offer(PrioritizedSplitRunner split)
During periods of time when a level has no waiting splits, it will not accumulate
scheduled time and will fall behind relative to other levels.
|
void |
remove(PrioritizedSplitRunner split) |
void |
removeAll(Collection<PrioritizedSplitRunner> splits) |
int |
size() |
PrioritizedSplitRunner |
take() |
Priority |
updatePriority(Priority oldPriority,
long quantaNanos,
long scheduledNanos)
Presto 'charges' the quanta run time to the task and the level it belongs to in
an effort to maintain the target thread utilization ratios between levels and to
maintain fairness within a level.
|
@Inject public MultilevelSplitQueue(TaskManagerConfig taskManagerConfig)
public MultilevelSplitQueue(double levelTimeMultiplier)
public void offer(PrioritizedSplitRunner split)
This can cause temporary starvation for other levels when splits do reach the previously-empty level.
To prevent this we set the scheduled time for levels which were empty to the expected scheduled time.
public PrioritizedSplitRunner take() throws InterruptedException
InterruptedExceptionpublic Priority updatePriority(Priority oldPriority, long quantaNanos, long scheduledNanos)
Consider an example split where a read hung for several minutes. This is either a bug or a failing dependency. In either case we do not want to charge the task too much, and we especially do not want to charge the level too much - i.e. cause other queries in this level to starve.
public void remove(PrioritizedSplitRunner split)
public void removeAll(Collection<PrioritizedSplitRunner> splits)
public long getLevelMinPriority(int level,
long taskThreadUsageNanos)
public int size()
public static int computeLevel(long threadUsageNanos)
public long getLevel0Time()
public long getLevel1Time()
public long getLevel2Time()
public long getLevel3Time()
public long getLevel4Time()
public io.airlift.stats.CounterStat getSelectedCountLevel0()
public io.airlift.stats.CounterStat getSelectedCountLevel1()
public io.airlift.stats.CounterStat getSelectedCountLevel2()
public io.airlift.stats.CounterStat getSelectedCountLevel3()
public io.airlift.stats.CounterStat getSelectedCountLevel4()
Copyright © 2012–2019. All rights reserved.