Search in sources :

Example 1 with TierSelectorStrategy

use of org.apache.druid.client.selector.TierSelectorStrategy in project druid by druid-io.

the class SimpleServerView method addSegmentToServer.

private void addSegmentToServer(DruidServer server, DataSegment segment) {
    final ServerSelector selector = selectors.computeIfAbsent(segment.getId().toString(), k -> new ServerSelector(segment, tierSelectorStrategy));
    selector.addServerAndUpdateSegment(servers.get(server), segment);
    timelines.computeIfAbsent(segment.getDataSource(), k -> new VersionedIntervalTimeline<>(Ordering.natural())).add(segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(selector));
}
Also used : DataSourceAnalysis(org.apache.druid.query.planning.DataSourceAnalysis) HighestPriorityTierSelectorStrategy(org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy) HttpClient(org.apache.druid.java.util.http.client.HttpClient) HashMap(java.util.HashMap) ServerSelector(org.apache.druid.client.selector.ServerSelector) QueryWatcher(org.apache.druid.query.QueryWatcher) Map(java.util.Map) ServerType(org.apache.druid.server.coordination.ServerType) TierSelectorStrategy(org.apache.druid.client.selector.TierSelectorStrategy) QueryRunner(org.apache.druid.query.QueryRunner) QueryToolChestWarehouse(org.apache.druid.query.QueryToolChestWarehouse) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) TimelineLookup(org.apache.druid.timeline.TimelineLookup) VersionedIntervalTimeline(org.apache.druid.timeline.VersionedIntervalTimeline) Executor(java.util.concurrent.Executor) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ISE(org.apache.druid.java.util.common.ISE) TableDataSource(org.apache.druid.query.TableDataSource) List(java.util.List) RandomServerSelectorStrategy(org.apache.druid.client.selector.RandomServerSelectorStrategy) Ordering(com.google.common.collect.Ordering) DataSegment(org.apache.druid.timeline.DataSegment) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) QueryableDruidServer(org.apache.druid.client.selector.QueryableDruidServer) Collections(java.util.Collections) ServerSelector(org.apache.druid.client.selector.ServerSelector) VersionedIntervalTimeline(org.apache.druid.timeline.VersionedIntervalTimeline)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Preconditions (com.google.common.base.Preconditions)1 Ordering (com.google.common.collect.Ordering)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Executor (java.util.concurrent.Executor)1 HighestPriorityTierSelectorStrategy (org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy)1 QueryableDruidServer (org.apache.druid.client.selector.QueryableDruidServer)1 RandomServerSelectorStrategy (org.apache.druid.client.selector.RandomServerSelectorStrategy)1 ServerSelector (org.apache.druid.client.selector.ServerSelector)1 TierSelectorStrategy (org.apache.druid.client.selector.TierSelectorStrategy)1 ISE (org.apache.druid.java.util.common.ISE)1 HttpClient (org.apache.druid.java.util.http.client.HttpClient)1 QueryRunner (org.apache.druid.query.QueryRunner)1 QueryToolChestWarehouse (org.apache.druid.query.QueryToolChestWarehouse)1 QueryWatcher (org.apache.druid.query.QueryWatcher)1 TableDataSource (org.apache.druid.query.TableDataSource)1