Commit Graph

372 Commits (16157daad8564b6dfb93aed7479df76c2fec6669)

Author SHA1 Message Date
Andrew Lamb 7154dfd5f6
feat: Add timestamps to ChunkSummary (#1079)
* refactor: Move timestamps from mutable_buffer::Chunk to catalog::Chunk

* feat: Add timestamps to ChunkSummary

* feat: Add timestamp conversion logic to protobuf types

* test: Add tests

* fix: Update data_types test

* fix: handle negative nanos during conversion

* fix: clippy

* fix: more clippy

* fix: even more clippy

* fix: even more clippy
2021-03-30 19:03:23 +00:00
Nga Tran a630c119ab feat: make it easy to get OperationMetadata from Operation 2021-03-30 12:57:11 -04:00
Marko Mikulicic 569099fc6e feat: Derive serde for protos
Rationale
---------

Our CLI needs to be able to accept configuration as JSON and render configuration as JSON.

Protobufs technically have an official JSON encoding rule called 'jsonpb` but prost doesn't
offer native supprot for it.

`prost` allows us to specify arbitrary derive metadata to be added to generated
code. We emit the `serde` derive directives in the two packages that generate prost code
(`generated_types` and `google_types`).

We use the `serde(rename_all = "camelCase")` to approximate `jsonpb`.

We instruct `prost` to use `bytes::Bytes` for some types, hence we must turn on the `serde` feature
on the `bytes` dependency.

We also use json to serialize the output of the `database get` command, to showcase the feature
and get rid of a TODO. In a subsequent PR I'll teach `database create` (and the yet to be done `database update`) to accept an option JSON configuration body so we can configure partitioning, lifecycle, sharding etc rules etc.

Caveats
-------

This is not technically `jsonpb`. Main issues:
1. default values not omitted
2. no special rendering of special types like `google.protobuf.Any`

Future work
-----------

Figure out if we can get fully compliant `jsonpb`, or at least a decent approximation.

Effect
------

```console
$ cargo run -- database get foobar_weather
{
  "name": "foobar_weather",
  "partitionTemplate": {
    "parts": [
      {
        "part": {
          "time": "%Y-%m-%d %H:00:00"
        }
      }
    ]
  },
  "lifecycleRules": {
    "mutableLingerSeconds": 0,
    "mutableMinimumAgeSeconds": 0,
    "mutableSizeThreshold": 0,
    "bufferSizeSoft": 0,
    "bufferSizeHard": 0,
    "sortOrder": {
      "order": 2,
      "sort": {
        "createdAtTime": {}
      }
    },
    "dropNonPersisted": false,
    "immutable": false
  },
  "walBufferConfig": null,
  "shardConfig": {
    "specificTargets": null,
    "hashRing": null,
    "ignoreErrors": false
  }
}
```
2021-03-30 15:16:31 +00:00
Andrew Lamb 6a48001d13
refactor: Manage storage directly in the Catalog (#1057)
* refactor: Manage mutable buffer chunks directly

* fix: do not use mutable_buffer for listing table names
2021-03-29 17:55:07 +00:00
Raphael Taylor-Davies 1a4c793270
feat: lifecycle rules (#1045) 2021-03-29 15:32:36 +00:00
Raphael Taylor-Davies fb130ea99d
feat: use CatalogProvider and SchemaProvider (#1058)
* feat: use CatalogProvider and SchemaProvider

* refactor: review comments
2021-03-29 11:08:46 +00:00
Marko Mikulicic 98fe75c989 feat: Add ShardConfig to DatabaseRules proto 2021-03-26 14:07:59 +00:00
Andrew Lamb 44d67db733
feat: Rework Db to use Catalog for chunk state (#1043)
* feat: Rework Db to use Catalog for chunk state

* docs: Update server/src/db.rs

* fix: fmt

* fix: fmt

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-24 17:57:11 +00:00
Raphael Taylor-Davies dd94a33bc7
feat: retain limited tracker history (#1005) 2021-03-17 16:32:34 +00:00
Andrew Lamb 3a53923684
feat: Management API + CLI command to close a chunk and move to read buffer (#1002)
* feat: Management API + CLI command to close a  chunk and move to read buffer

* refactor: Less copy-pasta

* fix: track only once, use `let _` instead of `.ok()`

* docs: Apply suggestions from code review

fix comments ( 🤦‍♀️  for copy/pasta)

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

* docs: Update server/src/lib.rs

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

* refactor: Use DatabaseName rather than impl Into<String>

* fix: Fixup logical merge conflicts

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2021-03-17 15:25:27 +00:00
Andrew Lamb ef9c3f3d8f
feat: Management API + CLI command to list chunks in a partition (#995)
* feat: Management API + CLI command to list chunks in a partition

For ease of use

* refactor: remove unecessary Result
2021-03-16 20:10:55 +00:00
Raphael Taylor-Davies 3fe1b8c5b7
feat: add longrunning operations client (#981)
refactor: add separate format feature influxdb_iox_client

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-16 13:19:44 +00:00
Andrew Lamb 4781317647
feat: Management API + CLI command to create a new chunk (rollover partition) (#990)
* feat: Management API + CLI command to create a new chunk (rollover partition)

* fix: Update tests/end_to_end_cases/management_api.rs

fix typo

* fix: logical merge conflict

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-15 16:41:18 +00:00
Andrew Lamb 91a92e668a
refactor: complete migration of end-to-end.rs test to use #[tokio::test] (#987)
* refactor: pull Scenario code out of main module

* refactor: break out http into tests

* refactor: use random org_id and bucket_id

* refactor: port read_api to be indepndent

* refactor: port last test

* refactor: convenience methods to create different clients in end-to-end tests

* fix: improve comments

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-15 13:13:55 +00:00
Andrew Lamb facd02a0ec
feat: configure databases created with CLI with reasonable defaults (#971)
* feat: configure databases created with `database create ...` with reasonable defaults

* fix: remove truncated comments

* fix: Apply suggestions from code review

Improve comments

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

* fix:  creates a database without a mutable buffer

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2021-03-12 21:47:43 +00:00
Carol (Nichols || Goulding) cc8390f763 refactor: Use prost's enum helper functions for converting from ints 2021-03-12 21:10:10 +00:00
Andrew Lamb 1b36d6b0cd fix: Return Partition rather than strings 2021-03-12 20:33:39 +00:00
Andrew Lamb cd66814c3d feat: Add management API and CLI for listing partitions 2021-03-12 20:33:39 +00:00
Marko Mikulicic 334fb149b1
feat: Rename server run command to just run
Closes #976
2021-03-12 18:36:04 +01:00
Andrew Lamb 6fecf68bd4
feat: make CLI to listing database consistent with other commands (#974)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-12 14:43:49 +00:00
Andrew Lamb 6ac7e2c1a7
feat: Add management API and CLI to list chunks (#968)
* feat: Add management API and CLI to list chunks

* fix: Apply suggestions from code review

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

* fix: add comment to protobuf

* fix: fix comment

* fix: fmt, fixup merge errors

* fix: fascinating type dance with prost generated types

* fix: clippy

* fix: move command to influxdb_iox database chunk list

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2021-03-12 13:56:14 +00:00
Marko Mikulicic 9df4131e60 feat: Add server remote [set|remove|list] commands 2021-03-12 10:41:18 +00:00
Marko Mikulicic 8029aa887d feat: Add subcommands to server 2021-03-11 16:07:42 +00:00
Andrew Lamb af553f3b38
refactor: run some more end to end tests as tokio tests (#964)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-11 11:14:49 +00:00
Marko Mikulicic 79105b2c50
feat: Make server no longer the default command 2021-03-10 16:49:49 +01:00
Marko Mikulicic 5434846250
test: Detect if talking to the wrong test server
Closes #952

A pragmatic fix for #952: since we already set the server id in `wait_until_ready`,
let's start a test server without an ID (by not passing `INFLUXDB_IOX_ID`)
and use the property of already having an ID as an indication that we're talking
to a server instance that we didn't just start.

It doesn't necessarily mean we're talking to the right server, but the main point
of #952 was to avoid confusing error messages like "DatabaseAlreadyExists";
with this PR, the only way for that error to confuse developers is if we "unset" the
writer ID of a server fixture and leave it there hanging, with in-memory side effects
but no ID. Possible but unlikely, I think.
2021-03-10 16:03:02 +01:00
Andrew Lamb 2b72890028 fix: Revert "fix: Shutdown stest fixture on test harness exit"
This reverts commit 28fe808d7e.

Not needed after https://github.com/influxdata/influxdb_iox/pull/955 is merged
2021-03-10 09:28:03 -05:00
Andrew Lamb f568c083a4
fix: Do not leave child processes around after the end-to-end test (#955) 2021-03-10 14:25:27 +00:00
Andrew Lamb 1c6d25e7d8
refactor: Port end-to-end tests that modify global state to their own fixture (#949)
* refactor: Use autogenerated ports in end-to-end.rs

* refactor: Use different fixture for tests that change writer id

* fix: clippy
2021-03-10 14:05:35 +00:00
Marko Mikulicic 1b40ca7ab5 feat: Implement CRUD for remote addresses 2021-03-10 13:39:59 +00:00
Andrew Lamb 9ebedf744f
feat: Add CLI to query the database using SQL (#943)
* feat: Add CLI to query the database using SQL

* fix: merge conflicts
2021-03-10 13:21:12 +00:00
Marko Mikulicic 28fe808d7e fix: Shutdown stest fixture on test harness exit 2021-03-10 11:31:26 +00:00
Andrew Lamb 8163a31552
refactor: rework all end-to-end.rs tests to use the server fixture rather than const connection strings (#948) 2021-03-09 20:47:29 +00:00
Andrew Lamb 1af5cf8b7c
refactor: Move end-to-end test server fixture into its own module (#945)
* refactor: Move test server fixture into its own module

* fix: Update tests/end-to-end.rs

* fix: better error handling and display

* fix: tweak startup message
2021-03-09 19:08:55 +00:00
Paul Dix 706115178b
chore: remove cruft from config/database rules (#935)
The replication, query, and subscription concepts here are going to be signficiantly different. Thought it would be best to just remove this cruft for now to avoid confusion.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-09 13:48:59 +00:00
Andrew Lamb 500c237f62
feat: Add Service + CLI command to write line protocol to IOx (#939)
* feat: Add Service + CLI command to write line protocol to IOx

* fix: clippy

* fix: protobuf lint

* fix: LinePrtocol typo
2021-03-08 17:35:19 +00:00
Raphael Taylor-Davies 5c9dd68bf8
feat: MVP Management CLI (#907)
* feat: MVP CLI implementation

* feat: multiline database description
2021-03-03 17:37:55 +00:00
Raphael Taylor-Davies 51981c92f5
feat: implement gRPC API and migrate influxdb_iox_client to use it (#853)
* feat: implement gRPC management API

* feat: migrate influxdb_iox_client to use gRPC API

* fix: review comments

* refactor: separate influxdb_iox_client error types

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-02 17:51:46 +00:00
Raphael Taylor-Davies 84764002a2
refactor: use structopt for CLI root (#892)
* refactor: use structopt for CLI root

* refactor: PR feedback
2021-03-01 18:45:14 +00:00
Andrew Lamb eca92b69da
feat: implement format parameter on sql query endpoint (#870)
* feat: implement format parameter on sql query endpoint

* feat: include Content-Type header

* fix: return proper JSON

* test: add tests for JsonArrayWriter

* refactor: remove use of tempfile

* fix: clippy / fmt
2021-02-26 11:43:03 +00:00
Raphael Taylor-Davies ffc20fa821
feat: add basic gRPC health service (#862)
* feat: add basic gRPC health service

* feat: update README.md add /health to HTTP API

* feat: add health client to influxdb_iox_client

feat: end-to-end test health check service

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-02-25 13:24:12 +00:00
Raphael Taylor-Davies 042c61908e
refactor: move gRPC storage into own module (#814)
* refactor: move gRPC storage into own module

refactor: encpasulate grpc server creation within modules

refactor: pass concrete Server<M> to rpc::make_server

* refactor: review comments

* refactor: cargo fmt

Co-authored-by: Edd Robinson <me@edd.io>
2021-02-16 12:26:20 +00:00
Raphael Taylor-Davies 6d3c21b952 feat: Use Bytes instead of Vec<u8> in prost generated code
Also add google.rpc.* Protobuf definitions
2021-02-12 17:10:58 +00:00
Marko Mikulicic c61923f05e fix: Avoid clashing ports when running e2e tests
Closes #745
2021-02-11 17:02:44 +00:00
kodiakhq[bot] a242fc39aa
Merge branch 'main' into jg/flight-client 2021-02-11 14:29:54 +00:00
Paul Dix 4c43c311f0
feat: Add database rules configuration for mutable buffer (#779)
* feat: Add database rules configuration for mutable buffer

* refactor: change all database rules usage to use mutable_buffer_config rather than store_locally
2021-02-10 18:36:29 -05:00
Carol (Nichols || Goulding) afdb0c8274 fix: Return better errors instead of unwrapping 2021-02-10 10:30:58 -05:00
Jake Goulding 699f4a577f feat: Add an optional Flight client to the IOx client library 2021-02-10 10:30:05 -05:00
Carol (Nichols || Goulding) 1f1ebefd7a fix: Switch to database name instead of org/bucket for the Flight API 2021-02-03 10:02:06 -05:00
Jake Goulding 39338b195b feat: Basic scaffolding of a flight server do_get 2021-02-03 09:56:56 -05:00
Carol (Nichols || Goulding) deaeff0173 refactor: Extract smaller functions for grpc tests
This makes it easier to see what's being tested and zero in on what
you're interested in rather than needing to scroll and scan through a
lot of code in the main test.
2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 8ade506a0c refactor: Extract independent test helper functions to separate files 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 41e0fff039 refactor: Extract gRPC read group and read window agg tests because they manage their own data 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) cfe18e3e61 refactor: Extract a method to create gRPC ReadSource to the Scenario 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) bfe779d7b8 refactor: Incorporate ns_since_epoch into the Scenario
I want this to be an implementation detail of the tests, not something
you have to worry about when wondering what this test is hoping to test.
2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 05e79ed343 refactor: Make getter methods on Scenario for dependent values 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 6ba27152e3 refactor: Change Scenario to use the builder pattern 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 352b7ec829 refactor: Extract a Scenario struct to group related setup together 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) daa8b7ef0a refactor: Extract more helper functions 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) c4be42324b test: Remove code testing unused disk-based WAL restoration
Restarting the test server and testing for WAL restoration on startup
(and possible error scenarios) was disabled in 70ff426, which also noted
that significant refactoring will likely be needed when loading info on
startup is re-enabled. With that in mind, remove this code creating an
invalid dir in the WAL dir.
2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 15389d5665 refactor: Improve the names of client and client2 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 422cbdb3b2 refactor: Move some helper functions after the main test 2021-01-29 08:34:28 -05:00
Carol (Nichols || Goulding) 0d174a2e1f refactor: Use data_types fn to create database name 2021-01-29 08:34:28 -05:00
Paul Dix 45d25fcbcd feat: add loading of database rules on startup
This adds functionality to the server to load database rules on startup. Follow on work will update the rules to store additional data (the catalog) and ensure that updates to the catalog can occur as outlined in #651. This work also updated the configuration to not require a database directory so the server can run entirely in memory. I needed this to get the end-to-end test passing since the file object store API doesn't yet have the functionality needed. I've logged #688 to track adding that in.
2021-01-22 16:06:10 -05:00
Andrew Lamb 4b5204cc8f
fix: Update end-to-end.rs to have moe specific error messages (#674) 2021-01-19 15:54:13 -05:00
Andrew Lamb 71627120b9
refactor: consolidate line protocol schema creation into data_types and port code to use it (#663)
* refactor: consolidate line protocol schema creation into data_types, and port code to use it

refactor: Port mutable buffer to use SchemaBuilder

* fix: doctest

* refactor: remove unecessary clippyisms

* docs: Improve comments via suggestions from code review

Co-authored-by: Edd Robinson <me@edd.io>

* refactor: use more idomatic try_ naming and TryInto trait

* docs: Change from line protocol data model to InfluxDB data model

* refactor: rename LP --> Influx in code

* feat: add support for UInteger type

Co-authored-by: Edd Robinson <me@edd.io>
2021-01-15 17:29:30 -05:00
Dom 30d5857fd4 chore: fix lints 2021-01-13 18:07:19 +00:00
Dom bdc832d040 refactor: replace config system with structopt
Replaces the hand-rolled config system with a StructOpt managed config struct.

I've got most of it ported across, but the interaction between all the logging
config bits is complex! I've left what is there and hooked in the value from
the config struct (which directly replaces the env var in usage, as it also
sources from the env).
2021-01-11 18:43:14 +00:00
Paul Dix d17ef800c5
feat: add create and get database to API (#619)
* feat: add create and get database to API

This commit is start of the IOx specific API. It puts everything under /iox/api/v1 as this is the beginning of the IOx API. Creating a database is done with a PUT and a GET request can retrieve the DatabaseRules details.

* feat: add defaults for DatabaseRules for create_database

* feat: add create and get database to API

This commit is start of the IOx specific API. It puts everything under /iox/api/v1 as this is the beginning of the IOx API. Creating a database is done with a PUT and a GET request can retrieve the DatabaseRules details.
2021-01-07 12:25:37 -05:00
Andrew Lamb 9f0ff678f1
feat: Formalizes the config system for IOx, including tests (#608)
* feat: Create configuration system, port IOx to use it

* docs: Apply suggestions from code review

Co-authored-by: Paul Dix <paul@influxdata.com>

* fix: fix test for setting values

Co-authored-by: Paul Dix <paul@influxdata.com>
2020-12-31 07:02:31 -05:00
Andrew Lamb 163f34c27b
feat: report support for read_group in capabilities request (#586) 2020-12-22 10:06:48 -05:00
Andrew Lamb 263af1eeac
feat: implement read_group in the write_buffer (#583)
* feat: implement read_group in the write_buffer

* fix: Apply suggestions from code review

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

* fix: rustfmt

* fix: adjust tests for min/max

* fix: Update write_buffer/src/table.rs

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

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-22 09:03:20 -05:00
Paul Dix 70ff4267ce
chore: Connect server crate to http routes and server command (#569)
* chore: Connect server crate to http routes and server command

This updates the http_routes and main server to use the Server crate. This is the first step in a larger effort to start hooking up the initial IOx API and get things running end to end with in-memory database, WAL buffer, and object storage.

For the time being, this disables the previous disk based WAL. Or rather, it uses the WriteBufferDb without it. That means that this IOx server has no persistence until later. Because of this, the restart in the end-to-end was removed.

Later PRs will add the WAL buffer and restart logic that loads from object store. We can opt to bring the local disk based WAL back later, but it will likely require some refactoring to work with how the WAL Buffer will operate.
2020-12-17 18:48:41 -05:00
Andrew Lamb 699504a022
feat: implement read_group for Sum, Count and Mean aggregates (#557)
* feat: Implement read_group for "normal" aggregates

* test: add tests
2020-12-15 09:35:00 -05:00
Andrew Lamb 1740e26ec3
fix: do not produce gRPC series frames for fields that only contain null values (#558)
* test: add test for field columns with only nulls

* fix: do not produce series for null fields, tests for same

* fix: remove uneeded test printlns
2020-12-15 08:28:23 -05:00
Dom 6f473984d0 style: wrap comments
Runs rustfmt with the new config.
2020-12-11 18:22:26 +00:00
Andrew Lamb 50ba529cb8
test: Adds tests for read_group for None aggregates (#538) 2020-12-10 11:31:15 -05:00
Andrew Lamb 8cb8276819
fix: Update gRPC definitions so tag_key=_field requests work in IOx (#517)
* fix: Update gRPC definitions so tag_key=_field requests work in IOx

* docs: Update src/server/rpc.rs

* fix: fixup test

* fix: Apply suggestions from code review

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

* fix: consistent type annotations

* fix: refactor redundant test code into test_helpers

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-12-02 13:58:48 -05:00
Dom c3a0e893ae test: use flate2 2020-12-01 11:01:10 +00:00
Andrew Lamb 20f421e9c6
fix: Do not send GroupFrames in response to read_window_aggregate (#497)
* fix: Do not send GroupFrames in response to read_window_aggregate

* fix: clippy and test
2020-11-30 05:59:05 -05:00
Andrew Lamb 0eaa90e89d
feat: Hook up read_window_aggregate into the write_buffer, end-to-end tests (#483)
* feat: read_window_aggregate_plans

* fix: clippy sacrifice

* fix: clippy

* fix: clippy
2020-11-25 10:20:49 -05:00
Andrew Lamb 85921fe401
feat: Implement gRPC and storage interface for read_group_aggregate (#474)
* feat: Implement gRPC and storage interface for read_group_aggregate

* fix: clippy

* docs: Tweak comments

* fix: moar clippy

* fix: fmt

* docs: Apply doc improvement suggestions from code review

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

* refactor: improve error creation

* refactor: use match instead of if

* refactor: clearer match

* refactor: clean up storage aggregate matching

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-11-24 13:41:11 -05:00
Andrew Lamb 87626a3635
feat: Update storage protobuf definitions, add stubs for read_window_aggregate (#444)
* feat: Update storage protobuf definitions, add stubs for read_window_aggregate

* refactor: Extract the features field in a clearer way

* docs: Add provenance information to service.proto
2020-11-12 07:07:42 -05:00
Andrew Lamb 659da9264a
chore: Update predicate protobuf definitions (#443) 2020-11-11 18:06:39 -05:00
Andrew Lamb b745a180a4
refactor: rename delorean --> InfluDB IOx (#417) 2020-11-05 13:51:04 -05:00
Andrew Lamb a52e0001c5
refactor: rename all crates that start with`delorean_` in preparation for rename (#415)
* refactor: rename delorean_cluster --> cluster

* refactor: rebane delorean_generated_types --> generated_types

* refactor: rename delorean_write_buffer --> write_buffer

* refactor: rename delorean_ingest --> ingest

* refactor: rename delorean_storage --> storage

* refactor: rename delorean_tsm --> tsm

* refactor: rename delorean_test_helpers --> test_helpers

* refactor: rename delorean_arrow --> arrow_deps

* refactor: rename delorean_line_parser --> influxdb_line_protocol
2020-11-05 13:44:36 -05:00
Andrew Lamb ef501871bb
feat: remove partition_store (#387) 2020-10-26 14:39:38 -04:00
Andrew Lamb 880958d9c7
feat: switch end-to-end test to use write_buffer implementation rather than partitioned store (#386)
* feat: switch end-to-end test to use write_buffer implementation rather than partitioned store

* fix: Apply PR suggestions
2020-10-26 13:42:38 -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) 5f49543fdf feat: Support storage of points with String and Boolean fields 2020-08-14 10:57:20 -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
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) 876796a59d refactor: Remove duplication by having write call write_line_protocol 2020-07-22 17:03:29 -04:00
Carol (Nichols || Goulding) 879b981897 refactor: Rename write methods to clarify their uses 2020-07-22 17:03:29 -04:00
Andrew Lamb 143c350ecb
Merge pull request #250 from influxdata/alamb/feat-multi-col-stats
feat: Update stats command to handle directories of files
2020-07-20 16:48:31 -04:00
Carol (Nichols || Goulding) bfd0f30152 test: Avoid an allocation and have a consistent API
This is temporary until we have a better point-building method anyway.
2020-07-17 17:14:20 -04:00
alamb ca1bd79902 feat: Update stats command to handle directories of files 2020-07-17 16:47:11 -04:00
Carol (Nichols || Goulding) 668aefae9b feat: Implement a rudimentary write API in the influx client 2020-07-17 10:28:19 -04:00
Carol (Nichols || Goulding) b1ce3958e5 fix: Define a fully-featured error for the Id type 2020-07-16 20:30:54 -04:00
Carol (Nichols || Goulding) 5afc3a1e3b fix: Ignore anything in the WAL dir that doesn't parse as an Org ID instead of crashing 2020-07-16 11:28:57 -04:00
Andrew Lamb 6ee72e5733
Merge pull request #239 from influxdata/alamb/less-chatty
fix: Make default output of delorean less chatty
2020-07-10 06:59:54 -04:00
alamb d1e334f3fe fix: Make default output of delorean less chatty 2020-07-08 18:02:48 -04:00
Edd Robinson 50ef521e6c feat: add support for converting multiple TSM files
This commit extends the ingest crate to support converting multiple TSM
files to a single Parquet file by merging identical measurements across
the TSM files.

This does not yet support merging blocks that overlap.
2020-07-08 22:57:15 +01:00
Jake Goulding 0deb608207 fix: Use correct route to ping 2020-07-03 15:35:04 -04:00
alamb 5f045fd9da fix: more cleanup 2020-07-03 07:01:22 -04:00
alamb 5fad7db0ac feat: Add better error handling and logging for http_routes 2020-07-01 16:08:49 -04:00
Andrew Lamb b5a91fae36
Merge pull request #207 from influxdata/alamb/faster-test-harness
fix: speed up end-to-end test harness so it polls rather than waits; Add PING route
2020-07-01 12:46:05 -04:00
alamb 6021ddd222 fix: more PR feedback 2020-07-01 12:41:59 -04:00
alamb 1f61fd820b fix: style cleanup 2020-07-01 12:31:42 -04:00
Andrew Lamb d16aec7e80
fix: Update tests/end-to-end.rs
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-07-01 12:29:17 -04:00
alamb d7ddcfa92f fix: fixup errors introduced during PR comments 2020-07-01 08:44:24 -04:00
Andrew Lamb f608bf4f0f
fix: Update tests/end-to-end.rs
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-07-01 08:41:21 -04:00
Andrew Lamb 6b71fcacde
fix: Apply suggestions from code review
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-07-01 08:39:56 -04:00
alamb 8be278aadd fix: speed up end-to-end test harness so it polls rather than waits 2020-06-30 12:21:25 -04:00
alamb dc8d655486 feat: Implement CapabilitiesResponse 2020-06-30 11:17:45 -04:00
Carol (Nichols || Goulding) c6f2508abe fix: Use clap's possible_values method
This gets us built-in help text and error messages, and does less work
before failing because of an unsupported value.

Before this change, the help text was:

```
OPTIONS:
        --compression-level <compression_level>
            Compression level: max or compatibility (default). [default: compatibility]
```

After this change, the help text is:

```
OPTIONS:
        --compression-level <compression_level>
            How much to compress the output data. 'max' compresses the most; 'compatibility' compresses in a manner more
            likely to be readable by other tools. [default: compatibility]  [possible values: max, compatibility]
```

Before this change, if you supplied an unsupported value, the error was:

```
[2020-06-29T14:47:42Z INFO  delorean::commands::convert] convert starting
[2020-06-29T14:47:42Z INFO  delorean::commands::convert] Preparing to convert 591 bytes from tests/fixtures/lineproto/temperature.lp
Conversion failed: Error creating a parquet table writer Unknown compression level 'foo'. Valid options 'max' or 'compatibility'
```

After this change, the error is:

```
error: 'foo' isn't a valid value for '--compression-level <compression_level>'
	[possible values: compatibility, max]
```
2020-06-29 10:53:01 -04:00
alamb c35b0e835c fix: clippy 2020-06-29 10:25:43 -04:00
alamb e8a0233b09 feat: add configurable compression level 2020-06-29 10:25:43 -04:00
alamb 511d2b6436 refactor: move benchmark test data to tests/fixtures 2020-06-26 17:41:37 -04:00
Jake Goulding 672afa1195 refactor: Merge unknown and missing extension errors 2020-06-26 16:07:35 -04:00
Jake Goulding aca63b68b2 refactor: Use more unique errors for the commands 2020-06-26 16:01:59 -04:00
Jake Goulding bca4d00716 refactor: use SNAFU more idiomatically in command modules 2020-06-26 13:26:51 -04:00
Edd Robinson 99268f5260 test: add coverage for converting tsm file 2020-06-26 11:50:37 +01:00
Andrew Lamb 322a491b9d
perf: Improve line protocol --> parquet conversion performance by ~20% (#177)
* feat: benchmark for lp->parquet performance

* feat: improve parser performance by storing contiguous EscapedStr

* fix: remove all string copies during LP-Parquet conversion

* refactor: Implement from_str as From<&str> only

* refactor: implement Deref instead of as_str

* refactor: Remove ends_with because Deref now makes it work

* refactor: Eq can be derived

* refactor: Remove unused From implementation

* refactor: Replace single-character strings with chars as requested by clippy

Co-authored-by: Carol (Nichols || Goulding) <carol.nichols@integer32.com>
2020-06-23 05:42:19 -04:00
Edd Robinson e507183fbd refactor: cleanup + clippy 2020-06-22 18:56:17 +01:00
Andrew Lamb 506a7f19d5
feat: add stats command for computing storage statistics (#160)
* feat: add stats command for computing storage statistics

* fix: Make function name less redundant

* fix: Apply suggestions from code review

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

* fix: remove changes to Cargo.lock

* fix: Cleanup to use `impl Into<String>` rather than String::from

* fix: fmt

* fix: less mut builder

* fix: fmt

* fix: clippy/fmt

* fix: fixup test

* fix: remove dstool reference

Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-06-22 07:33:52 -04:00
Carol (Nichols || Goulding) 78c2fb99ac refactor: Remove all references to 'dstool'
Since it got merged into the main `delorean` binary.
2020-06-19 11:08:59 -04:00
Andrew Lamb a106e55fa6
feat: Add parquet metadata dumping (#159)
* feat: Add parquet metadata dumping

* fix: Update delorean_parquet/src/error.rs

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

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-06-18 18:34:49 -04:00
Andrew Lamb 91de50a3a7
refactor: Refactor convert command code to have a place for TSM (#164) 2020-06-18 09:57:54 -04:00
Andrew Lamb abb3338483
test: add an end to end test for writing multiple parquet files (#145)
* test: add an end to end test for writing multiple parquet files

* fix: whitespace ocd
2020-06-15 07:12:16 -04:00
Andrew Lamb d9278263a7
feat: write multiple measurements to multiple parquet files (#138)
* feat: write to a directory of parquet files

* feat: change LineProtocolConverter to push style, move sampling there

* feat: full push mode, write to multiple measurements

* fix: clarify comments on finalize

* fix: Apply suggestions from code review

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

* fix: clippy/fmt

* fix: remove whitespace

* fix: Apply suggestions from code review

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

* fix: fmt

* fix: make it compile again

* fix: fixup comments

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

* fix: remove unecessary debug implementation

* fix: cleaner comment

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

* fix: clearer iterator name

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

* fix: Apply suggestions from code review

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

* fix: clean

* fix: make it compile

* fix: type fix

* fix: whitespace

* fix: more review comments

* fix: more review comments

* fix: code review comments + fmt

* fix: clippy

* fix: Use EscapedStr directly for performance

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-06-12 17:19:35 -04:00
Andrew Lamb faf3f534ac
refactor: move all dstool code into delorean binary (#131)
* refactor: move all dstool code into delorean binary

* fix: Move code/mods to make it compile and run

* fix: warn if db dir does not exist

* refactor: Match argument subcommands w/ more idomatic  rust

* fix: Apply suggestions from code review

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

fix: restore hyper logging

fix: Apply suggestions from code review

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

* fix: update expected code

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-06-10 16:04:46 -04:00
Andrew Lamb 81810c2faa
fix: rename measurement.txt to measurement.lp for consistency (#122)
* fix: rename measurement.txt to measurement.lp for consistency

* fix: rename the file
2020-06-05 17:28:06 -04:00
Andrew Lamb e0c38d0976
chore: Add test to check for tsm reading errors, update doc example (#117)
* chore: Add a test that decodes the entire tsm index

* fix: update test and change example to not use hard coded len

* fix: comment cleanup

* fix: clippy

* fix: Apply suggestions from code review

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

* fix: fmt/clippy after code review

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2020-06-05 16:22:56 -04:00
Jake Goulding 68fb580b43
style: Re-enable the elided lifetimes lint and move generated types to their own crate (#119)
* refactor: rename the module containing generated types

The nested `delorean` was confusing anyway, and this will make more
sense when we extract a new crate.

* refactor: Move the generated types to their own crate

This allows us to have more lax warnings in that crate alone, keeping
the main crate more strict.

* style: Re-enable elided lifetimes lint in the main crate
2020-06-05 16:22:27 -04:00
Edd Robinson 413738a264 feat: support org and bucket ID in entries 2020-06-04 14:36:43 +01:00
Andrew Lamb 18b05ce9ef
fix: move test of dstool to its delorean_storage_tool package (#107) 2020-06-02 16:10:30 -04:00
Andrew Lamb fbc74348c6
fix: consistent capitalization and data location (#105) 2020-06-02 08:00:13 -04:00
Andrew Lamb 1a2efdfd71
feat: Add dstool command line tool (#102)
* feat: Add dstool command line tool

* clippy

* Update delorean_storage_tool/src/main.rs

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

* Update delorean_storage_tool/src/main.rs

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

* Add in tests + PR comments

* fmt

* build first then run tests

* actually build before test

Co-authored-by: Carol (Nichols || Goulding) <193874+carols10cents@users.noreply.github.com>
2020-06-02 07:33:43 -04:00
Carol (Nichols || Goulding) 0a02afe016
test: Wait for test server to stop before restarting (#92) 2020-05-26 17:34:54 -04:00
Carol (Nichols || Goulding) e25a4e1e83 feat: Integrate the WAL with delorean 2020-05-11 15:38:47 -04:00
Jake Goulding bff4d2d6d9 refactor: Move temporary directory creation to test helpers 2020-05-11 15:26:00 -04:00
Carol (Nichols || Goulding) 7d568704cd feat: Implement MeasurementFields gRPC request 2020-05-04 15:52:01 -04:00
Carol (Nichols || Goulding) e615607f4a feat: Implement MeasurementTagValues gRPC request 2020-05-04 15:52:01 -04:00
Carol (Nichols || Goulding) 1ab9230654 feat: Implement measurement tag keys request 2020-05-04 15:52:00 -04:00
Carol (Nichols || Goulding) e6e911ce3c feat: Implement the Measurement Names gRPC request 2020-05-04 15:52:00 -04:00
Carol (Nichols || Goulding) e0eb895a14 test: Add more measurements to the e2e test data 2020-05-04 15:52:00 -04:00
Jake Goulding a6682467a7 fix: Use approximate floating point comparisons for slices as well 2020-05-01 13:05:00 -04:00
Carol (Nichols || Goulding) 6dd7c0a3e8 fix: Treat gRPC bucket_id as bucket name because MemDB assigns bucket ID 2020-04-13 16:40:38 -04:00
Carol (Nichols || Goulding) 429d0e1851 fix: Change name of the proto package to match proto used by Go
So that `storectl query` requests will work with delorean
2020-04-13 16:40:38 -04:00
Carol (Nichols || Goulding) a85f0edfc6 feature: Use the new ID type everywhere 2020-04-13 16:40:38 -04:00
Carol (Nichols || Goulding) 0314bc6ba2 fix: Change the default gRPC port to match storectl
8082 appears to be the default here:
b304e751e1/cmd/storectl/query/query.go (L56)
2020-04-13 16:03:23 -04:00
Carol (Nichols || Goulding) 56a2b323be feature: Implement ReadGroup 2020-04-06 10:23:43 -04:00
Carol (Nichols || Goulding) 747585e0b5 test: Make more interesting test data 2020-04-06 09:08:34 -04:00
Carol (Nichols || Goulding) 39dad5de31 fix: Always return long form of _f and _m from gRPC calls 2020-04-03 17:20:00 -04:00
Carol (Nichols || Goulding) a801f19b70 refactor: Extract a method to get sorted tags from ReadBatches 2020-04-03 17:18:05 -04:00
Carol (Nichols || Goulding) 7356bc33ed refactor: Rearrange construction of data
This was a temporary way of writing it to figure out the types, but I
find it easier to see the hierarchy.
2020-04-03 14:38:23 -04:00
Carol (Nichols || Goulding) 7bdea751d2 test: Explicitly create the bucket in the end-to-end test 2020-04-03 09:18:15 -04:00
Carol (Nichols || Goulding) 38e660818e style: Cargo fmt 2020-04-02 16:39:57 -04:00
Paul Dix c83805854d Fix end-to-end test for new rpc.rs behavior 2020-04-02 15:47:43 -04:00
Carol (Nichols || Goulding) d097af781d feature: Implement the get_buckets rpc to get bucket ids in the test 2020-04-02 11:52:39 -04:00
Jake Goulding f77d28367d feature: Respect TEST_DELOREAN_DB_DIR in the end-to-end test 2020-04-02 11:06:38 -04:00
Jake Goulding 97d11633b8 feature: Use a unique directory per end-to-end test run 2020-04-02 11:06:36 -04:00
Jake Goulding d66cc552a6 refactor: Use an Error/Result type alias 2020-04-02 11:04:20 -04:00
Carol (Nichols || Goulding) 54a66c14c8 feature: Implement read filter request 2020-02-26 09:51:02 -05:00
Carol (Nichols || Goulding) 7cac8cc10c feature: Implement tag values request 2020-02-26 09:51:02 -05:00
Carol (Nichols || Goulding) 2a4d2fe52d feature: Implement tag keys request 2020-02-26 09:51:02 -05:00
Jake Goulding c85f4b45ed refactor: use raw strings instead of escape sequences 2020-02-21 09:55:18 -05:00
Carol (Nichols || Goulding) cc0d830fec test: Exercise gRPC in the end-to-end test 2020-02-17 16:37:43 -05:00
Carol (Nichols || Goulding) 5384d0d3b8 refactor: Switch org_id to primarily be u32 in tests
This will make it easier to have one source of truth for the org id
used in the gRPC and regular requests.
2020-02-17 16:37:43 -05:00
Carol (Nichols || Goulding) fdcef79ae3 improvement: Make end-to-end test async
This doesn't matter very much right now, since we're waiting for each
call to be done before asserting, but tonic client methods are async.
2020-02-17 16:37:43 -05:00
Carol (Nichols || Goulding) 9cce1e4882 test: Add an end-to-end test
This test:
- Runs the server in a thread
- Writes some data
- Reads some data
- Shuts down the server
2020-02-13 10:40:03 -05:00