Commit Graph

33 Commits (2e6007ec2228e43bbb1d2e4e2be0b2bf309f9531)

Author SHA1 Message Date
Jonathan A. Sternberg 3a7d537ee6 Merge pull request #6028 from influxdata/js-5116-default-no-fill-for-select-into
Modify fill(null) to fill(none) in SELECT INTO queries
2016-03-22 12:13:17 -04:00
Ben Johnson 7156c1f9bd add IteratorStats
This commit adds an `IteratorStats` that holds aggregate
iterator processing information. A method is also added to
`Iterator` to return the stats:

	Stats() influxql.IteratorStats

The remote iterators will also emit their stats in the point
stream upon first connection, on a given interval, and then
finally once the last point has been sent.
2016-03-21 16:25:19 -06:00
Jonathan A. Sternberg 6655ca7769 Create a new interrupt iterator that will stop emitting points after an interrupt
Use of the iterator is spread out into both `IteratorCreators` and
inside of the iterators themselves. Part of the interrupt must be
handled inside of the engine so it stops trying to emit points when an
interrupt is found and another part of the interrupt has to happen when
combining the iterators so it doesn't just start reading the next shard.
2016-03-21 12:07:07 -04:00
Jonathan A. Sternberg eab6ac3871 Modify fill(null) to fill(none) in SELECT INTO queries
Fixes #5116.
2016-03-16 11:14:41 -04:00
Cory LaNou ba6a95e9bc Merge pull request #5994 from influxdata/single-server-lite
Single Server
2016-03-14 16:11:37 -05:00
Jonathan A. Sternberg 0042866002 Teach the AuxIterator how to background
Now the AuxIterator will know when it is backgrounded so that it can
stop reading from the primary iterator when all of the child iterators
have been closed.
2016-03-14 11:12:02 -04:00
Ben Johnson beda072426 add support for remote expansion of regex
This commit moves the `tsdb.Store.ExpandSources()` function onto
the `influxql.IteratorCreator` and provides support for issuing
source expansion across a cluster.
2016-03-11 12:40:07 -07:00
Jonathan A. Sternberg 09a9b3c53e Fix aux iterators to respect early closing
The primary input iterator for an aux iterator would continue trying to
send points to a closed channel even after an aux iterator had already
been closed.

This changes the aux iterators to use sync.Cond instead of channels and
lower level syncing primitives for handling buffered input/output.

Fixes #5974.
2016-03-11 12:07:32 -05:00
Jonathan A. Sternberg 9c5bc8ab2b Refactor reduce slice func to use the aggregator and emitter 2016-03-07 13:25:45 -05:00
Jonathan A. Sternberg 9113839e4c Fix sorting of `first()` and `last()` calls across shards
Previously the call iterator would normalize the time to the interval
for all calls. This meant that when `first()` or `last()` was called
with no group by interval the value would be found for each shard, the
time was normalized, then it tried to find the value between the shards
(but no longer with any time data as that had already been eliminated).

This removes part of the time logic from the call iterators and makes a
new iterator `IntervalIterator` to normalize the times as they come out
of the underlying iterator.

Fixes #5890.
2016-03-03 21:15:43 -05:00
Jonathan A. Sternberg 8d89a203a2 Fix sorting for distinct by sorting by value when the point time is the same 2016-03-03 19:09:38 -05:00
Jonathan A. Sternberg cddc1b2241 Fix remote execution for partially replicated clusters
The RPC handler for remote queries would attempt to reuse a closed
connection for certain commands that didn't use pooling. The RPC
commands that close the connection have been fixed to not try reusing
the connection.

When creating an iterator, if there are no points to return, the points
decoder would hit an EOF that it didn't catch and would return that
error back to the client who made the request. It now properly returns
no points by using a `nilFloatIterator` if there are no points to
return.

