Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@ jobs:
toolchain: stable
- name: Run cargo machete
uses: bnjbvr/cargo-machete@main
rust-cargo-tree:
name: show rust dependencies
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Print in-memory only foyer dependencies
run: |
cargo tree -p foyer --no-default-features -e normal
- name: Print hybrid foyer dependencies
run: |
cargo tree -p foyer -e normal

rust-udeps:
name: rust udeps test
strategy:
Expand Down Expand Up @@ -205,6 +227,7 @@ jobs:
- name: Run rust clippy check (stable)
if: matrix.rust_toolchain == 'stable'
run: |
cargo clippy -p foyer --no-default-features
cargo clippy --all-targets ${{ matrix.serde }} --features tokio-console -- -D warnings
cargo clippy --all-targets ${{ matrix.serde }} --features deadlock -- -D warnings
cargo clippy --all-targets ${{ matrix.serde }} --features tracing -- -D warnings
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ edition = "2021"
rust-version = "1.81.0"
repository = "https://github.com/foyer-rs/foyer"
homepage = "https://foyer.rs"
keywords = ["cache", "hybrid"]
keywords = ["cache", "hybrid", "tiered"]
authors = ["MrCroxx <mrcroxx@outlook.com>"]
license = "Apache-2.0"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ check-all:
cargo sort -w
taplo fmt
cargo fmt --all
cargo clippy -p foyer --no-default-features
cargo clippy --all-targets --features deadlock
cargo clippy --all-targets --features tokio-console
cargo clippy --all-targets --features tracing
Expand Down
4 changes: 1 addition & 3 deletions foyer-memory/src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,7 @@ where
let (tx, rx) = oneshot::channel();
o.get_mut().push(tx);
self.metrics.memory_queue.increase(1);
RawShardFetch::Wait(rx.in_span(Span::enter_with_local_parent(
"foyer::memory::raw::fetch_with_runtime::wait",
)))
RawShardFetch::Wait(rx.in_span(Span::enter_with_local_parent("foyer::memory::raw::fetch_queue::wait")))
}
HashMapEntry::Vacant(v) => {
v.insert(vec![]);
Expand Down
5 changes: 3 additions & 2 deletions foyer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ equivalent = { workspace = true }
fastrace = { workspace = true }
foyer-common = { workspace = true }
foyer-memory = { workspace = true }
foyer-storage = { workspace = true }
foyer-storage = { workspace = true, optional = true }
mixtrics = { workspace = true }
pin-project = { workspace = true }
serde = { workspace = true }
Expand Down Expand Up @@ -56,7 +56,8 @@ tokio = { package = "tokio", version = "1", features = [
] }

[features]
default = []
default = ["hybrid"]
hybrid = ["dep:foyer-storage"]
serde = ["foyer-common/serde", "foyer-storage/serde"]
tracing = [
"fastrace/enable",
Expand Down
2 changes: 2 additions & 0 deletions foyer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@

use foyer_common as common;
use foyer_memory as memory;
#[cfg(feature = "hybrid")]
use foyer_storage as storage;

#[cfg(feature = "hybrid")]
mod hybrid;

mod prelude;
Expand Down
11 changes: 7 additions & 4 deletions foyer/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ pub use crate::{
range::RangeBoundsExt,
tracing::TracingOptions,
},
memory::{
Cache, CacheBuilder, CacheEntry, CacheHint, EvictionConfig, FetchState, FifoConfig, LfuConfig, LruConfig,
S3FifoConfig, Weighter,
},
};
#[cfg(feature = "hybrid")]
pub use crate::{
hybrid::{
builder::{HybridCacheBuilder, HybridCacheBuilderPhaseMemory, HybridCacheBuilderPhaseStorage},
cache::{HybridCache, HybridCacheEntry, HybridCachePolicy, HybridFetch},
writer::{HybridCacheStorageWriter, HybridCacheWriter},
},
memory::{
Cache, CacheBuilder, CacheEntry, CacheHint, EvictionConfig, FetchState, FifoConfig, LfuConfig, LruConfig,
S3FifoConfig, Weighter,
},
storage::{
AdmissionPicker, AdmitAllPicker, ChainedAdmissionPicker, ChainedAdmissionPickerBuilder, Compression, Dev,
DevConfig, DevExt, DirectFileDevice, DirectFileDeviceOptions, DirectFsDevice, DirectFsDeviceOptions, Engine,
Expand Down
Loading