Commit Graph

120 Commits (155bfcbd4f6475f9c31840150c952a9f9b727e67)

Author SHA1 Message Date
Jake Goulding 155bfcbd4f build: Update prost to latest version 2020-02-17 10:48:33 -05:00
Jake Goulding eb3113b820 build: Update dotenv to latest version 2020-02-17 10:48:32 -05:00
Jake Goulding 31df104996 build: Update env_logger to latest version 2020-02-17 10:48:32 -05:00
Jake Goulding e3bfa0f835 build: Update byteorder to latest version 2020-02-17 10:48:32 -05:00
Jake Goulding 04a7f716e2 build: Update dependencies to latest semver-compatible versions 2020-02-17 10:48:32 -05:00
Carol (Nichols || Goulding) 23a9a800a6 Merge remote-tracking branch 'origin/master' into hyper 2020-02-17 08:54:19 -05:00
Carol (Nichols || Goulding) d70a123356
Merge pull request #36 from influxdata/er-fix-clippy
refactor: please the clippy gods
2020-02-17 08:20:28 -05:00
Carol (Nichols || Goulding) bbbbf8ee07 fix: Remove unnecessary allocation 2020-02-17 08:10:53 -05:00
Edd Robinson 0b3c412cfc chore: make clippy required CI step 2020-02-14 18:27:53 +00:00
Edd Robinson 1ad21b3e90 refactor: apply clippy 2020-02-14 18:19:51 +00:00
Edd Robinson 92baa3d7e8 refactor: apply clippy 2020-02-14 17:13:20 +00:00
Edd Robinson b2cdd299f5 refactor: apply clippy 2020-02-14 17:13:05 +00:00
Carol (Nichols || Goulding) 4dfd4d90ba fix: Use BytesMut directly rather than through actix 2020-02-14 10:56:37 -05:00
Carol (Nichols || Goulding) f7b33d47de fix: Adjust parameter type to avoid double allocation 2020-02-14 10:19:39 -05:00
Carol (Nichols || Goulding) 12fbb23112 fix: Make both query parsing places return bad request on failure 2020-02-14 10:17:48 -05:00
Carol (Nichols || Goulding) dc7a2ec333 fix: Improve parameter type 2020-02-14 10:02:35 -05:00
Carol (Nichols || Goulding) a16c49537f fix: Include limit in size exceeded error 2020-02-14 10:00:35 -05:00
Carol (Nichols || Goulding) 8b1255be9d refactor: Switch to a hyper server 2020-02-14 09:59:09 -05:00
Jake Goulding 49df607e48
Merge pull request #33 from influxdata/format
chore: Apply and enforce standard Rust formatting
2020-02-14 09:57:18 -05:00
Jake Goulding fd76a7394c ci: Enforce standard formatting 2020-02-14 08:02:24 -05:00
Jake Goulding 615e0f6537 style: Apply rustfmt defaults to the entire project 2020-02-14 08:02:11 -05:00
Carol (Nichols || Goulding) 414c5ba871
Merge pull request #32 from influxdata/cn-end-to-end-test
test: Add an end-to-end test
2020-02-13 12:32:34 -05:00
Carol (Nichols || Goulding) 77125bd8e5 improvement: Remove TODO comments that are now done 2020-02-13 10:47:01 -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
Carol (Nichols || Goulding) 28d03c4047
Merge pull request #31 from influxdata/cn-small-piece
Refactoring for generics
2020-02-12 09:49:50 -05:00
Carol (Nichols || Goulding) 5942dd5c8a fix: Remove turbofish that are no longer needed 2020-02-12 09:46:29 -05:00
Carol (Nichols || Goulding) 64223b70a9 refactor: Collapse the read_*_range functions 2020-02-12 09:43:42 -05:00
Carol (Nichols || Goulding) 3399cea18a refactor: Extract a trait to make read_*_range fns more similar 2020-02-12 09:43:42 -05:00
Carol (Nichols || Goulding) 16c8834fbc refactor: Collapse read_*_range functions into a generic function 2020-02-12 09:43:40 -05:00
Carol (Nichols || Goulding) 2b642ffaac refactor: Make read_*_bytes more similar by extracting a trait 2020-02-12 09:42:47 -05:00
Carol (Nichols || Goulding) af85249ea6 fix: Remove unneeded lifetime annotations 2020-02-12 09:42:47 -05:00
Carol (Nichols || Goulding) 07bb075e93 refactor: Extract storing different types in SeriesData 2020-02-12 09:42:47 -05:00
Carol (Nichols || Goulding) 0b515fe1f9 fix: Switch from Copy to Clone bounds 2020-02-12 09:42:46 -05:00
Carol (Nichols || Goulding) daa02069db refactor: Remove unused function 2020-02-12 09:42:42 -05:00
Carol (Nichols || Goulding) 867523c2d9 refactor: Extract the code for storing types' bytes in RocksDB 2020-02-12 09:36:53 -05:00
Jake Goulding 5774414a23
Merge pull request #29 from influxdata/enum-int-mapping
fix: Do not transmute unknown bytes to enums
2020-02-11 20:54:08 -05:00
Jake Goulding 657059af9f fix: Do not transmute unknown bytes to enums
Fixes #24
2020-02-11 20:47:29 -05:00
Jake Goulding 461ead862b
Merge pull request #25 from influxdata/reduce-vec-creation
perf: Reduce amount of Vecs created in the RocksDB code
2020-02-11 20:45:59 -05:00
Jake Goulding 26a6d1a272
Merge pull request #26 from influxdata/ok-or-else
refactor: Use Option::ok_or_else in RocksDB adapter code
2020-02-11 20:45:50 -05:00
Jake Goulding bfef773109
Merge pull request #27 from influxdata/double-hash
perf: Avoid calculating the hashcode twice in the RocksDB adapter
2020-02-11 20:45:37 -05:00
Jake Goulding d248c3e7f2 refactor: Use Option::ok_or_else in RocksDB adapter code
This helper reduces the boilerplate of creating errors for a missing
value.
2020-02-11 20:41:31 -05:00
Jake Goulding b0b8925379 perf: Avoid creating a vector for a subslice 2020-02-11 20:40:21 -05:00
Jake Goulding 2f63ca7fdb perf: Remove unneeded Vec clone 2020-02-11 20:40:16 -05:00
Jake Goulding 959f98f605 perf: Reduce unneeded Vec creation
- Integers can be directly converted to arrays of bytes
- We can extend vectors from other slices instead of `Vec`s
2020-02-11 20:40:12 -05:00
Jake Goulding be3ed216c3 perf: Avoid taking `Vec` by reference
There's no benefit to accepting a reference to a `Vec` over a slice.

