本文整理了Java中io.druid.query.Query.getIntervals
方法的一些代码示例,展示了Query.getIntervals
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getIntervals
方法的具体详情如下:
包路径:io.druid.query.Query
类名称:Query
方法名:getIntervals
暂无
代码示例来源:origin: io.druid/druid-server
@Override
public <T> QueryRunner<T> getQueryRunner(final Query<T> query)
{
// Calling getQueryRunnerForIntervals here works because there's only one segment per interval for RealtimePlumber.
return texasRanger.getQueryRunnerForIntervals(query, query.getIntervals());
}
代码示例来源:origin: io.druid/druid-processing
@Override
public void interval(QueryType query)
{
checkModifiedFromOwnerThread();
builder.setDimension(
DruidMetrics.INTERVAL,
query.getIntervals().stream().map(Interval::toString).toArray(String[]::new)
);
}
代码示例来源:origin: io.druid/druid-server
@POST
@Path("/candidates")
@Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE})
@Consumes({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE, APPLICATION_SMILE})
@ResourceFilters(StateResourceFilter.class)
public Response getQueryTargets(
InputStream in,
@QueryParam("pretty") String pretty,
@QueryParam("numCandidates") @DefaultValue("-1") int numCandidates,
@Context final HttpServletRequest req
) throws IOException
{
final ResponseContext context = createContext(req.getContentType(), pretty != null);
try {
Query<?> query = context.getObjectMapper().readValue(in, Query.class);
return context.ok(
ServerViewUtil.getTargetLocations(
brokerServerView,
query.getDataSource(),
query.getIntervals(),
numCandidates
)
);
}
catch (Exception e) {
return context.gotError(e);
}
}
}
代码示例来源:origin: com.n3twork.druid/druid-processing
@Override
public <OutType> OutType accumulate(OutType initValue, Accumulator<OutType, T> accumulator)
{
List<T> results = Sequences.toList(baseSequence, Lists.<T>newArrayList());
return accumulator.accumulate(
initValue,
(T) new Result<BySegmentResultValueClass<T>>(
timestamp,
new BySegmentResultValueClass<T>(
results,
segmentIdentifier,
query.getIntervals().get(0)
)
)
);
}
代码示例来源:origin: io.druid/druid-server
boolean uncoveredIntervalsOverflowed = false;
for (Interval interval : query.getIntervals()) {
Iterable<TimelineObjectHolder<String, ServerSelector>> lookup = timeline.lookup(interval);
long startMillis = interval.getStartMillis();
代码示例来源:origin: com.n3twork.druid/druid-processing
@Override
public <OutType> Yielder<OutType> toYielder(OutType initValue, YieldingAccumulator<OutType, T> accumulator)
{
List<T> results = Sequences.toList(baseSequence, Lists.<T>newArrayList());
final OutType retVal = accumulator.accumulate(
initValue,
(T) new Result<BySegmentResultValueClass<T>>(
timestamp,
new BySegmentResultValueClass<T>(
results,
segmentIdentifier,
query.getIntervals().get(0)
)
)
);
return Yielders.done(retVal, null);
}
};
代码示例来源:origin: com.n3twork.druid/druid-processing
final String newName = String.format("%s_%s_%s", query.getType(), query.getDataSource(), query.getIntervals());
代码示例来源:origin: io.druid/druid-server
private Set<ServerToSegment> computeSegmentsToQuery(TimelineLookup<String, ServerSelector> timeline)
{
final List<TimelineObjectHolder<String, ServerSelector>> serversLookup = toolChest.filterSegments(
query,
query.getIntervals().stream().flatMap(i -> timeline.lookup(i).stream()).collect(Collectors.toList())
);
final Set<ServerToSegment> segments = Sets.newLinkedHashSet();
final Map<String, Optional<RangeSet<String>>> dimensionRangeCache = Maps.newHashMap();
// Filter unneeded chunks based on partition dimension
for (TimelineObjectHolder<String, ServerSelector> holder : serversLookup) {
final Set<PartitionChunk<ServerSelector>> filteredChunks = DimFilterUtils.filterShards(
query.getFilter(),
holder.getObject(),
partitionChunk -> partitionChunk.getObject().getSegment().getShardSpec(),
dimensionRangeCache
);
for (PartitionChunk<ServerSelector> chunk : filteredChunks) {
ServerSelector server = chunk.getObject();
final SegmentDescriptor segment = new SegmentDescriptor(
holder.getInterval(),
holder.getVersion(),
chunk.getChunkNumber()
);
segments.add(new ServerToSegment(server, segment));
}
}
return segments;
}
代码示例来源:origin: com.n3twork.druid/druid-server
.setUser2(query.getDataSource().toString())
.setUser4(query.getType())
.setUser5(COMMA_JOIN.join(query.getIntervals()))
.setUser6(String.valueOf(query.hasFilters()))
.setUser7(req.getRemoteAddr())
代码示例来源:origin: io.druid/druid-processing
@Override
@SuppressWarnings("unchecked")
public Sequence<T> run(final QueryPlus<T> queryPlus, Map<String, Object> responseContext)
{
if (QueryContexts.isBySegment(queryPlus.getQuery())) {
final Sequence<T> baseSequence = base.run(queryPlus, responseContext);
final List<T> results = Sequences.toList(baseSequence, Lists.<T>newArrayList());
return Sequences.simple(
Collections.singletonList(
(T) new Result<BySegmentResultValueClass<T>>(
timestamp,
new BySegmentResultValueClass<T>(
results,
segmentIdentifier,
queryPlus.getQuery().getIntervals().get(0)
)
)
)
);
}
return base.run(queryPlus, responseContext);
}
}
代码示例来源:origin: io.druid/druid-processing
.create(queryPlus.getQuery().getIntervals())
.transformCat(
new Function<Interval, Iterable<Interval>>()
代码示例来源:origin: io.druid/druid-server
LoadRule baseRule = null;
for (Interval interval : query.getIntervals()) {
int currRulePosition = 0;
for (Rule rule : rules) {
"WTF?! No brokerServiceName found for datasource[%s], intervals[%s]. Using default[%s].",
query.getDataSource(),
query.getIntervals(),
tierConfig.getDefaultBrokerServiceName()
);
代码示例来源:origin: com.n3twork.druid/druid-server
LoadRule baseRule = null;
for (Interval interval : query.getIntervals()) {
int currRulePosition = 0;
for (Rule rule : rules) {
"WTF?! No brokerServiceName found for datasource[%s], intervals[%s]. Using default[%s].",
query.getDataSource(),
query.getIntervals(),
tierConfig.getDefaultBrokerServiceName()
);
代码示例来源:origin: com.n3twork.druid/druid-server
for (Interval interval : query.getIntervals()) {
querySinks.addAll(sinkTimeline.lookup(interval));
代码示例来源:origin: io.druid/druid-processing
final long offset = computeOffset(now, tz);
final Interval interval = queryPlus.getQuery().getIntervals().get(0);
final Interval modifiedInterval = new Interval(
Math.min(interval.getStartMillis() + offset, now + offset),
代码示例来源:origin: io.druid/druid-processing
final String newName = StringUtils.format("%s_%s_%s", query.getType(), query.getDataSource(), query.getIntervals());
代码示例来源:origin: com.n3twork.druid/druid-server
.setUser2(theQuery.getDataSource().getName())
.setUser4(theQuery.getType())
.setUser5(COMMA_JOIN.join(theQuery.getIntervals()))
.setUser6(String.valueOf(theQuery.hasFilters()))
.setUser7(req.getRemoteAddr())
代码示例来源:origin: com.n3twork.druid/druid-server
for (Interval interval : rewrittenQuery.getIntervals()) {
serversLookup.addAll(timeline.lookup(interval));
代码示例来源:origin: com.n3twork.druid/druid-processing
.create(query.getIntervals())
.transformCat(
new Function<Interval, Iterable<Interval>>()
内容来源于网络,如有侵权,请联系作者删除!