Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite #30

Draft
wants to merge 202 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
d67b48f
Nuke.
Thomasdezeeuw Oct 14, 2022
6716215
Start with storage module
Thomasdezeeuw Oct 14, 2022
8cfe979
Update dependencies
Thomasdezeeuw Oct 14, 2022
7221436
Add back key module
Thomasdezeeuw Oct 14, 2022
c64e7c7
Drop unused dependencies
Thomasdezeeuw Oct 15, 2022
ccfd85e
Add KeyHasher
Thomasdezeeuw Oct 15, 2022
316f37f
Add initial storage traits
Thomasdezeeuw Oct 15, 2022
ef74371
Remove outdated docs
Thomasdezeeuw Oct 15, 2022
1e37ac4
Make storage::Write a bit more usable
Thomasdezeeuw Oct 15, 2022
831306b
Add len method to storage::Blob trait
Thomasdezeeuw Oct 15, 2022
b8d6731
Add in-memory storage implementation
Thomasdezeeuw Oct 15, 2022
2a19aed
Add docs to storage::mem
Thomasdezeeuw Oct 15, 2022
02b769c
Add initial version of the protocol module
Thomasdezeeuw Oct 17, 2022
a657c19
Add left-right hashmap dependency
Thomasdezeeuw Oct 17, 2022
bc96fe8
Remove binaries
Thomasdezeeuw Oct 17, 2022
df5c813
Add Error and Describe
Thomasdezeeuw Oct 17, 2022
bdc7753
Derive Debug for Request and Response
Thomasdezeeuw Oct 17, 2022
0b9f3cb
Add controller module
Thomasdezeeuw Oct 17, 2022
32cbace
Add configuration to controller
Thomasdezeeuw Oct 17, 2022
0a8104e
Add I/O timeout to Protocol
Thomasdezeeuw Oct 17, 2022
994c89d
Move protocol to its own directory
Thomasdezeeuw Oct 18, 2022
c66f58f
Add generic type B to Protocol::Reply type
Thomasdezeeuw Oct 18, 2022
aa06365
Remove Blob requirement from B in Response
Thomasdezeeuw Oct 18, 2022
3e28ebc
Add Key::from_byte_str
Thomasdezeeuw Oct 18, 2022
4aee5ef
Redesign Protocol trait
Thomasdezeeuw Oct 19, 2022
00c1ac8
Update controller to new Protocol design
Thomasdezeeuw Oct 19, 2022
25f1531
Actually use storage::Read::Error
Thomasdezeeuw Oct 19, 2022
d2c56da
Add synchronous Connection trait
Thomasdezeeuw Oct 19, 2022
b5bc87e
Add RESP Protocol implementation
Thomasdezeeuw Oct 19, 2022
3703e07
Merge store::Read and Write traits
Thomasdezeeuw Oct 25, 2022
a7ef356
Complete controller implementation
Thomasdezeeuw Oct 25, 2022
549a284
Implement fmt::Display for Response
Thomasdezeeuw Oct 25, 2022
b139099
Move IsFatal to the root of the crate
Thomasdezeeuw Oct 25, 2022
37a2bdb
Remove unused controller::Error
Thomasdezeeuw Oct 25, 2022
03e4c76
Add lifetimes to Storage futures
Thomasdezeeuw Oct 25, 2022
f5ae8b1
Update the memory storage implementation
Thomasdezeeuw Oct 25, 2022
c986d52
Cleanup storage::mem docs
Thomasdezeeuw Oct 25, 2022
3b2df97
Make the Connection trait async
Thomasdezeeuw Oct 28, 2022
9231120
Update RESP implementation to use async Connection
Thomasdezeeuw Oct 28, 2022
4bbef84
Add Resp::prepare_buf
Thomasdezeeuw Oct 28, 2022
67926c7
Shrink logging of requests a bit
Thomasdezeeuw Oct 28, 2022
e18f86b
Expand the amount of response
Thomasdezeeuw Oct 28, 2022
cf5f237
Add Blob::write method
Thomasdezeeuw Oct 28, 2022
181b670
Add Connection::write and write_vectored
Thomasdezeeuw Oct 28, 2022
c1e19ec
Implement Connection for &mut C
Thomasdezeeuw Oct 28, 2022
302cfd6
Update Blob implementation for in-memory blob
Thomasdezeeuw Oct 28, 2022
424bd2c
Implement Protocol::reply for RESP
Thomasdezeeuw Oct 28, 2022
60d0f9b
Implement Protocol::reply_to_error for RESP
Thomasdezeeuw Oct 28, 2022
9e779ee
Tag rewrite as v0.2
Thomasdezeeuw Oct 28, 2022
81984bb
Add controller::DefaultConfig
Thomasdezeeuw Oct 28, 2022
90129ba
Make controller::actor a proper actor
Thomasdezeeuw Oct 28, 2022
5f00f4e
Add controller::supervisor
Thomasdezeeuw Oct 28, 2022
f8d77c2
Implement Connection for Heph's TcpStream
Thomasdezeeuw Oct 28, 2022
20d2d72
Derive Clone for mem::Storage
Thomasdezeeuw Oct 28, 2022
2bcd8c8
Add Resp::new
Thomasdezeeuw Oct 28, 2022
18b3b97
Add server binary
Thomasdezeeuw Oct 28, 2022
f95418f
Rewrite Resp::next_request using async functions
Thomasdezeeuw Oct 29, 2022
9125d87
Move checking of command arguments length to per command
Thomasdezeeuw Oct 29, 2022
3b57cd9
Fix recovery of unknown command
Thomasdezeeuw Oct 29, 2022
b2be43e
Implement QUIT command for RESP
Thomasdezeeuw Oct 29, 2022
9928aac
Implement DBSIZE for RESP
Thomasdezeeuw Oct 29, 2022
5d0d85f
Fix typoe
Thomasdezeeuw Oct 29, 2022
386a500
Delete QUIT command
Thomasdezeeuw Oct 29, 2022
7bf4b47
Fix recovery in ensure_arguments
Thomasdezeeuw Oct 29, 2022
3e6467c
Remove ADD command from RESP
Thomasdezeeuw Oct 29, 2022
156f985
Update to Heph v0.5-dev
Thomasdezeeuw Dec 29, 2023
0093529
Update to ring v0.17
Thomasdezeeuw Dec 29, 2023
16677fb
Update to std-logger v0.5
Thomasdezeeuw Dec 29, 2023
4de5fbb
Update to toml v0.8
Thomasdezeeuw Dec 29, 2023
42695e7
Document protocol module
Thomasdezeeuw Dec 29, 2023
67c2090
Simplify Protocol trait a bit
Thomasdezeeuw Dec 29, 2023
782fdc2
Remove timeouts from Protocol
Thomasdezeeuw Dec 29, 2023
84b77ca
Add timeouts to controller
Thomasdezeeuw Dec 29, 2023
eef275f
Update crate metata
Thomasdezeeuw Dec 29, 2023
0ab3fd2
Remove Connection trait
Thomasdezeeuw Dec 29, 2023
9ad0c73
Add more helper functions to Resp
Thomasdezeeuw Dec 29, 2023
f1aebb5
Simplify storage::Blob::write return type
Thomasdezeeuw Dec 29, 2023
3c7756f
Make Blob::write trailer static
Thomasdezeeuw Dec 29, 2023
04d1553
Remove allocations from Blob::write
Thomasdezeeuw Dec 29, 2023
3fa030e
Remove resp::encode::length_idx
Thomasdezeeuw Dec 29, 2023
cf2c533
Rename resp::parse to decode
Thomasdezeeuw Dec 29, 2023
6950877
Add io module
Thomasdezeeuw Dec 29, 2023
df9a449
Remove reference to Connection trait
Thomasdezeeuw Dec 29, 2023
2a2353b
Document storage module
Thomasdezeeuw Dec 29, 2023
dca7411
Add doc to key module
Thomasdezeeuw Dec 29, 2023
79c3beb
Simplify Storage trait
Thomasdezeeuw Dec 29, 2023
4a9b0a7
Take ownership of blob in storage::Blob::write
Thomasdezeeuw Dec 29, 2023
5b1f5c7
Remove unused Storage methods
Thomasdezeeuw Dec 29, 2023
5f6cffe
Use str implement for trailer
Thomasdezeeuw Dec 29, 2023
7f680ba
Update left-right version
Thomasdezeeuw Dec 29, 2023
71b1a7d
Implement Clone::clone_from for mem::Blob
Thomasdezeeuw Dec 29, 2023
8d3c627
Remove double spaces
Thomasdezeeuw Dec 29, 2023
7320607
Remove unused dependencies and features
Thomasdezeeuw Dec 29, 2023
076647f
Add io::Connection trait
Thomasdezeeuw Dec 29, 2023
37ede61
Get the source of the client
Thomasdezeeuw Dec 29, 2023
684d203
Document controller module
Thomasdezeeuw Dec 29, 2023
d7294ef
Move IsFatal to protocol module
Thomasdezeeuw Dec 29, 2023
638aa30
Move Error to controller module
Thomasdezeeuw Dec 29, 2023
eb37315
Add controller::Error::new
Thomasdezeeuw Dec 29, 2023
4149477
Add crate documentation
Thomasdezeeuw Dec 29, 2023
054ad1e
Fix Connection::source for TcpStream
Thomasdezeeuw Dec 29, 2023
81398eb
Add HTTP Protocol implementation
Thomasdezeeuw Dec 29, 2023
a8b0dce
Remove reference to deleted timeout arguments
Thomasdezeeuw Dec 30, 2023
2382cbe
Allow Key::from_bytes to work with larger slices
Thomasdezeeuw Dec 30, 2023
bac18e9
Remove Unpin requirement from Blob::AsyncIter
Thomasdezeeuw Dec 30, 2023
3765fad
Avoid cloning RT in controller
Thomasdezeeuw Dec 31, 2023
4cfc421
Wrap futures in timers in controller
Thomasdezeeuw Dec 31, 2023
fdb5d23
Use io::Result where possible
Thomasdezeeuw Dec 31, 2023
cab0ca8
Use actor_fn where possible
Thomasdezeeuw Dec 31, 2023
ed9246d
Increase inbox size of in-memory storage
Thomasdezeeuw Dec 31, 2023
2580f9e
Import Access trait
Thomasdezeeuw Dec 31, 2023
5adf6b0
Check if blob exists before attempting to insert it
Thomasdezeeuw Dec 31, 2023
4ed5a4c
Fix warnings in HTTP protocol module
Thomasdezeeuw Dec 31, 2023
6f05b55
Add on-disk Storage implementation
Thomasdezeeuw Jan 1, 2024
8ca1698
Elide lifetimes where it makes sense
Thomasdezeeuw Jan 1, 2024
9949391
Small code cleanup
Thomasdezeeuw Jan 1, 2024
d8cbd58
Require Storage::Error to implement fmt::Display
Thomasdezeeuw Jan 6, 2024
8fcbf32
Remove serde dependency
Thomasdezeeuw Jan 6, 2024
6d75a8e
Rename server binary to stored
Thomasdezeeuw Jan 6, 2024
ffa65d9
Add actor to print a message on process shutdown
Thomasdezeeuw Jan 6, 2024
bbb2616
Change Blob::write to accept a mutable reference to C
Thomasdezeeuw Jan 6, 2024
fcf2261
Add argument handling to server binary
Thomasdezeeuw Jan 6, 2024
5eacdbd
Add basic configuration
Thomasdezeeuw Jan 6, 2024
ea387cf
Make configuration path optional in server binary
Thomasdezeeuw Jan 6, 2024
eb2573c
Use different port than Redis
Thomasdezeeuw Jan 6, 2024
48e045c
Rename ProtocolConfig to config::Protocol
Thomasdezeeuw Jan 6, 2024
0bb5cce
Don't close connection on setting NODELAY failure
Thomasdezeeuw Jan 6, 2024
0dfa23d
Use Config in server binary
Thomasdezeeuw Jan 6, 2024
b6431a4
Change default ports to be unique (hopefully)
Thomasdezeeuw Jan 6, 2024
d948ee4
Add -dev to version
Thomasdezeeuw Jan 7, 2024
08d7989
Add Protocol::NAME
Thomasdezeeuw Jan 7, 2024
b6eb4a6
Log protocol kind in controller actor
Thomasdezeeuw Jan 7, 2024
850d91c
Use Arc in disk::Storage
Thomasdezeeuw Jan 7, 2024
b6aaf8f
Add Protocol::new
Thomasdezeeuw Jan 7, 2024
fbe3519
DRY starting of listeners
Thomasdezeeuw Jan 7, 2024
d03b40a
Use inline fmt arguments
Thomasdezeeuw Jan 7, 2024
ac986db
Add new in-memory index
Thomasdezeeuw Mar 18, 2024
7cef5b9
Device Clone for Index
Thomasdezeeuw Mar 18, 2024
6430da6
Add Index::contains
Thomasdezeeuw Mar 18, 2024
0451cca
Implement Send & Sync for Pointer
Thomasdezeeuw Mar 18, 2024
11df9ad
Manually implement Clone for index::{Handle,Index}
Thomasdezeeuw Mar 18, 2024
654415d
Fix index::Writer::add_blob
Thomasdezeeuw Mar 18, 2024
022dbee
Fix incorrect masking of Pointer pointer
Thomasdezeeuw Mar 18, 2024
9320e64
Switch in-memory storage to new Index implementation
Thomasdezeeuw Mar 18, 2024
c915d60
Small doc improvement
Thomasdezeeuw Mar 18, 2024
f75afe4
Update Heph version
Thomasdezeeuw Mar 18, 2024
c834e3d
Fix some Clippy lints
Thomasdezeeuw Mar 18, 2024
af809dc
Use Optimised operation log for storage::index
Thomasdezeeuw Mar 19, 2024
997b285
Update left-right to latest version
Thomasdezeeuw Mar 19, 2024
f0c4a4b
Use new index in on-disk storage implementation
Thomasdezeeuw Mar 19, 2024
be13faf
Move Blob trait definition after Storage
Thomasdezeeuw Mar 19, 2024
9c8f146
Simplify Blob trait
Thomasdezeeuw Mar 19, 2024
2e28038
Simply Blob type for in-memory storage
Thomasdezeeuw Mar 19, 2024
3f49d1d
Use stablised Log's kv feature
Thomasdezeeuw Mar 20, 2024
0c9b74f
Open on-disk storage in server
Thomasdezeeuw Mar 20, 2024
f9f42ed
Add configuration file support
Thomasdezeeuw Mar 20, 2024
5301786
Fix index path
Thomasdezeeuw Mar 20, 2024
ea8fefa
Fix minimal configuration example
Thomasdezeeuw Mar 20, 2024
29b727e
Improve missing listener configuration error
Thomasdezeeuw Mar 20, 2024
7c75cff
Change index::Writer::add_blob to return a bool
Thomasdezeeuw Mar 20, 2024
4578909
Remove result from index::Root::remove_blob
Thomasdezeeuw Mar 20, 2024
b10c648
Remove Result from disk RPC method
Thomasdezeeuw Mar 20, 2024
36c2da1
Use key before blob consistently
Thomasdezeeuw Mar 20, 2024
a90d274
Remove unnecessary async closure
Thomasdezeeuw Mar 21, 2024
f16f839
Check if the storage contains a key before removing it
Thomasdezeeuw Mar 21, 2024
20d4bea
Fix disk::Writer::add_blob
Thomasdezeeuw Mar 21, 2024
803235b
Improve safety docs
Thomasdezeeuw Mar 21, 2024
3faf8c5
Remove old tests
Thomasdezeeuw Mar 21, 2024
be89ae6
Remove dev-dependencies
Thomasdezeeuw Mar 21, 2024
f580896
Make controller::Config a struct
Thomasdezeeuw Mar 21, 2024
101f39b
Add {read,write} timeout to configuration
Thomasdezeeuw Mar 21, 2024
804335b
Add infrastructure for protocol tests
Thomasdezeeuw Mar 21, 2024
761b16a
Make io module public
Thomasdezeeuw Mar 21, 2024
65767c9
Update to latest nightly
Thomasdezeeuw Mar 21, 2024
066dedc
Fix typo BlobStored -> BlobsStored
Thomasdezeeuw Mar 21, 2024
ff91051
Add tests for RESP request parsing
Thomasdezeeuw Mar 21, 2024
e887e00
Assert no next request in tests
Thomasdezeeuw Mar 22, 2024
c58756a
Add more commented-out RESP tests
Thomasdezeeuw Mar 22, 2024
0311ec7
Update Makefile
Thomasdezeeuw Mar 27, 2024
36e5b90
Fix and/or silence all Clippy warnings
Thomasdezeeuw Mar 27, 2024
5dca676
Move key tests to tests directory
Thomasdezeeuw Mar 27, 2024
3cca027
Move all unit tests into a single test binary
Thomasdezeeuw Mar 27, 2024
9237461
Add storage tests files
Thomasdezeeuw Mar 27, 2024
c743ecd
Rename Key::from_byte_str to try_parse_bytes
Thomasdezeeuw Mar 27, 2024
4f6e094
Add key! macro to create a Key
Thomasdezeeuw Mar 27, 2024
f9d336e
Use key macro in tests
Thomasdezeeuw Mar 27, 2024
8f77c2b
Implement TestConn::write_all
Thomasdezeeuw Mar 27, 2024
0196dd4
Add unit tests for the storage::index
Thomasdezeeuw Mar 27, 2024
f7bff8f
Fix InvalidKeyStr description
Thomasdezeeuw Mar 28, 2024
733b221
Derive Eq and PartialEq for Key
Thomasdezeeuw Mar 28, 2024
e334483
Add unit tests for in-memory storage
Thomasdezeeuw Mar 28, 2024
6703a10
Update Heph version
Thomasdezeeuw Mar 31, 2024
38bd54e
Set target-cpu-native via RUSTFLAGS in build target
Thomasdezeeuw Apr 1, 2024
f610961
Remove KeyHasher
Thomasdezeeuw Apr 1, 2024
b478a6c
Remove Hash impl for Key
Thomasdezeeuw Apr 1, 2024
4477fd4
Remove IO from KeyCalculator
Thomasdezeeuw Apr 1, 2024
8e6c47b
Use KeyCalculator in Key::for_blob
Thomasdezeeuw Apr 1, 2024
2afe3c7
Improve key module docs
Thomasdezeeuw Apr 1, 2024
318ef77
Remove Key hashing benchmarks
Thomasdezeeuw Apr 1, 2024
6d3607a
Various documentation improvements
Thomasdezeeuw Apr 1, 2024
47aaac7
Add Key::append_to
Thomasdezeeuw Apr 1, 2024
ca70ab9
Use itoa in integer HTTP body creation
Thomasdezeeuw Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 26 additions & 50 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
[package]
name = "stored"
version = "0.1.0"
authors = ["Thomas de Zeeuw <[email protected]>"]
edition = "2018"
publish = false
name = "stored"
description = "Store*d* (pronounced store-daemon, or just stored) is a distributed immutable blob store. Stored is not a key-value store, as the key isn't the decided by the user but by the SHA-512 checksum of the stored blob."
version = "0.2.0-dev"
publish = false # In development.
authors = ["Thomas de Zeeuw <[email protected]>"]
license = "MIT"
repository = "https://github.com/Thomasdezeeuw/stored"
readme = "README.md"
edition = "2021"

