Commit Graph

23 Commits (8b406b4f916252e40446d9cfea18cec2c7c06201)

Author SHA1 Message Date
Carol (Nichols || Goulding) d5ab29711e fix: Serialize relative db object store paths to the server config
So that they can be deserialized, without parsing, to create a new
iox object store from the location listed in the server config.

Notably, the locations serialized don't start with the object storage's
prefix like "s3:" or "file:". The location is the same object storage as
the server configuration that was just read from object storage. Having
the server config on one type of object storage and the database files
on another type is not supported.
2021-10-18 08:37:36 -04:00
Carol (Nichols || Goulding) 92583aee82 fix: Remove streaming API since we're not streaming anyway 2021-09-29 08:19:32 -04:00
Carol (Nichols || Goulding) d05528bcfd refactor: Use s3_request for put requests
Which meant we also needed to change the byte stream to be a closure
that can generate a byte stream
2021-09-29 08:19:32 -04:00
Carol (Nichols || Goulding) fbf18813ac fix: Correct a mistaken assumption in in-memory object storage
The implementation of list_with_delimiter for the in-memory object
storage assumed that paths returned from the BTreeMap keys that sorted
greater than the prefix given to list_with_delimiter and for whom
prefix_matches returned true would also have parts after the prefix.

This didn't account for paths that started with the prefix but didn't
immediately have the delimiter after the prefix: that is,

prefix = 1/database_name

would match the in-memory paths:

1/database_name/0/rules.pb
1/database_name_and_another_thing/0/rules.pb

The first path here *would* return some parts_after_prefix, but the
second path would not and the previously existing code would panic for
the added path in the list_with_delimiter test case.
2021-09-02 14:57:27 -04:00
Ning Sun c012e996ab
refactor: remove display methods, use fmt::Display instead. (#2272)
* refactor: remove display methods, use fmt::Display instead.

Signed-off-by: Ning Sun <sunng@protonmail.com>

* refactor: update a few calls from .display to .to_string()

* fix: consistently use `Path` rather than occasionally `DirsAndFileName`

* fix: fixup for merge conflicts

* fix: update test

* fix: Catch another case or two

* fix: fmt

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-08-16 18:00:22 +00:00
Carol (Nichols || Goulding) 9d15798288 fix: Address or allow Clippy warnings new with Rust 1.54 2021-07-30 09:59:59 -04:00
Andrew Lamb 670826daf9
refactor: make object_store construction interface consistent (#1944)
* refactor: make object_store construction interface consistent

* fix: benchmarks

* fix: doc build

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-07-12 12:56:36 +00:00
Carol (Nichols || Goulding) 82588d5c72 fix: Don't return Result from test functions 2021-04-07 12:40:00 -04:00
Carol (Nichols || Goulding) ca2f74063e fix: Test using the object store wrapper interface 2021-03-04 16:18:11 -05:00
Marko Mikulicic 536c1724bd feat: Allow to put streams of unknown length to objectstore
Addresses the API aspect of #818

Adds a utility module that helps computing the length of a stream while buffering it
for later replay (in-memory or spilling it in a temporary file).
2021-02-18 16:49:18 +00:00
Carol (Nichols || Goulding) f8fb24b88c refactor: Extract In-memory memory::Error 2021-02-04 13:04:52 -05:00
Carol (Nichols || Goulding) f795c56c8d refactor: Start splitting up the object store error type; extract disk::Error
It's starting to get out of control. Time to fix that.
2021-02-04 13:04:52 -05:00
Carol (Nichols || Goulding) fd39315388 refactor: Improve error name
I thought this only had to do with the InMemory Put request, but it's a
bit more general than that. Hopefully clarifying the purpose of this
error.
2021-02-04 13:04:52 -05:00
Carol (Nichols || Goulding) ff6955a433 refactor: Extract a trait for ObjectStoreApi with associated path
This is the promised cleanup. This structure gets rid of a lot of
intermediate structures and encodes through associated types how the
object stores and path types are related.

The enums are still necessary to avoid having generics leak all over
the place, but the object store variants and path variants should always
match because they'll always come from the object store trait
implementations that use the associated types.
2021-02-01 14:56:47 -05:00
Carol (Nichols || Goulding) 7d3b4db234 fix: InMemory doesn't need pagination 2021-02-01 14:35:47 -05:00
Carol (Nichols || Goulding) fdbe602e57 refactor: Always get a path to build from the object store 2021-02-01 14:30:21 -05:00
Carol (Nichols || Goulding) f8956dfbe8 refactor: Extract a module for the parsed DirsAndFileName structure 2021-01-15 15:24:48 -05:00
Carol (Nichols || Goulding) 7c457710ee fix: Implement parts_after_prefix; InMemory now passes 2021-01-11 16:57:38 -05:00
Carol (Nichols || Goulding) 06f1358e2d feat: Change ObjectStorePath API to be more explicit
Now you have to designate whether you're adding a directory or a file
name, with some assumptions based on paths coming from a cloud object
storage or the file system.

A notable difference: checking to see if "apple/b" is a prefix of
"apple/bear/cow.json" will now say no; only whole directories are
matched.
2021-01-11 16:57:37 -05:00
Carol (Nichols || Goulding) 18ee1b561b feat: Use ObjectStorePath everywhere to feel out the API needed 2021-01-07 10:48:22 -05:00
Carol (Nichols || Goulding) 44fb5b2b72 fix: Un-nest test modules
Now that the code is separated into modules, we don't need the modules
inside the test modules. So before this commit, the test names looked
like this:

```
test aws::tests::amazon_s3::s3_test_put_nonexistent_bucket ... ok
test gcp::test::google_cloud_storage::gcs_test ... ok
test disk::tests::file::length_mismatch_is_an_error ... ok
test memory::tests::in_memory::length_mismatch_is_an_error ... ok
```

and after this commit, the test names look like this:

```
test aws::tests::s3_test_put_nonexistent_bucket ... ok
test gcp::test::gcs_test ... ok
test disk::tests::length_mismatch_is_an_error ... ok
test memory::tests::length_mismatch_is_an_error ... ok
```
2021-01-07 09:20:57 -05:00
Paul Dix c1f8e89bf0 feat: Add list_with_delimiter to in memory object store
This adds the list_with_delimiter function to the in-memory object store. It also updates the function signature to require a prefix since it will always only want to list either the objects in the dir or the common prefixes.
2021-01-07 09:19:22 -05:00
Paul Dix d1ab5c0ee9 chore: refactor object_store crate
This pulls the different backing implmenetations into their own modules. They're about to get more complex so it felt like it was time to separate them out rather than building towards a single multi-thousand line lib.rs. The error type is only defined in lib and imported by the individual modules, which I think makes it easier to work with.
2021-01-07 09:19:07 -05:00