Skip to content

Commit

Permalink
feat(services/persy): add a basic persy service impl (apache#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
PsiACE authored Jul 16, 2023
1 parent 70afe5d commit 7803c41
Show file tree
Hide file tree
Showing 14 changed files with 434 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ OPENDAL_REDB_TABLE=redb-table
# cacache
OPENDAL_CACACHE_TEST=false
OPENDAL_CACACHE_DATADIR=/tmp/opendal/cacache/
# persy
OPENDAL_PERSY_TEST=false
OPENDAL_PERSY_DATAFILE=/tmp/opendal/test.persy
OPENDAL_PERSY_SEGMENT=data
OPENDAL_PERSY_INDEX=index
#dropbox
OPENDAL_DROPBOX_TEST=false
OPENDAL_DROPBOX_ROOT=/tmp/opendal/
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/service_test_persy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Service Test Persy

on:
push:
branches:
- main
pull_request:
branches:
- main
paths:
- "core/src/**"
- "core/tests/**"
- "!core/src/docs/**"
- "!core/src/services/**"
- "core/src/services/persy/**"
- ".github/workflows/service_test_persy.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
persy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Test persy
shell: bash
working-directory: core
run: cargo test persy --features services-persy
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_PERSY_TEST: on
OPENDAL_PERSY_DATAFILE: ./test.persy
OPENDAL_PERSY_SEGMENT: data
OPENDAL_PERSY_INDEX: index
47 changes: 47 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Major components of the project include:
- cacache: [cacache](https://crates.io/crates/cacache) backend
- dashmap: [dashmap](https://github.com/xacrimon/dashmap) backend
- memory: In memory backend
- persy: [persy](https://crates.io/crates/persy) backend
- redis: [Redis](https://redis.io/) services
- rocksdb: [RocksDB](http://rocksdb.org/) services
- sled: [sled](https://crates.io/crates/sled) backend
Expand Down
2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ services-oss = [
"reqsign?/services-aliyun",
"reqsign?/reqwest_request",
]
services-persy = ["dep:persy"]
services-redb = ["dep:redb"]
services-redis = ["dep:redis"]
services-rocksdb = ["dep:rocksdb"]
Expand Down Expand Up @@ -212,6 +213,7 @@ openssh-sftp-client = { version = "0.13.5", optional = true, features = [
opentelemetry = { version = "0.19.0", optional = true }
parking_lot = "0.12"
percent-encoding = "2"
persy = { version = "1.4.4", optional = true }
pin-project = "1"
prometheus = { version = "0.13", features = ["process"], optional = true }
prost = { version = "0.11", optional = true }
Expand Down
1 change: 1 addition & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
- cacache: [cacache](https://crates.io/crates/cacache) backend
- dashmap: [dashmap](https://github.com/xacrimon/dashmap) backend
- memory: In memory backend
- persy: [persy](https://crates.io/crates/persy) backend
- redis: [Redis](https://redis.io/) services
- rocksdb: [RocksDB](http://rocksdb.org/) services
- sled: [sled](https://crates.io/crates/sled) backend
Expand Down
5 changes: 5 additions & 0 deletions core/src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ mod cacache;
#[cfg(feature = "services-cacache")]
pub use self::cacache::Cacache;

#[cfg(feature = "services-persy")]
mod persy;
#[cfg(feature = "services-persy")]
pub use self::persy::Persy;

#[cfg(feature = "services-redis")]
mod redis;
#[cfg(feature = "services-redis")]
Expand Down
Loading

0 comments on commit 7803c41

Please sign in to comment.