This fixes remote execution when a cluster has nothing to return.
2016-02-25 17:46:51 -05:00
Ben Johnson 16eea8eecc add SeriesList marshaling 2016-02-25 15:38:16 -07:00
Ben Johnson 0dda9f6608 add remote execution
This commit adds remote execution to the query engine.
2016-02-25 08:41:20 -07:00
Jonathan A. Sternberg 559a11d0ab Pass the implicit end time from the query executor to the select call
The select call and the query executor would both calculate the time
range, but in separate ways. The query executor needed some way to pass
in the implicit end time that is placed there by the query executor.

Fixes #5636.
2016-02-12 16:03:24 -05:00
Jonathan A. Sternberg d79eb29a23 Add documentation comments to influxql.Series and influxql.SeriesList 2016-02-10 09:40:31 -07:00
Jonathan A. Sternberg 98810a363a Correct the AuxIterator test and adding some additional locks
The additional locks shouldn't be necessary due to how the code is used,
but should prevent any potential data races in case we accidentally do
something bad.
2016-02-10 09:40:31 -07:00
Jonathan A. Sternberg ed151598ff Modify the AuxIterator to include a Start method
The AuxIterator streams points to the underlying iterators. When it
started automatically, race conditions occurred between the stream
closing the iterators and creating iterators from the AuxIterator.
2016-02-10 09:40:30 -07:00
Jonathan A. Sternberg 5c9cdd05c2 Modify the fill iterator to not produce empty name/tags for a time range
If a name/tag combination does not have any points in the time range at
all, fill will not generate points for it.
2016-02-10 09:40:30 -07:00
Jonathan A. Sternberg d1f7c445e7 Modify iterators to work across shards
Aux iterators now ask the iterator creator what series will be returned
and determine which aux fields to create based on the results.

The `tsdb.Shards` struct also creates a call iterator around the
iterators returned from each shard.
2016-02-10 09:40:29 -07:00
Jonathan A. Sternberg c2d1206177 Implement the fill iterator
Fill requires an additional function for IteratorCreator to retrieve the
series that will be returned from the iterator. When fill is required
for an aggregate, the IteratorCreator will be asked what series will be
returned by the created iterator.
2016-02-10 09:40:29 -07:00
Ben Johnson 627cd9d486 add dedupe iterator 2016-02-10 09:40:29 -07:00
Jonathan A. Sternberg 5605bbb22e Implement casting support for different iterator types
Out of a list of iterators, an overarching iterator type is chosen and
only iterators of that type are returned for the merge iterator. If a
type can be cast to another type, an extra cast iterator is created to
handle that casting.

The only supported cast is from integers to floats.
2016-02-10 09:40:28 -07:00
Ben Johnson b4cb770a7f refactor aux iterators 2016-02-10 09:40:27 -07:00
Jonathan A. Sternberg 03ad7a4e40 Move the integerReduceSliceFloatIterator to call_iterator.go
It matches more in functionality to the functions in call_iterator.go
than iterator.go. iterator.go mostly has base iterators and
call_iterator.go has iterators related to functional calls, which is
the only time integerReduceSliceFloatIterator is used.
2016-02-10 09:40:26 -07:00
Jonathan A. Sternberg fa79aae584 Expanding test coverage for the influxql/iterator.go
SortedMergeIterator is now tested and all of the IteratorOptions methods
are now tested explicitly for functionality.
2016-02-10 09:40:26 -07:00
Ben Johnson b8918a780c integer support 2016-02-10 09:40:25 -07:00
Jonathan A. Sternberg be22097338 Reset the iterator duration to zero when no interval is used 2016-02-10 09:40:25 -07:00
Ben Johnson 00806de9b8 refactor query engine 2016-02-10 09:40:25 -07:00
Ben Johnson 0ad9c31169 simple derivative 2016-02-10 09:40:24 -07:00
Ben Johnson 60b051ee88 LIMIT/OFFSET 2016-02-10 09:40:24 -07:00
Ben Johnson 036382ee20 SLIMIT/SOFFSET 2016-02-10 09:40:24 -07:00
Ben Johnson cde973f409 refactor query engine 2016-02-10 09:40:24 -07:00