[dependencies]
chrono = { version = "0.4.19", default-features = false, features = ["clock"] }
crossbeam-channel = { version = "0.5.0", default-features = false, features = ["std"] }
futures-io = { version = "0.3.6", default-features = false, features = ["std"] }
futures-util = { version = "0.3.6", default-features = false, features = ["io", "std", "write-all-vectored"] }
fxhash = { version = "0.2.1", default-features = false }
getrandom = { version = "0.2.0", default-features = false }
# TODO: replace with published crate.
heph = { git = "https://github.com/Thomasdezeeuw/heph", rev = "00640b2a5d1759b572a2c9e9e13b06df4f3e40c5" }
libc = { version = "0.2.74", default-features = false }
log = { version = "0.4.11", default-features = false, features = ["release_max_level_info"] }
num_cpus = { version = "1.13.0", default-features = false }
ring = { version = "0.16.19", default-features = false, features = ["std"] }
# Need the `std` feature as it implements `Error` for `httparse::Error`.
httparse = { version = "1.3.4", default-features = false, features = ["std"] }
human-size = { version = "0.4.1", default-features = false, features = ["enable-serde"] }
parking_lot = { version = "0.11.0", default-features = false, features = ["nightly"] }
serde = { version = "1.0.116", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.58", default-features = false, features = ["std"] }
toml = { version = "0.5.6", default-features = false }

[dev-dependencies]
http = { version = "0.2.1", default-features = false }
lazy_static = { version = "1.4.0", default-features = false }
mio = { version = "0.7.0", default-features = false, features = ["os-poll"] }
mio-pipe = { version = "0.1.1", default-features = false }
serde_test = { version = "1.0.116", default-features = false }
basic-toml = { version = "0.1.9", default-features = false }
# TODO: replace with published crates.
left-right = { git = "https://github.com/Thomasdezeeuw/left-right", rev = "4408ba0bb23ea0090b420ebfc0561780a44c533f", default-features = false }
heph = { git = "https://github.com/Thomasdezeeuw/heph", rev = "daf3a2f7118d1e05c3433455db27a1dabc073e16", default-features = false }
heph-rt = { git = "https://github.com/Thomasdezeeuw/heph", rev = "daf3a2f7118d1e05c3433455db27a1dabc073e16", default-features = false }
heph-http = { git = "https://github.com/Thomasdezeeuw/heph", rev = "daf3a2f7118d1e05c3433455db27a1dabc073e16", default-features = false }
itoa = { version = "1.0.4", default-features = false }
libc = { version = "0.2.151", default-features = false }
log = { version = "0.4.21", default-features = false, features = ["kv_std", "release_max_level_info"] }
ring = { version = "0.17", default-features = false }
serde = { version = "1.0.197", default-features = false }
std-logger = { version = "0.5.3", default-features = false, features = ["timestamp", "log-panic", "nightly"] }

[dev-dependencies.heph-rt]
git = "https://github.com/Thomasdezeeuw/heph"
rev = "daf3a2f7118d1e05c3433455db27a1dabc073e16"
features = ["test"]

[profile.release]
opt-level = 3
Expand All @@ -44,25 +39,6 @@ incremental = false
codegen-units = 1
rpath = false

[[bin]]
name = "store"
path = "src/bin/store.rs"

[[bin]]
name = "retrieve"
path = "src/bin/retrieve.rs"

[[bin]]
name = "remove"
path = "src/bin/remove.rs"

[[bin]]
name = "stored"
path = "src/bin/server.rs"

[[bin]]
name = "validate_store"
path = "src/bin/validate.rs"

[workspace]
members = ["bench/hashmap_hash"]
112 changes: 81 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,91 @@
# NOTE: note exporting the following two variables as they interfere with
# incremental compilation (not setting the flag, e.g. outside of running Make
# will cause recompilation).
RUSTFLAGS ?= -C target-cpu=native
MACOSX_DEPLOYMENT_TARGET ?= 10.15
GIT_SHORT_HASH = $(shell git rev-parse --short HEAD)
# Either " modified" or empty if on a clean branch.
GIT_MODIFIED = $(shell git diff --quiet --ignore-submodules HEAD 2> /dev/null || echo " modified")
export COMMIT_VERSION = $(GIT_SHORT_HASH)$(GIT_MODIFIED)
# Test options.
# You can also use `TEST_FLAGS` to set additonal flags, e.g. `--release`.
TEST_OPTS = -- --quiet -Z unstable-options --shuffle
# Command to run in `dev` target, e.g. `make RUN=check dev`.
RUN ?= test

build:
RUSTFLAGS="$(RUSTFLAGS)" MACOSX_DEPLOYMENT_TARGET="$(MACOSX_DEPLOYMENT_TARGET)" cargo build --release
RUSTFLAGS='-C target-cpu=native' cargo build --release

# Development loop, runs $RUN whenever a source file changes.
dev:
find src/ tests/ examples/ Makefile Cargo.toml | entr -d -c $(MAKE) $(RUN)

test:
(cargo test \
&& (killall -u $$(whoami) -KILL stored || true)) || \
(killall -u $$(whoami) -KILL stored && exit 1)
cargo test --all-features $(TEST_FLAGS) $(TEST_OPTS)

# NOTE: when using this command you might want to change the `test` target to
# only run a subset of the tests you're actively working on.
dev:
find src/ tests/ Makefile Cargo.toml | RUST_BACKTRACE=0 entr -d -c $(MAKE) test

lint:
cargo clippy --all-targets -- --warn warnings \
--warn clippy::correctness \
--warn clippy::style \
--warn clippy::complexity \
--warn clippy::perf \
--allow clippy::assertions_on_constants \
--allow clippy::borrow_interior_mutable_const \
--allow clippy::enum_variant_names \
--allow clippy::len_without_is_empty \
--allow clippy::needless_lifetimes \
test_sanitizers:
$(MAKE) test_sanitizer sanitizer=address
$(MAKE) test_sanitizer sanitizer=leak
$(MAKE) test_sanitizer sanitizer=memory
$(MAKE) test_sanitizer sanitizer=thread

# Run with `make test_sanitizer sanitizer=$sanitizer`, or use `test_sanitizers`.
test_sanitizer:
RUSTDOCFLAGS=-Zsanitizer=$(sanitizer) RUSTFLAGS=-Zsanitizer=$(sanitizer) \
cargo test -Zbuild-std --all-features --target x86_64-unknown-linux-gnu $(TEST_FLAGS) $(TEST_OPTS)

# TODO: add TEST_OPTS to this, currently this doesn't work with miri.
test_miri:
cargo miri test --all-features $(TEST_FLAGS)

check:
cargo check --all-features --all-targets

# Reasons to allow lints:
# `cargo-common-metadata`: for `benches` and `tools`.
# `doc-markdown`: too many false positives.
# `equatable-if-let`: bad lint.
# `future-not-send`: we don't want to require all generic parameters to be `Send`.
# `if-not-else`: let the logic speak for itself.
# `match-bool`: often less lines of code and I find that use `match` generally
# strictly better then `if`s.
# `missing-const-for-fn`: See https://github.com/rust-lang/rust-clippy/issues/4979.
# `module-name-repetitions`: we re-export various names.
# `needless-lifetimes`: lifetime serves as documentation.
# `option-if-let-else`: not idiomatic at all.
# `use-self`: this is a bad lint.
#
# Could fix:
# `cast-possible-truncation`.
lint: clippy
clippy:
cargo clippy --all-features -- \
--deny clippy::all \
--deny clippy::correctness \
--deny clippy::style \
--deny clippy::complexity \
--deny clippy::perf \
--deny clippy::pedantic \
--deny clippy::nursery \
--deny clippy::cargo \
--allow clippy::cargo-common-metadata \
--allow clippy::cast-possible-truncation \
--allow clippy::doc-markdown \
--allow clippy::equatable-if-let \
--allow clippy::future-not-send \
--allow clippy::if-not-else \
--allow clippy::len-without-is-empty \
--allow clippy::match-bool \
--allow clippy::match-same-arms \
--allow clippy::missing-const-for-fn \
--allow clippy::missing-errors-doc \
--allow clippy::missing-panics-doc \
--allow clippy::module-name-repetitions \
--allow clippy::must-use-candidate \
--allow clippy::needless-lifetimes \
--allow clippy::new-without-default \
--allow clippy::partialeq_ne_impl
--allow clippy::option-if-let-else \
--allow clippy::struct-field-names \
--allow clippy::use-self \

doc:
cargo doc --all-features

doc_private:
cargo doc --all-features --document-private-items

clean:
cargo clean

.PHONY: build test dev lint clean
.PHONY: dev test test_sanitizers test_sanitizer test_miri check lint clippy doc doc_private clean
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
**Store*d* is an experimental prototype not to be used in production!**

Store*d* (pronounced store-daemon, or just stored) is a distributed immutable
blob store. Stored is not a key-value store, as the key isn't the decided by the
blob store. Store*d* is not a key-value store, as the key isn't the decided by the
user but by the SHA-512 checksum of the stored blob.

It supports three operations: storing, retrieving and removing blobs. As the key
of a blob is its checksum it is not possible to modify blobs. If a blob needs to
be modified a new blob simply needs to be stored and the new key used. The
client can validate the correct delivery of the blob by using the returned key
(checksum). The blob themselves are unchanged by Stored.
(checksum). The blob themselves are unchanged by Store*d*.


## Operations

Stored supports three operations; storing values, retrieving values and removing
Store*d* supports three operations; storing values, retrieving values and removing
values. But first we need to start the server.


Expand Down
2 changes: 0 additions & 2 deletions bench/hashmap_hash/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions bench/hashmap_hash/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions bench/hashmap_hash/README.md

This file was deleted.

111 changes: 0 additions & 111 deletions bench/hashmap_hash/benches/hash_function.rs

This file was deleted.

4 changes: 0 additions & 4 deletions bench/hashmap_hash/src/main.rs

This file was deleted.

Loading