Class ServerManager
java.lang.Object
org.apache.druid.server.coordination.ServerManager
- All Implemented Interfaces:
QuerySegmentWalker
Query handler for Historical processes (see CliHistorical).
In tests, this class's behavior is partially mimicked by TestClusterQuerySegmentWalker.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classQueryRunnerthat on run builds a set ofQueryRunnerfor a set ofSegmentDescriptorand merges them using theQueryToolChest.static final classWrapper for aSegmentDescriptorandOptional<Segment>, the latter being created by aSegmentMapFunctionbeing applied to aReferenceCountedSegmentProvider. -
Constructor Summary
ConstructorsConstructorDescriptionServerManager(QueryRunnerFactoryConglomerate conglomerate, ServiceEmitter emitter, QueryProcessingPool queryProcessingPool, CachePopulator cachePopulator, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Cache cache, CacheConfig cacheConfig, SegmentManager segmentManager, ServerConfig serverConfig, PolicyEnforcer policyEnforcer) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ServerManager.SegmentReference>acquireAllSegments(VersionedIntervalTimeline<String, ReferenceCountedSegmentProvider> timeline, Iterable<SegmentDescriptor> segments, SegmentMapFunction segmentMapFn, Closer closer) For eachSegmentDescriptor, we try to fetch aReferenceCountedSegmentProviderfrom the suppliedVersionedIntervalTimelineand applySegmentMapFunctionto acquire a reference and transform the segment as appropriate for query processing, returning aServerManager.SegmentReferencewrapper.protected <T> QueryRunner<T>buildQueryRunnerForSegment(SegmentDescriptor segmentDescriptor, Segment segment, QueryRunnerFactory<T, Query<T>> factory, QueryToolChest<T, Query<T>> toolChest, AtomicLong cpuTimeAccumulator, Optional<byte[]> cacheKeyPrefix) <T> QueryRunner<T>getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals) <T> QueryRunner<T>getQueryRunnerForSegments(Query<T> query, Iterable<SegmentDescriptor> specs) protected <T> FunctionalIterable<QueryRunner<T>>getQueryRunnersForSegments(VersionedIntervalTimeline<String, ReferenceCountedSegmentProvider> timeline, Iterable<SegmentDescriptor> specs, Query<T> query, QueryRunnerFactory<T, Query<T>> factory, QueryToolChest<T, Query<T>> toolChest, SegmentMapFunction segmentMapFn, AtomicLong cpuTimeAccumulator, Optional<byte[]> cacheKeyPrefix, Closer closer)
-
Constructor Details
-
ServerManager
@Inject public ServerManager(QueryRunnerFactoryConglomerate conglomerate, ServiceEmitter emitter, QueryProcessingPool queryProcessingPool, CachePopulator cachePopulator, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Cache cache, CacheConfig cacheConfig, SegmentManager segmentManager, ServerConfig serverConfig, PolicyEnforcer policyEnforcer)
-
-
Method Details
-
getQueryRunnerForIntervals
public <T> QueryRunner<T> getQueryRunnerForIntervals(Query<T> query, Iterable<org.joda.time.Interval> intervals) - Specified by:
getQueryRunnerForIntervalsin interfaceQuerySegmentWalker
-
getQueryRunnerForSegments
public <T> QueryRunner<T> getQueryRunnerForSegments(Query<T> query, Iterable<SegmentDescriptor> specs) - Specified by:
getQueryRunnerForSegmentsin interfaceQuerySegmentWalker
-
acquireAllSegments
protected List<ServerManager.SegmentReference> acquireAllSegments(VersionedIntervalTimeline<String, ReferenceCountedSegmentProvider> timeline, Iterable<SegmentDescriptor> segments, SegmentMapFunction segmentMapFn, Closer closer) For eachSegmentDescriptor, we try to fetch aReferenceCountedSegmentProviderfrom the suppliedVersionedIntervalTimelineand applySegmentMapFunctionto acquire a reference and transform the segment as appropriate for query processing, returning aServerManager.SegmentReferencewrapper. The wrapper contains theSegmentDescriptorand anOptional<Segment>, which if present theSegmentwill be registered to theCloser, and will be empty if the segment was not actually in the timeline, or if unable to apply the reference -
getQueryRunnersForSegments
protected <T> FunctionalIterable<QueryRunner<T>> getQueryRunnersForSegments(VersionedIntervalTimeline<String, ReferenceCountedSegmentProvider> timeline, Iterable<SegmentDescriptor> specs, Query<T> query, QueryRunnerFactory<T, Query<T>> factory, QueryToolChest<T, Query<T>> toolChest, SegmentMapFunction segmentMapFn, AtomicLong cpuTimeAccumulator, Optional<byte[]> cacheKeyPrefix, Closer closer) -
buildQueryRunnerForSegment
protected <T> QueryRunner<T> buildQueryRunnerForSegment(SegmentDescriptor segmentDescriptor, Segment segment, QueryRunnerFactory<T, Query<T>> factory, QueryToolChest<T, Query<T>> toolChest, AtomicLong cpuTimeAccumulator, Optional<byte[]> cacheKeyPrefix)
-