Package org.apache.druid.client.selector
Class PooledTierSelectorStrategy
java.lang.Object
org.apache.druid.client.selector.AbstractTierSelectorStrategy
org.apache.druid.client.selector.PooledTierSelectorStrategy
- All Implemented Interfaces:
TierSelectorStrategy
A
TierSelectorStrategy that pools servers with the configured set of priorities from PooledTierSelectorStrategyConfig.getPriorities()
and delegates server selection to the configured ServerSelectorStrategy.
Unlike other TierSelectorStrategy like CustomTierSelectorStrategy
which has a preference for priority order, this strategy treats all configured priorities equally
by combining their servers into a single selection pool and delegates to ServerSelectorStrategy to do
the server selection. If no servers match the configured priorities in the pool, an empty server list is returned,
which may cause queries to return partial or no data.
Example configuration:
druid.broker.select.tier=pooled druid.broker.select.tier.pooled.priorities=[2,1]
With this configuration, servers with priority 2 and 1 are pooled together and
selection is delegated to the ServerSelectorStrategy. Servers with other
priorities are ignored.
-
Field Summary
FieldsFields inherited from class org.apache.druid.client.selector.AbstractTierSelectorStrategy
serverSelectorStrategy -
Constructor Summary
ConstructorsConstructorDescriptionPooledTierSelectorStrategy(ServerSelectorStrategy serverSelectorStrategy, PooledTierSelectorStrategyConfig config, ServiceEmitter emitter) -
Method Summary
Modifier and TypeMethodDescription<T> List<QueryableDruidServer>pick(Query<T> query, it.unimi.dsi.fastutil.ints.Int2ObjectRBTreeMap<Set<QueryableDruidServer>> prioritizedServers, DataSegment segment, int numServersToPick) toString()Methods inherited from class org.apache.druid.client.selector.AbstractTierSelectorStrategy
pickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.client.selector.TierSelectorStrategy
pick, pick
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
PooledTierSelectorStrategy
public PooledTierSelectorStrategy(ServerSelectorStrategy serverSelectorStrategy, PooledTierSelectorStrategyConfig config, ServiceEmitter emitter)
-
-
Method Details
-
pick
public <T> List<QueryableDruidServer> pick(@Nullable Query<T> query, it.unimi.dsi.fastutil.ints.Int2ObjectRBTreeMap<Set<QueryableDruidServer>> prioritizedServers, DataSegment segment, int numServersToPick) - Specified by:
pickin interfaceTierSelectorStrategy- Overrides:
pickin classAbstractTierSelectorStrategy
-
getComparator
- Returns:
- the natural order of priorities since priority order doesn't matter for this strategy as the configured set of
priorities in the pool are treated equally and delegated to
AbstractTierSelectorStrategy.serverSelectorStrategy.
-
getConfig
-
toString
-