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

feat(puffin): implement MokaCacheManager #4211

Merged
merged 21 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/puffin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,23 @@ workspace = true
async-compression = "0.4.11"
async-trait.workspace = true
async-walkdir = "2.0.0"
base64.workspace = true
bitflags.workspace = true
common-error.workspace = true
common-macro.workspace = true
common-telemetry.workspace = true
derive_builder.workspace = true
futures.workspace = true
lz4_flex = "0.11"
moka.workspace = true
pin-project.workspace = true
serde.workspace = true
serde_json.workspace = true
sha2 = "0.10.8"
snafu.workspace = true
tokio.workspace = true
tokio-util.workspace = true
uuid.workspace = true

[dev-dependencies]
common-test-util.workspace = true
27 changes: 27 additions & 0 deletions src/puffin/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,30 @@ pub enum Error {
location: Location,
},

#[snafu(display("Failed to create"))]
Create {
#[snafu(source)]
error: IoError,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Failed to rename"))]
Rename {
#[snafu(source)]
error: IoError,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Failed to remove"))]
Remove {
#[snafu(source)]
error: IoError,
#[snafu(implicit)]
location: Location,
},

#[snafu(display("Error while walking directory"))]
WalkDirError {
#[snafu(source)]
Expand Down Expand Up @@ -235,6 +259,9 @@ impl ErrorExt for Error {
| Close { .. }
| Open { .. }
| Metadata { .. }
| Create { .. }
| Remove { .. }
| Rename { .. }
| SerializeJson { .. }
| BytesToInteger { .. }
| ParseStageNotMatch { .. }
Expand Down
2 changes: 2 additions & 0 deletions src/puffin/src/puffin_manager/cache_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

mod moka_cache_manager;

use std::path::PathBuf;
use std::sync::Arc;

Expand Down
Loading