Skip to content

Commit

Permalink
Merge pull request #1 from tvl-labs/feat/rust-api
Browse files Browse the repository at this point in the history
feat: rust RocksDB interface and test workflow
  • Loading branch information
zeroqn authored Apr 15, 2024
2 parents 68cad82 + 1c64b10 commit 9c8ec67
Show file tree
Hide file tree
Showing 16 changed files with 1,270 additions and 14 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/rocksdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: RockdDB CI

on: [push, pull_request]

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt, clippy
toolchain: 1.75.0
- name: Install liburing
run: sudo apt-get install liburing2 liburing-dev clang
- name: Cargo fmt
run: cargo fmt --all --check
- name: Cargo clippy
run: cargo clippy --all --all-features --all-targets

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.75.0
- name: Install liburing
run: sudo apt-get install liburing2 liburing-dev clang libsnappy-dev
- name: Cargo test
run: cargo test --all --all-features

audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.vscode/
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ license = "MIT"

[dependencies]
autocxx = "0.26.0"
tvl-librocksdb-sys = { path = "librocksdb-sys", version = "8.11.3"}
moveit = "0.6.0"

[dev-dependencies]
tempfile = "3.10.1"

[workspace]
members = ["librocksdb-sys"]

[profile.release]
lto = true
2 changes: 1 addition & 1 deletion librocksdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tvl-librocksdb-sys"
version = "0.1.0"
version = "8.11.3"
edition = "2021"
description = "Bindings to RocksDB used by the cozo crate"
authors = ["Khalani Dev", "Guanhao Yin", "Ziyang Hu"]
Expand Down
2 changes: 1 addition & 1 deletion librocksdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn main() {
if cfg!(feature = "lz4") {
println!("cargo:rustc-link-lib=static=lz4");
}
if cfg!(feature = "lib-uring") {
if cfg!(feature = "io-uring") {
println!("cargo:rustc-link-lib=static=uring");
}

Expand Down
13 changes: 13 additions & 0 deletions librocksdb-sys/rocksdb_lib_sources.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
cache/cache.cc
cache/cache_entry_roles.cc
cache/cache_key.cc
cache/cache_helpers.cc
cache/cache_reservation_manager.cc
cache/charged_cache.cc
cache/clock_cache.cc
cache/lru_cache.cc
cache/compressed_secondary_cache.cc
cache/secondary_cache.cc
cache/secondary_cache_adapter.cc
cache/sharded_cache.cc
cache/tiered_secondary_cache.cc
db/arena_wrapped_db_iter.cc
db/blob/blob_contents.cc
db/blob/blob_fetcher.cc
Expand Down Expand Up @@ -89,9 +93,11 @@ db/wal_edit.cc
db/wal_manager.cc
db/wide/wide_column_serialization.cc
db/wide/wide_columns.cc
db/wide/wide_columns_helper.cc
db/write_batch.cc
db/write_batch_base.cc
db/write_controller.cc
db/write_stall_stats.cc
db/write_thread.cc
env/composite_env.cc
env/env.cc
Expand Down Expand Up @@ -151,6 +157,8 @@ options/db_options.cc
options/options.cc
options/options_helper.cc
options/options_parser.cc
options/offpeak_time_info.cc
port/mmap.cc
port/port_posix.cc
port/win/env_default.cc
port/win/env_win.cc
Expand All @@ -167,6 +175,7 @@ table/block_based/block_based_table_factory.cc
table/block_based/block_based_table_iterator.cc
table/block_based/block_based_table_reader.cc
table/block_based/block_builder.cc
table/block_based/block_cache.cc
table/block_based/block_prefetcher.cc
table/block_based/block_prefix_index.cc
table/block_based/data_block_hash_index.cc
Expand All @@ -192,6 +201,7 @@ table/format.cc
table/get_context.cc
table/iterator.cc
table/merging_iterator.cc
table/compaction_merging_iterator.cc
table/meta_blocks.cc
table/persistent_cache_helper.cc
table/plain/plain_table_bloom.cc
Expand Down Expand Up @@ -228,6 +238,7 @@ util/compression_context_cache.cc
util/concurrent_task_limiter_impl.cc
util/crc32c.cc
util/crc32c_arm64.cc
util/data_structure.cc
util/dynamic_bloom.cc
util/hash.cc
util/murmurhash.cc
Expand All @@ -241,6 +252,8 @@ util/stderr_logger.cc
util/string_util.cc
util/thread_local.cc
util/threadpool_imp.cc
util/udt_util.cc
util/write_batch_util.cc
util/xxhash.cc
utilities/agg_merge/agg_merge.cc
utilities/backup/backup_engine.cc
Expand Down
Loading

0 comments on commit 9c8ec67

Please sign in to comment.