Skip to content

Commit

Permalink
refactor: use enum instead of version for encoding format in pb (#655)
Browse files Browse the repository at this point in the history
* refactor: use enum instead of version for encoding format in pb

* fix ut

* update package fs_extra to resolve incompact issue reported by cargo

* remove wrong exmaple config

* fix integration test

* rename 'type' of cluster deployment to 'mode'

* rename wal_storage to wal
  • Loading branch information
ShiKaiWi authored Feb 17, 2023
1 parent 7b6ca9a commit 3865c1b
Show file tree
Hide file tree
Showing 19 changed files with 125 additions and 189 deletions.
38 changes: 19 additions & 19 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ zstd = { version = "0.12", default-features = false }

[workspace.dependencies.ceresdbproto]
git = "https://github.com/CeresDB/ceresdbproto.git"
rev = "2d99b441d8dd947caa51019a9d2ff3873aaca6d1"
rev = "4dbd2b36262affd83f8a2d4a99273e43aebcb067"

[dependencies]
analytic_engine = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions analytic_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct Config {
/// + RocksDB
/// + OBKV
/// + Kafka
pub wal_storage: WalStorageConfig,
pub wal: WalStorageConfig,

pub remote_engine_client: remote_engine_client::config::Config,
}
Expand All @@ -107,7 +107,7 @@ impl Default for Config {
db_write_buffer_size: 0,
scan_batch_size: 500,
sst_background_read_parallelism: 8,
wal_storage: WalStorageConfig::RocksDB(Box::default()),
wal: WalStorageConfig::RocksDB(Box::default()),
remote_engine_client: remote_engine_client::config::Config::default(),
}
}
Expand Down
14 changes: 7 additions & 7 deletions analytic_engine/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ impl EngineBuilder for RocksDBWalEngineBuilder {
engine_runtimes: Arc<EngineRuntimes>,
object_store: ObjectStoreRef,
) -> Result<(WalManagerRef, ManifestRef)> {
let rocksdb_wal_config = match config.wal_storage {
let rocksdb_wal_config = match config.wal {
WalStorageConfig::RocksDB(config) => *config,
_ => {
return InvalidWalConfig {
msg: format!(
"invalid wal storage config while opening rocksDB wal, config:{:?}",
config.wal_storage
config.wal
),
}
.fail();
Expand Down Expand Up @@ -236,13 +236,13 @@ impl EngineBuilder for ObkvWalEngineBuilder {
engine_runtimes: Arc<EngineRuntimes>,
object_store: ObjectStoreRef,
) -> Result<(WalManagerRef, ManifestRef)> {
let obkv_wal_config = match &config.wal_storage {
let obkv_wal_config = match &config.wal {
WalStorageConfig::Obkv(config) => config.clone(),
_ => {
return InvalidWalConfig {
msg: format!(
"invalid wal storage config while opening obkv wal, config:{:?}",
config.wal_storage
config.wal
),
}
.fail();
Expand Down Expand Up @@ -285,13 +285,13 @@ impl EngineBuilder for MemWalEngineBuilder {
engine_runtimes: Arc<EngineRuntimes>,
object_store: ObjectStoreRef,
) -> Result<(WalManagerRef, ManifestRef)> {
let obkv_wal_config = match &config.wal_storage {
let obkv_wal_config = match &config.wal {
WalStorageConfig::Obkv(config) => config.clone(),
_ => {
return InvalidWalConfig {
msg: format!(
"invalid wal storage config while opening memory wal, config:{:?}",
config.wal_storage
config.wal
),
}
.fail();
Expand Down Expand Up @@ -320,7 +320,7 @@ impl EngineBuilder for KafkaWalEngineBuilder {
engine_runtimes: Arc<EngineRuntimes>,
object_store: ObjectStoreRef,
) -> Result<(WalManagerRef, ManifestRef)> {
let kafka_wal_config = match &config.wal_storage {
let kafka_wal_config = match &config.wal {
WalStorageConfig::Kafka(config) => config.clone(),
_ => {
return InvalidWalConfig {
Expand Down
Loading

0 comments on commit 3865c1b

Please sign in to comment.