Further details available in https://stackoverflow.com/q/40006219/155423
2020-02-11 20:40:06 -05:00
Jake Goulding b44f7d8869 perf: Avoid calculating the hashcode twice in the RocksDB adapter
Unfortunately, we can't use `Entry::or_insert_with` because we need to
use the key to construct the value.
2020-02-11 20:39:23 -05:00
Jake Goulding 8c963ff7d1
Merge pull request #28 from influxdata/rust-2018-idioms
style: Enforce Rust 2018 idioms
2020-02-11 08:15:56 -05:00
Jake Goulding b5879c8414 style: Enforce Rust 2018 idioms
For reference, the [2018 edition guide][guide] talks about some of the
big differences.

The two that are applied here are:

1. `extern crate` is basically not needed at all anymore; you can do
`use cratename` instead. This makes importing things more uniform
between your own crate and other crates.

1. Rust does a reasonable amount of [*lifetime elision*][elision] so
    we don't have to type `'a` in as many places. However, one that
    ended up tripping up people is when a generic lifetime was part of
    a type. The compiler cared about this lifetime, but since it
    wasn't visible, people would forget it's there, then try to use it
    as if it wasn't constrained by the lifetime.

    A good example is the `Chars` iterator. It references the original
    `&str` and cannot live longer than the string. With the original
    way this was being passed (`&mut Chars`) it was visually evident
    that there was *some* lifetime, thanks to seeing the `&`, but it
    wasn't obvious that there's *another* lifetime — the string.

    With the addition of the *anonymous lifetime* (`'_`), it's now
    encouraged to use that when a type has a lifetime parameter that
    isn't relevant to prevent confusing mistakes that lead to compiler
    errors.

There are probably a few more things enabled by the lint as well. I
forget the exact reason that these are not yet enabled by default,
though.

[guide]: https://doc.rust-lang.org/edition-guide/rust-2018/index.html
[elision]: https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html#lifetime-elision
2020-02-11 08:08:12 -05:00
Jake Goulding 05bd782423
Merge pull request #30 from influxdata/build
ci: Get the build back to green
2020-02-11 07:52:24 -05:00
Jake Goulding d8f3c31b8c ci: Prevent rustfmt and clippy from stopping the build for now 2020-02-09 22:23:27 -05:00