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
4,102 changes: 4,102 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

144 changes: 144 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
[package]
name = "geaflow_cstore"
version = "0.1.0"
edition = "2021"
exclude = ["target/"]

[features]
default = ["opendal"]

opendal = ["dep:tokio", "dep:opendal"]
hdfs = ["dep:tokio", "dep:hdrs", "opendal/services-hdfs"]

[dependencies]
bytes = "1.5"
memmap2 = "0.7.1"
prost = "0.11.9"
prost-types = "0.11.9"
protobuf = "3.3.0"
lazy_static = "1.4"
strum = "0.25"
strum_macros = "0.25"
skiplist = "0.5.1"
rand = "0.8.5"
rand_isaac = "0.3.0"
itertools = "0.11.0"
dashmap = "5.5.3"
snap = "1.1.0"
rustc-hash = "1.1.0"
num_enum = "0.6.1"
lz4_flex = "0.11.1"
lz4 = "1.24.0"
chrono = "0.4.31"
flate2 = "1.0.27"
human_bytes = { version = "0.4", features = ["fast"] }
flatbuffers = "23.5.26"
bincode = "1.3.3"
serde = "1.0.188"
serde_json = "1.0.107"
flatc-rust = "0.2.0"
config = "0.13.3"
serde_derive = "1.0.188"
cxx = "1.0"
murmurhash3 = "0.0.5"
rayon = "1.8.0"
crossbeam = "0.8.2"
quick_cache = "0.3.0"
moka = "0.11.3"
thiserror = "1.0.49"
crc32fast = "1.3.2"
sha2 = { version = "0.10", default-features = false }
paste = "1.0.14"
num = "0.4.1"
libc = "0.2"
rocksdb = "0.21.0"
metrics = "0.21.1"
metrics-util = "0.15.0"
metrics-exporter-prometheus = "0.12.1"
hostname = "0.1.5"
thread-id = "4.2.1"
hdrs = { version = "0.3.0", features = ["async_file","vendored"], optional = true }
opendal = {version = "0.43.0", optional = true}
tokio = {version = "1.33.0", features = ["rt-multi-thread", "rt"], optional = true }
jni = "0.21.1"
tracing = { version = "0.1.40", features = [] }
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "local-time"] }
tracing-appender = "0.2.2"
tracing-error = "0.2.0"
color-eyre = "0.5"
uuid = {version = "1.5.0", features = ["v4", "fast-rng", "macro-diagnostics"]}
time = { version = "0.3.30", features = ["local-offset", "macros"] }

[build-dependencies]
prost-build = "0.11.9"
flatc-rust = "0.2.0"
cxx-build = "1.0"

[dev-dependencies]
criterion = "0.4"

[[bench]]
path = "benchmark/random/bench_table.rs"
name = "bench_table_with_random_source"
harness = false

[[bench]]
path = "benchmark/random/bench_engine.rs"
name = "bench_store_with_random_source"
harness = false

[[bench]]
path = "benchmark/random/bench_segment.rs"
name = "bench_segment_with_random_source"
harness = false

[[bench]]
path = "benchmark/ldbc/bench_engine.rs"
name = "bench_store_with_ldbc_source"
harness = false

[[bench]]
path = "benchmark/random/bench_mem_index.rs"
name = "bench_mem_index_with_random_source"
harness = false
bench = false

[[bench]]
path = "benchmark/random/bench_serialize.rs"
name = "bench_serialize_with_random_source"
harness = false
bench = false

[[bench]]
path = "benchmark/perfect_hash/bench_hash.rs"
name = "bench_perfect_hash_function"
harness = false
bench = false

[[bench]]
path = "benchmark/perfect_hash/bench_build.rs"
name = "bench_perfect_hash_build"
harness = false
bench = false

[[bench]]
path = "benchmark/perfect_hash/bench_lookup.rs"
name = "bench_perfect_hash_map"
harness = false
bench = false

[profile.dev]
opt-level = 3
debug = false

[profile.test]
opt-level = 3
debug = false

[profile.release]
opt-level = 3
debug = false

[profile.bench]
opt-level = 3
debug = false
7 changes: 7 additions & 0 deletions LEGAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Legal Disclaimer

Within this source code, the comments in Chinese shall be the original, governing version. Any comment in other languages are for reference only. In the event of any conflict between the Chinese language version comments and other language version comments, the Chinese language version shall prevail.

法律免责声明

关于代码注释部分,中文注释为官方版本,其它语言注释仅做参考。中文注释可能与其它语言注释存在不一致,当中文注释与其它语言注释存在不一致时,请以中文注释为准。
169 changes: 169 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Geaflow CStore Makefile #

# Default command.
.DEFAULT_GOAL=help

# Get the version from cargo.toml.
VERSION := $(shell awk -F '["]' '/^version/ {print $$2}' Cargo.toml)

# Variable of cargo.
CARGO := cargo

# Variable of enviroment
RUST_BACKTRACE := RUST_BACKTRACE=full
RUST_FLAGS_LOCAL := RUSTFLAGS="-Dwarnings"
CARGO_NET_FLAGS := CARGO_NET_RETRY=5 HTTP_TIMEOUT=60

# Generate differentiated commands based on environment variable 'FEATURES'
ifeq ($(FEATURES),1)
CARGO_DWF := $(RUST_BACKTRACE) $(CARGO_NET_FLAGS) $(CARGO)
SUFFIX := --features hdfs
else
CARGO_DWF := $(RUST_BACKTRACE) $(CARGO_NET_FLAGS) $(CARGO)
SUFFIX :=
endif

# Variable of enable nightly.
NIGHTLY := +nightly-2023-08-15

# Variable of build command.
BUILD_RELEASE := $(CARGO_DWF) rustc --release --crate-type=cdylib $(SUFFIX)
BUILD_DEV := $(CARGO_DWF) build $(SUFFIX)

# Variable of fmt command.
FMT := $(CARGO_DWF) $(NIGHTLY) fmt --all

# Variable of static check command.
CLIPPY := $(CARGO_DWF) $(NIGHTLY) clippy $(SUFFIX)

# Variable of test command.
RUN_UNIT_TEST := $(CARGO_DWF) test --lib $(SUFFIX)
RUN_ALL_TEST := $(CARGO_DWF) test $(SUFFIX) && $(CARGO_DWF) test $(SUFFIX) -- --ignored
RUN_TEST_SPECIFY_TARGET_TEST_FUNCTION := $(CARGO_DWF) test
RUN_TEST_SPECIFY_TARGET_INTEGRATION_MOD := $(CARGO_DWF) test --test

# Variable of benchmark command.
BUILD_BENCH := $(CARGO_DWF) bench --no-run $(SUFFIX)
RUN_BENCH := $(CARGO_DWF) bench $(SUFFIX)
RUN_SPE_BENCH := $(CARGO_DWF) bench --bench

# Variable of generate code from proto,
# FLATC := flatc --rust -o src/common/gen/ proto/graph_data.fbs

# Variable of doc command.
GENERATE_DOC := $(CARGO) doc --open

# Variable of update
UPDATE := $(CARGO) upgrade && $(CARGO) update && rustup update && rustup update nightly

# Variable of clean.
CLEAN := $(CARGO_DWF) clean

# Optional parameters.
mod :=

## All optional user commands.
.PHONY: build-dev
build-dev: ## Build the geaflow-cstore with dev version. Both <make build> and <make build-dev> work.
$(FMT)
$(CLIPPY)
$(BUILD_DEV)
$(BUILD_BENCH)

.PHONY: build
build: build-dev

.PHONY: build-release
build-release: ## Build the geaflow-cstore with release version.
$(FMT)
$(CLIPPY)
$(BUILD_BENCH)
$(BUILD_RELEASE)

.PHONY: fmt
fmt: ## Format the code by rustfmt.toml.
$(FMT)

.PHONY: clippy
clippy: ## Check statically code with clippy.
$(CLIPPY)

.PHONY: test-all
test-all: ## Run all integration tests and unit tests, include ignored tests.
$(RUN_ALL_TEST)

.PHONY: test
test: ## Execute all the unit tests.
$(RUN_UNIT_TEST)

.PHONY: test-fn
test-fn: ## Use "make test-fn mod=<func_name>" to specify which function of test to run.
$(RUN_TEST_SPECIFY_TARGET_TEST_FUNCTION) $(mod) $(SUFFIX)

.PHONY: test-in
test-in: ## Use "make test-in mod=<func_name>" to specify which target of integration tests to run.
$(RUN_TEST_SPECIFY_TARGET_INTEGRATION_MOD) $(mod) $(SUFFIX)

.PHONY: bench-all
bench-all: ## Run all benches.
$(RUN_BENCH)

.PHONY: bench
bench: ## Use "make bench mod=<mod_name>" to specify which bench of mod to run.
$(RUN_SPE_BENCH) $(mod) $(SUFFIX)

.PHONY: doc
doc: ## Generate the document of geaflow-cstore and open it in html.
$(GENERATE_DOC)

.PHONY: all
all: ## Execute code style and static checks, release version compilation and tests in sequence.
$(FMT)
$(CLIPPY)
$(BUILD_RELEASE)
$(BUILD_BENCH)
$(RUN_UNIT_TEST)

.PHONY: update
update: ## Update all the dependences to the newest version, include rust analyzer.
$(UPDATE)

.PHONY: gen
gen: ## Generate the code described by proto.
$(FLATC)

.PHONY: features
features: ## Use "make features mod=<id>" {0->[default] 1->[hdfs]} to set the env in ~/.cstore_buildrc.
@if [ $(mod) -eq 1 ] || [ $(mod) -eq 0 ] || [ $(mod) -eq 2 ]; then \
touch ~/.cstore_buildrc; \
if [ $(shell grep "export FEATURES=" ~/.cstore_buildrc | wc -l) -eq 1 ] ; then \
sed -i 's/FEATURES=.*/FEATURES=$(mod)/g' ~/.cstore_buildrc; \
echo "change geaflow_cstore mod to $(mod)"; \
else \
echo "export FEATURES=$(mod)" >> ~/.cstore_buildrc; \
fi \
else \
echo "Warning: Chose effective features" ;\
echo "Sug: 0->[default] 1->[hdfs]"; \
fi

.PHONY: clean
clean: ## Clean up the cargo cache.
$(CLEAN)

.PHONY: vesion
version: ## Show the version of geaflow-cstore.
@echo "\033[34mgeaflow-cstore $(VERSION)\033[0m"

.PHONY: help
help: ## List optional commands.
@echo "\033[34mgeaflow-cstore $(VERSION)\033[0m"
@echo "Usage: make <target>"
@echo "Targets:"
@awk -F ':|##' '/^[^\t].+?:.*?##/ {\
printf " \033[36m%-30s\033[0m %s\n", $$1, $$NF \
}' $(MAKEFILE_LIST)




48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# geaflow-cstore
GeaFlow-Cstore is Ant Group's self-developed graph computing storage system, which internally supports the GeaFlow unified stream-batch graph computing system.
# CStore
CStore is a open-source **Graph-Native** storage engine designed for graph based OLAP(Online Analytics Processing) scenario.

## Quick Start
### Build Prerequisites
```shell
# install rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# install nightly toolchain.
rustup update && rustup toolchain install nightly && rustc --version
# install other dependencies.
yum install make gcc gcc-c++ protobuf-devel protobuf clang
```

### Build from Source
The project support building out of box.
```shell
make build
```

## Develop
Please use "make help" to get more dev information.
```shell
geaflow-cstore 0.1.0
Usage: make <target>
Targets:
build-dev Build the geaflow-cstore with dev version. Both <make build> and <make build-dev> work.
build-release Build the geaflow-cstore with release version.
fmt Format the code by rustfmt.toml.
clippy Check statically code with clippy.
test-all Run all integration tests and unit tests, include ignored tests.
test Execute all the unit tests.
test-fn Use "make test-fn mod=<func_name>" to specify which function of test to run.
test-in Use "make test-in mod=<func_name>" to specify which target of integration tests to run.
bench-all Run all benches.
bench Use "make bench mod=<mod_name>" to specify which bench of mod to run.
doc Generate the document of geaflow-cstore and open it in html.
all Execute code style and static checks, release version compilation and tests in sequence.
update Update all the dependences to the newest version, include rust analyzer.
gen Generate the code described by proto.
features Use "make features mod=<id>" {0->[default] 1->[hdfs]} to set the env in ~/.cstore_buildrc.
clean Clean up the cargo cache.
version Show the version of geaflow-cstore.
help List optional commands.
```

Loading