mirror of https://github.com/apache/druid.git
rename t to now
This commit is contained in:
parent
eb7dd6dc74
commit
e39b6975fa
|
@ -75,19 +75,19 @@ public class TimewarpOperator<T> implements PostProcessingOperator<T>
|
||||||
return postProcess(baseQueryRunner, DateTime.now().getMillis());
|
return postProcess(baseQueryRunner, DateTime.now().getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryRunner<T> postProcess(final QueryRunner<T> baseRunner, final long t)
|
public QueryRunner<T> postProcess(final QueryRunner<T> baseRunner, final long now)
|
||||||
{
|
{
|
||||||
return new QueryRunner<T>()
|
return new QueryRunner<T>()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public Sequence<T> run(Query<T> query)
|
public Sequence<T> run(Query<T> query)
|
||||||
{
|
{
|
||||||
final long offset = computeOffset(t);
|
final long offset = computeOffset(now);
|
||||||
|
|
||||||
final Interval interval = query.getIntervals().get(0);
|
final Interval interval = query.getIntervals().get(0);
|
||||||
final Interval modifiedInterval = new Interval(
|
final Interval modifiedInterval = new Interval(
|
||||||
interval.getStartMillis() + offset,
|
interval.getStartMillis() + offset,
|
||||||
Math.min(interval.getEndMillis() + offset, t + offset)
|
Math.min(interval.getEndMillis() + offset, now + offset)
|
||||||
);
|
);
|
||||||
return Sequences.map(
|
return Sequences.map(
|
||||||
baseRunner.run(
|
baseRunner.run(
|
||||||
|
@ -106,7 +106,7 @@ public class TimewarpOperator<T> implements PostProcessingOperator<T>
|
||||||
value = new TimeBoundaryResultValue(
|
value = new TimeBoundaryResultValue(
|
||||||
ImmutableMap.of(
|
ImmutableMap.of(
|
||||||
TimeBoundaryQuery.MIN_TIME, boundary.getMinTime().minus(offset),
|
TimeBoundaryQuery.MIN_TIME, boundary.getMinTime().minus(offset),
|
||||||
TimeBoundaryQuery.MAX_TIME, new DateTime(Math.min(boundary.getMaxTime().getMillis() - offset, t))
|
TimeBoundaryQuery.MAX_TIME, new DateTime(Math.min(boundary.getMaxTime().getMillis() - offset, now))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue