It may become a uint64 in the future, for example. This does mean
that we have to call Decode on some data that we just Encoded, but
we can fix that later.
This commit generates an additional `.tss` stats file alongside each
TSM file when it is written that contains size stats for all measurements
within the TSM file. These files can be combined to generate stats for
all measurements across all TSM files.
We reorganized the functions in flux to have the structure:
/functions
/inputs
/transformations
/outputs
this PR catches up platform to work with the new package layout.
As a separate refactoring issue, we should discuss:
from(bucket: ) should migrate from flux --> platform
to_http and to_kafka should migrate from platform --> flux
The race detector was picking up a data race because of the
unsynchronized reassignment of ctx:
```
$ go run -race ./cmd/influxd
...
^C
==================
WARNING: DATA RACE
Write at 0x00c00053d220 by main goroutine:
main.platformF()
/Users/mr/gomod/platform/cmd/influxd/main.go:381 +0x2cf7
github.com/spf13/cobra.(*Command).execute()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x8b2
github.com/spf13/cobra.(*Command).ExecuteC()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x432
github.com/spf13/cobra.(*Command).Execute()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x38
main.Execute()
/Users/mr/gomod/platform/cmd/influxd/main.go:388 +0x4e
main.main()
/Users/mr/gomod/platform/cmd/influxd/main.go:46 +0x2f
Previous read at 0x00c00053d220 by goroutine 147:
main.platformF.func1()
/Users/mr/gomod/platform/cmd/influxd/main.go:330 +0x3c
Goroutine 147 (running) created at:
main.platformF()
/Users/mr/gomod/platform/cmd/influxd/main.go:329 +0x2554
github.com/spf13/cobra.(*Command).execute()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x8b2
github.com/spf13/cobra.(*Command).ExecuteC()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x432
github.com/spf13/cobra.(*Command).Execute()
/Users/mr/go/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800 +0x38
main.Execute()
/Users/mr/gomod/platform/cmd/influxd/main.go:388 +0x4e
main.main()
/Users/mr/gomod/platform/cmd/influxd/main.go:46 +0x2f
==================
```
So just assign context.WithCancel to a new variable instead.