Commit Graph

3297 Commits (f4693e36c065c065599141d12d452b73a4674321)

Author SHA1 Message Date
Paul Dix 04bd6b8a12 Update line protocol parser
The earlier version of this line protocol parser incorrectly used a space as a delimiter between fields. This updates it to use a comma as it is in InfluxDB 1.x and 2.x.
2020-01-05 19:32:35 -05:00
Paul Dix ce69c5a9ce Update read API to return float series
Updates to read API in main.rs to return values for float series. I'm not terribly happy with the way I had to do this, but I was struggling a bit with the type system gymnastics. I assume I'll have to revisit this anyway when I add support for other storage backends.
2020-01-05 19:31:42 -05:00
Paul Dix b784563792 Add support for float64 to rocksdb
Adds support for for f64 time series in RocksDB. Series data types are now stored in the index under the id to key mapping, which is now id to type and key.

This doesn't enforce the same data type for values being written into a series, which will come later. Also later will be adding support for float64 series in the read API.
2020-01-05 18:38:45 -05:00
Paul Dix 8754911b5a Add support for float64 to line protocol parser
Adds support for f64 to the line protocol parser. Also updates the return value of parse to return a Vec of mixed type points that can be later written into the database.

The PointType struct is only for use in this context. In the context of querying or working with time series for compaction, we'll want vectors of actual typed points of the same kind so we don't have to do inefficient enum matches.
2020-01-05 16:28:12 -05:00
Paul Dix c7a862dca0 Fix compile warnings from the Rust linter
This commit fixes all the linter warnings. However, there are a number of spots, particularly in the encoders where I added `#[allow(dead_code)]` to get past them. We should go through and fix those up at some point, I'll log an issue to track.
2020-01-05 13:44:03 -05:00
Paul Dix 1a851f8d0b Add basic read endpoint
This commit adds a basic read endpoint to pull data out of the database. In order to provide the basic functionality a few things were added:

* Time package with limited support for parsing Flux style durations
* API endpoint at /api/v2/read with query paramters of org_id, bucket_name, predicate, start, and stop

The start and stop query parameters only support relative durations.

The predicate parameter supports what is possible in the parse_predicate method and in the RocksDB implementation (only == comparisons on tags and AND or OR)
2020-01-04 19:07:54 -05:00
Paul Dix fe9cb87c3d Update rocks db series filter
Add the series key to the SeriesFilter struct that is returned when searching the index.
2020-01-03 17:35:18 -05:00
Paul Dix 4265e7b11b Update write API endpoint
Upates the actix-web and actix-rt versions to 2.0 and 1.0 respectively. Wires up the write endpoint to create buckets if they don't exist.
2020-01-03 17:35:18 -05:00
Paul Dix 4892a87898 Implement read range on the database
This commit adds iterators for iterating over series and batches of points for a read range request. The exact signature/structure of the iterators are likely to change when this is generalized for other data types and other storage backends (S3 & memory).
2020-01-03 17:35:18 -05:00
Paul Dix c76ce39da5 Update rocksdb.rs write_points
This commit updates the write_points method to use the bucket id and series id in the key for a stored point value.

It also updates the Database methods to be immutable borrows moving any mutable concerns into interior structures so it can be easily called from many threads.
2020-01-03 17:35:18 -05:00
Paul Dix 4f02be1828
Merge pull request #10 from influxdata/pd-create-local-index
feat(storage): Add local RocksDB based index
2020-01-03 12:09:29 -06:00
Paul Dix 3c8f93a9a7 Implement OR in predicate
Adds support for logical OR operator in predicates against the index.
2019-12-24 15:25:43 -05:00
Paul Dix f3807456c9 Implement AND in predicate
Adds support for logical AND operator in predicates against the index.
2019-12-24 15:21:04 -05:00
Paul Dix 6cd4c5b583 Add basic tag key/value index
This commit brings in a Roaring Bitmap implementation to keep postings lists of tag key/value pairs to the set of series ids that have those pairs. The croaring implementation was used becasue the Treemap was required for u64 support for series ids and it was serializable (unlike the other pure Rust roaring implementation).

This doesn't shard the postings lists based on size. It also doesn't implement the time/index levels.

