Commit Graph

42 Commits (c1975c20208ef520210a00704a53e26a6fe8217b)

Author SHA1 Message Date
Nathaniel Cook 89f4525841 build(Makefile): fix various bug with makefiles
Fixes subdir ordering.
Works around issue with stringer not working with Go modules.
Fixes issues with generated code being ignored.

Fixes #2044
2018-12-19 17:02:19 -07:00
Nathaniel Cook d6c0a393b0 Merge branch 'master' into flux-staging 2018-12-19 11:30:55 -07:00
Nathaniel Cook 61e36cbee6 chore(Makefile): add target to check generated files are accurate
A standard Makefile is used now in all subdirs that run go generate.
Make will only generate the file if its source files changed.
The checkgenerate target runs clean to ensure all targets a generated
fresh.
2018-12-18 12:54:17 -07:00
Jonathan A. Sternberg cc93531400 fix(storage): convert the storage table interface to use arrow buffers
The table interface was modified to expose the arrow buffers. The
storage table has now been converted to use this interface with the same
fixes so that it exposes arrow buffers.

The influxql package has also been updated to use the `DoArrow` method
from the `flux.Table` interface.
2018-12-18 09:47:53 -07:00
Ben Johnson 0541d568bd
fix(storage): Extend lock during stats fetch to prevent race 2018-12-13 11:13:20 -07:00
Stuart Carnie 8c296dd20a
fix(storage): Add unit tests to verify nil cursor
When matching series have no data, the NewGroupResultSet cursor should
return nil. Added tests to verify these conditions.
2018-12-12 14:27:11 -07:00
Stuart Carnie f2891c3f59
fix(storage): Fix panic when read request results in empty an group
Moves the check to determine if a series has data for the current time
range into the groupBySort function, which is consistent with the
groupNoneSort function.
2018-12-12 13:22:02 -07:00
Stuart Carnie 8f8311a3ae
chore(gen): Add ingen generator data structures to platform for reuse 2018-12-11 17:45:57 -07:00
Jacob Marble b3e5e9fc31 feat(storage): return cost stats with read response via gRPC trailer 2018-12-05 15:32:41 -08:00
Edd Robinson 9403c1ec8e Ensure error strings not capitalised ST1005 2018-11-30 10:54:24 +00:00
Ben Johnson 868fdbbe03
megacheck 2018-11-28 15:52:11 -07:00
Ben Johnson 1862b4421d
Integrate scanned values statistics tracking. 2018-11-28 15:32:06 -07:00
Christopher M. Wolff a3ad02288b
Remove use of verbose from control.Config (#1573) 2018-11-26 16:02:41 -07:00
jlapacik 2b52224e84 update flux dependency - add missing Statistics() methods 2018-11-26 13:19:14 -08:00
Stuart Carnie f3d15be61b
chore: Add key order sanity check to StreamReaders 2018-11-21 12:01:36 -07:00
Stuart Carnie 8920dab57a
feedback: Changes per PR feedback 2018-11-21 12:01:36 -07:00
Stuart Carnie 831e2ab943
feat(reads): Implement merge operation for []reads.GroupResultSet
Specifically the currently supported GroupNone and GroupBy operations
2018-11-21 12:01:36 -07:00
Stuart Carnie 268a52148a
feat(reads): Implement merge operation for []reads.ResultSet 2018-11-21 12:01:36 -07:00
Stuart Carnie 7fb015cc7f
chore: Add GroupBy benchmark 2018-11-21 12:01:36 -07:00
Stuart Carnie 26408dc1fa
chore(reads): Document ResultSet and GroupResultSet APIs; add func Err
* add option to Group sort to specify precedence of `nil`
* improve unit tests for GroupResultSet implementation
2018-11-21 12:01:35 -07:00
Stuart Carnie 0237059d05
feat(reads): Implement ResultSet and GroupResultSet for protobuf streams 2018-11-21 12:01:35 -07:00
Jeff Wendling 22e23d6e31 final touches
- move default directories to the storage package
- make the directory layout match before
- clean up some dead missed functions
2018-11-08 11:39:36 -07:00
Jeff Wendling 0d411023f2 config: clean up
- Breaks the weird cycle that existed with the EngineOptions
- Removes a bunch of useless parameters
- Moves around a bunch of defaults
2018-11-08 11:39:36 -07:00
Christopher M. Wolff e95fb9cc9a
Fix error where _start or _stop where redundantly added to group key (#1308) 2018-11-05 14:06:08 -08:00
Stuart Carnie 56510ba0dc
Merge pull request #1262 from influxdata/sgc-fix-race
Fix race condition as `Close` was called by multiple goroutines
2018-11-01 14:22:32 -07:00
Mark Rushakoff 985c260af7 chore(storage,tsdb): fix megacheck errors 2018-11-01 12:54:46 -07:00
Stuart Carnie b7d9505ac1
fix(reads): Fix race condition when done channel was triggered
tl;dr
Previously, `Close` was being called concurrently by multiple
goroutines, resulting in a race condition. This commit resolves those
issues.

Background

The `Close` method was performing multiple duties, closing resources
and triggering that the table reading by the `Do` method was done.

Additionally, state to track whether more records existed and if the
table was empty, was ported from the more complicated gRPC
implementation. This logic has been simplified.

This new behavior:

* `table#Do` is responsible for triggering it is done, by closing the
  done channel
* The creator of the `table` is responsible for releasing the resources
  by calling the `table#Close` method
* The `table#Do` reading can be cancelled by calling the `Cancel`
  function, which is safe for concurrent use.
* the Do and Close methods are protected by a mutex to protect storage
  resources, such as cursors.
2018-11-01 11:35:36 -07:00
Nathaniel Cook 2a1d76eb2d chore: Update flux dependency for the type-inference changes 2018-10-31 17:11:11 -06:00
Stuart Carnie 869068de69
fix(reads): Ensure storage resources are cleaned
Move variable declarations outside the for loops and use nil
to test for resource ownership. defer function tests for nil and
will close resource.
2018-10-31 11:04:47 -07:00
Chris Goller d8548d41e1 chore(fmt): update formating with make fmt 2018-10-30 07:40:28 -05:00
Stuart Carnie 49c3ea786f
fix(reads): Fix panic when performing filters on value data
Fixes #1188
2018-10-25 13:02:59 -07:00
Adam 98be8bcd32
moved to_http and to_kafka to flux and update to latest flux (#1175) 2018-10-24 12:33:43 -04:00
Mark Rushakoff d479c330fe fix(storage): avoid data race on table Done channel
Fixes #1021.
2018-10-16 08:21:13 -07:00
Jonathan A. Sternberg 5c8318d181
Merge pull request #1080 from influxdata/js-go-generate-with-go-run
refactor: modify tooling to take advantage of go run
2018-10-15 11:27:13 -05:00
Jeff Wendling ce3e1fa90d Remove the fields index
This commit removes the remaining bits of the fields index. In doing
so, the buildCursor method on the engine would need to be updated.
It turns out, that code was statically dead, so delete it and anything
that depended on it. Additionally, delete anything as reported by
the unused tool in the tsdb package.
2018-10-15 10:22:07 -06:00
Jonathan A. Sternberg e9600b1f0b
refactor: modify tooling to take advantage of go run
The generate commands have been modified to take advantage of the new
functionality in Go 1.11 that allows `go run` to execute a package
instead of individual files.

This functionality combined with Go modules allows us to execute a
package directly out of our pinned dependencies rather than accidentally
picking up another binary outside of the build environment.

This also simplifies the Makefile because they no longer have to be
responsible for installing the correct tooling since the Go command
takes care of that logic. It also makes it so that the Makefiles with
file generation can now be invoked from their appropriate subdirectories
so they are contained within the directory itself rather than relying on
values in the top level Makefile.

It is now possible to generate all files within this project by using:

    go generate ./...

Or the Makefile can continue to be used.

This commit also copies over the special copy of `tmpl` that the storage
engine uses within the influxdb repository. It was never copied over so
using `go generate` on these packages did not work.
2018-10-15 11:01:27 -05:00
Stuart Carnie 025241629d fix(reads): Ensure error returned from f is captured 2018-10-11 13:41:54 -07:00
Jonathan A. Sternberg e7e17d6972
refactor: move the logger package from influxdb to platform
We are moving the necessary code for 2.0 from the influxdb 1.X
repository to the platform 2.0 repository. The logger is an unnecessary
dependency on the old influxdb that is making life more complicated.
2018-10-10 15:49:07 -05:00
Adam 195eb04350
Chore/move from function to platform (#1013)
* moved execution code for from into query/functions/inputs

* rebase with master, disable buckets accessed test
2018-10-09 20:36:41 -04:00
Jeff Wendling 5fa04a8d56 share some more code with reads 2018-10-09 09:51:13 -06:00
Jeff Wendling 6256926563 fix generation and rerun it with the go.mod gogofaster 2018-10-09 09:51:13 -06:00
Jeff Wendling 810833f33f chore: refactor reads service and make it consumable externally
This pulls in the code that allows doing reads with flux into the
platform repo, and removes extra.go.

The reusable portion is under storage/reads, where the concrete
implementation for one of the platform's engines is in
storage/readservice.

In order to make this more reusable, the cursors had to move into
their own package, decoupling it from all of the other code in the
tsdb package. tsdb/cursors is this new package, and type/function
aliases have been added to the tsdb package to point at it.

The models package already is very light on transitive dependencies
and so it was allowed to be depended on in a concrete way in the
cursors package.

Finally, the protobuf definitions for issuing GRPC reads has been
moved into its own package for two reasons:
    1. It's a clean separation, and helps keep it that way.
    2. Many/most consumers will not be using GRPC. We just
       use the datatypes to express the API which helps making
       a GRPC server easier.
It is left up to future refactorings (specifically ones that involve
GPRC) to determine if these types should remain, or if there is a
cleaner way.

There's still some dependencies on both github.com/influxdata/influxql
and github.com/influxdata/influxdb/logger that we can hopefully remove
in future refactorings.
2018-10-09 09:51:13 -06:00