Commit Graph

1164 Commits (2fa0e03162c0b21e47dbf61bc436a37d224b7a33)

Author SHA1 Message Date
Paul Dix 8ed3a1b440
feat: Initial prototype of WriteBuffer and WAL (#271)
This is the initial prototype of the WriteBuffer and WAL. This does the following:

* accepts a slice of ParsedLine into the DB
* writes those into an in memory structure with tags represented as u32 dictionaries and all field types supported
* persists those writes into the WAL as Flatbuffer blobs (one WAL entry per slice of lines written, or WriteBatch)
* has a method to return a table from the buffer as an Arrow RecordBatch
* recovers the WAL after the database is closed and opened back up again
* has a single test that covers the end-to-end from the DB side
* It doesn't include partitioning yet. Although the write_lines method does actually try to do partitions on time. That'll get changed to be something more general defined by a per database configuration.
* hooked up to the v2 HTTP write API
* hooked up to a read API which will execute a SQL query against the data in the buffer

This includes a refactor of the WAL:

Refactors the WAL to remove async and threading so that it can be moved higher up. This simplifies the API while keeping just about the same amount of code in ParitionStore to handle the asynchronous writes.

This also modifies the WAL to remove the SideFile implementation, which was causing significant performance problems and write amplification. The downside is that WAL writes are no longer guarranteed atomic.

Further, this modifies the WAL to keep the active segement file handle open. Appends now don't have to list the directory contents and look for the latest file and open the file handle to do appends, which should also improve performance and reduce iops.
2020-09-08 14:12:16 -04:00
Carol (Nichols || Goulding) 66b8e034f9
Merge pull request #275 from influxdata/cn/make-url-pub
fix: Make influx client's URL public
2020-09-04 17:24:57 -04:00
Carol (Nichols || Goulding) efaab117de fix: Make influx client's URL public
In the data generator, we're going to have potentially 2 different
clients for the data and for telemetry, and I'd like to be able to log
how they're configured, for example.

I don't see any reason for URL to
be private, because the user of the client passed in the URL and we
haven't changed anything about it.
2020-09-04 17:07:40 -04:00
Carol (Nichols || Goulding) e7f09d0af2
Merge pull request #274 from influxdata/cn/names
fix: Clarify what takes org/bucket names and what takes IDs
2020-09-03 10:29:40 -04:00
Carol (Nichols || Goulding) 4ab8597f50 fix: Clarify what takes org/bucket names and what takes IDs
Connects to influxdata/fusion#60

As far as I can tell, `/api/v2/write` uses `org` and `bucket` params
that can take org and bucket names, so just call those `org` and
`bucket` throughout and clarify in examples they can be any string.

However, `/api/v2/buckets` uses only `orgID` that must be the
organization's 16-digit hex ID, so clarify that case.

This means in examples where we create a bucket and push points into it,
we'll need both a hex ID and name for the organization.
2020-09-02 16:32:24 -04:00
Carol (Nichols || Goulding) 600960a5e3
Merge pull request #273 from influxdata/cn/influx-auth 2020-09-02 12:37:42 -04:00
Carol (Nichols || Goulding) 6223cbdc99 feat: Add an authorization token to all client requests
Connects to influxdata/fusion#59. Delorean currently ignores this
header.

Also add an example of using this to connect to an InfluxDB 2 instance;
I tested this out with a locally running Influx DB 2 and I was able to
write points!
2020-09-02 10:33:45 -04:00
Carol (Nichols || Goulding) 0f1cd1a77e refactor: Extract a method for building requests to share common code soon 2020-09-02 09:56:36 -04:00
Carol (Nichols || Goulding) 5d637c3d4a
Merge pull request #269 from influxdata/cn/more-types
feat: Support storage of points with String and Boolean fields
2020-08-14 13:56:41 -04:00
Carol (Nichols || Goulding) 5f49543fdf feat: Support storage of points with String and Boolean fields 2020-08-14 10:57:20 -04:00
Carol (Nichols || Goulding) c6dadb526f
Merge pull request #268 from influxdata/cn/client-add-bucket 2020-08-12 14:01:55 -04:00
Carol (Nichols || Goulding) 1cb3d025c6
fix: typo
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-08-12 13:50:45 -04:00
Carol (Nichols || Goulding) d59702ec79 feat: Make the create bucket HTTP API match the Influx 2.0 API
The `/api/v2/create_bucket` API was delorean-specific for testing
purposes. This change makes it match the [Influx 2.0 API][influx] and
adds a method to the client for creating buckets.

The client will always send an empty array of `retentionRules` because
that is a required parameter for the Influx API. Delorean always ignores
`retentionRules`. The `description` and `rp` parameters are optional and
are never sent.

[influx]: https://v2.docs.influxdata.com/v2.0/api/#operation/PostBuckets

I believe the gRPC create bucket is also delorean-specific and perhaps
not needed, but I'm leaving it in for now with a note.
2020-08-12 10:08:32 -04:00
Andrew Lamb 2aad349463
Merge pull request #267 from influxdata/cn/visibility
fix: Make the influx client data_point module public
2020-08-05 16:33:49 -04:00
Carol (Nichols || Goulding) 6136fd35d1 fix: Make the influx client data_point module public
Driven by use in fusion.
2020-08-05 14:57:00 -04:00
Edd Robinson feeac88f24
Merge pull request #266 from influxdata/er/feat/sort-packers
feat: add ability to sort tables of `Packers` data via multiple columns
2020-08-04 21:42:23 +01:00
Edd Robinson 21c0155271 fix: improve pivot for certain sorts 2020-08-04 21:33:58 +01:00
Edd Robinson deb9975594 test: fix tests 2020-08-04 21:12:07 +01:00
Edd Robinson db15ef4d37 refactor: PR feedback
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback
2020-08-04 18:49:39 +01:00
Edd Robinson d0d223c7cc feat: add mutli-column Quicksort for `[Packers]` 2020-08-04 18:49:39 +01:00
Edd Robinson 39db199613
Merge pull request #264 from influxdata/er/perf/packers
perf: improve performance of materialising Packers
2020-08-04 18:49:18 +01:00
Edd Robinson 8ef76debe9 refactor: PR feedback
Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>

refactor: PR feedback

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>

refactor: PR feedback
2020-08-04 18:42:37 +01:00
Edd Robinson cc39bf3cb4 refactor: address PR feedback 2020-07-31 11:41:57 +01:00
Edd Robinson e40fecb1ff perf: reduce cost of materialising packer rows 2020-07-30 15:38:29 +01:00
Carol (Nichols || Goulding) c315cb2afb
Merge pull request #263 from influxdata/fix-parquet
fix: Turn off default features of parquet so arrow-flight doesn't repeatedly rebuild
2020-07-30 09:51:24 -04:00
Carol (Nichols || Goulding) 19159138cc fix: Turn off default features of parquet so arrow-flight doesn't repeatedly rebuild
Fixes #261
2020-07-30 09:43:12 -04:00
Edd Robinson 23aa5a4981 test: add benchmarks for packers 2020-07-30 12:54:51 +01:00
Edd Robinson ac6f2c6eff feat: add iterator to Packer<T> 2020-07-30 12:36:22 +01:00
Andrew Lamb b3e2c0e3b6
Merge pull request #262 from influxdata/alamb/revert-parquet
chore: revert upgrade parquet dependency to 1.0.0"
2020-07-30 07:09:16 -04:00
alamb f946e84a12 chore: revert upgrade parquet dependency to 1.0.0"
This reverts commit 25259b4c99.
2020-07-30 07:02:53 -04:00
Andrew Lamb 0c28e34eea
Merge pull request #259 from influxdata/alamb/upgrade_parquet
chore: upgrade parquet dependency to 1.0.0
2020-07-28 16:19:21 -04:00
alamb 25259b4c99 chore: upgrade parquet dependency to 1.0.0 2020-07-28 15:11:35 -04:00
Carol (Nichols || Goulding) 498759de66
Merge pull request #258 from influxdata/cn/newlines 2020-07-27 15:32:32 -04:00
Carol (Nichols || Goulding) 76bfae30af refactor: Extract DataPoint to its own module 2020-07-27 14:41:00 -04:00
Carol (Nichols || Goulding) c7e70c0d3d fix: Write a newline after each point 2020-07-27 14:39:21 -04:00
Carol (Nichols || Goulding) 0a210f1cc1 test: Make failures easier to interpret by displaying the string value of the bytes 2020-07-27 14:38:39 -04:00
Carol (Nichols || Goulding) 0709f90040 test: Add a mock server test in the client crate for the newline bug 2020-07-27 14:10:54 -04:00
Carol (Nichols || Goulding) 7d09485cba refactor: Alphabetize dependencies 2020-07-27 14:06:03 -04:00
Carol (Nichols || Goulding) e15efb71cf test: Have the end-to-end test use DataPoint from the influx client
This is revealing a bug in the client
2020-07-27 14:03:06 -04:00
Carol (Nichols || Goulding) cd70373aa2
Merge pull request #257 from influxdata/refactor-data-point 2020-07-27 13:55:15 -04:00
Carol (Nichols || Goulding) 9de97e60a1 fix: Remove unneeded 'static and into 2020-07-27 13:46:22 -04:00
Carol (Nichols || Goulding) d944cce1f9 feat: Make FieldValues implement PartialEq
To enable assert_eq! for testing
2020-07-27 11:43:21 -04:00
Carol (Nichols || Goulding) 605f982b17 refactor: Switch from LineProtocol to a WriteDataPoint trait 2020-07-27 11:43:13 -04:00
Jake Goulding 3a9693d289 refactor: Switch from Escaped* types to String
And leave a comment explaining how non-UTF-8 data may be implemented in
the future.
2020-07-27 11:39:46 -04:00
Jake Goulding b72c2ffd73
Merge pull request #253 from influxdata/client-dynamic-data-point 2020-07-24 09:50:11 -04:00
Carol (Nichols || Goulding) d7859b9959 docs: Add explanation for why LineProtocol exists and is private
Co-authored-by: Andrew Lamb <alamb@influxdata.com>
2020-07-24 09:42:57 -04:00
Carol (Nichols || Goulding) 5b9a460173
Merge pull request #256 from influxdata/cn/remove-generate-and-seed-commands
fix: Remove generate/seed utilities
2020-07-23 09:43:31 -04:00
Carol (Nichols || Goulding) c179a7e8b2 fix: Remove generate/seed utilities
These are going to be redone in the fusion repo.
2020-07-22 17:15:30 -04:00
Carol (Nichols || Goulding) 3243300dec docs: Add a quick start example at the top with all functionality so far 2020-07-22 17:03:29 -04:00
Carol (Nichols || Goulding) 7ddd793264 fix: Return an error if attempting to build a DataPoint without any fields 2020-07-22 17:03:29 -04:00