The predicate matching currently only works for a simple key = "value" match.
2019-12-24 13:44:30 -05:00
Paul Dix f77b0a3842 Move storage module into directory
Moved the storage module into its own directory. Split into the rocksdb portion of the code and the predicate parsing.
2019-12-23 11:49:58 -05:00
Paul Dix 71fe0aa71c Update storage with predicate parsing
Adds a basic predicate parser to make testing the index easier
2019-12-23 11:36:12 -05:00
Paul Dix 54ef130cea Wire up get tag values in storage
This adds basic support for getting tag values in storage. Still needs to add predicate and time range support.
2019-12-20 13:46:41 -05:00
Paul Dix 7effec0f48 Add shell of index functions and get tag keys
Added the shell of index functions to return series IDs that match a predicate, tag keys with a predicate, and tag values with a predicate.
2019-12-20 13:07:03 -05:00
Paul Dix 7f2f4eaceb Update mod.rs
Add parser for key/value pairs to be indexed. Measurement and field are represented as _m and _f respectively.
2019-12-20 13:05:59 -05:00
Paul Dix 5d80d5e100 feat(storage): Add series to ID index
This commit is the beginning of the RocksDB based index for series and their tag metadata.

I started to stub out different index levels but stopped short of implementing them.

There are a number of spots where I'm unwrapping return values that we may want to revisit later. For now I want to have the program panic if those things pop up.
2019-12-19 15:58:00 -05:00
Paul Dix 1a10243b46 Update integer.rs
Fix build error in test
2019-12-19 15:50:22 -05:00
Paul Dix 9deb3ea1ca
Merge pull request #8 from influxdata/pd-create-bucket-storage
feat(storage): Implement bucket definitions and persistence
2019-12-19 11:05:39 -05:00
Paul Dix 617c2960a8 feat(storage): Implement bucket definitiions and persistence
This updates to build system to use Prost to build the protobuf objects.

It adds tests for creating, storing and loading bucket definitions.

The tests use an actual on disk RocksDB implementation to ensure that its tested all the way to persistence.
2019-12-17 17:01:41 -05:00
Paul Dix 100d192538 Update main.rs
Fix build warnings for unused imports.
2019-12-17 17:01:41 -05:00
Paul Dix 3856af8842 Update timestamp.rs
Update test to fix build error.
2019-12-17 17:01:41 -05:00
Edd Robinson af32f8740d
Merge pull request #7 from influxdata/er-int-encoder
feat: Integer block encoder
2019-12-17 18:17:41 +00:00
Edd Robinson 64efa35dea refactor: tidy up comments 2019-12-17 12:10:27 +00:00
Edd Robinson cf64234c2d feat: integer encoder 2019-12-16 17:06:04 +00:00
Edd Robinson 36d3138a3d refactor: timestamp encoder 2019-12-13 16:43:29 +00:00
Edd Robinson d9b966579e refactor: move timestamp-specific RLE 2019-12-13 11:12:56 +00:00
Paul Dix 1756de964a
Merge pull request #6 from influxdata/pd-server-skeleton
feat(server): Add server skeleton with Actix and RocksDB
2019-12-12 10:27:49 -05:00
Paul Dix 9cadb1bb52 Add server skeleton with Actix and RocksDB 2019-12-12 10:15:16 -05:00
Edd Robinson a59b4be13a
Merge pull request #5 from influxdata/er-block
feat(encoder): initial timestamp block encoder implementation
2019-12-12 14:55:08 +00:00
Edd Robinson 0627ea0e5b refactor: organise encoders 2019-12-12 13:47:14 +00:00
Edd Robinson 8662982233 feat(encoders): add timestamp block encoder 2019-12-11 19:21:56 +00:00
Edd Robinson bff8704a0b test: more simple8b tests 2019-12-11 19:21:38 +00:00
Edd Robinson 3bbc86a8a0 fix: fix RLE bug 2019-12-11 19:21:15 +00:00
Edd Robinson e9db04292c refactor: change simple8b API to use binary encoding 2019-12-10 20:05:41 +00:00
Edd Robinson fb83e9c7fa feat(encoding): add RLE encoder/decoder 2019-12-09 18:04:01 +00:00
Edd Robinson 4009e67bf3 refactor: change encoder/decoder API 2019-12-08 21:00:45 +00:00
Edd Robinson 55d711599e tests: add tests for simple8b 2019-12-04 13:14:37 +00:00
Edd Robinson 824044eac1 refactor: move simple8b encoder/decode 2019-12-04 13:14:20 +00:00
Edd Robinson 46bbe4d317 feat(encoders): add simple8b encoder/decoder 2019-12-03 13:46:36 +00:00
Edd Robinson df355da693 refactor: comment out imports 2019-12-03 13:46:09 +00:00
Paul Dix 8826226554 Add place holder readme 2019-11-22 17:10:37 -05:00
Paul Dix 7a122b23cf Add shell for line protocol parser and encoders 2019-11-22 17:06:34 -05:00
Paul Dix b9b5a815b7 Initial commit with some notes and proto 2019-11-22 16:59:04 -05:00