Skip to content

Commit a803efc

Browse files
authored
refactor: remove custom oss impl (#720)
* refactor: remove custom oss impl * fix endpoint * add region issue
1 parent 11a3b5c commit a803efc

File tree

4 files changed

+90
-254
lines changed

4 files changed

+90
-254
lines changed

Cargo.lock

+15-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analytic_engine/src/setup.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use common_util::define_result;
99
use futures::Future;
1010
use message_queue::kafka::kafka_impl::KafkaImpl;
1111
use object_store::{
12-
aliyun::AliyunOSS,
12+
aliyun,
1313
disk_cache::DiskCacheStore,
1414
mem_cache::{MemCache, MemCacheStore},
1515
metrics::StoreWithMetrics,
@@ -443,14 +443,17 @@ fn open_storage(
443443
Arc::new(store) as _
444444
}
445445
ObjectStoreOptions::Aliyun(aliyun_opts) => {
446-
let oss = Arc::new(AliyunOSS::new(
447-
aliyun_opts.key_id,
448-
aliyun_opts.key_secret,
449-
aliyun_opts.endpoint,
450-
aliyun_opts.bucket,
451-
aliyun_opts.pool_max_idle_per_host,
452-
aliyun_opts.timeout,
453-
));
446+
let oss: ObjectStoreRef = Arc::new(
447+
aliyun::try_new(
448+
aliyun_opts.key_id,
449+
aliyun_opts.key_secret,
450+
aliyun_opts.endpoint,
451+
aliyun_opts.bucket,
452+
aliyun_opts.pool_max_idle_per_host,
453+
aliyun_opts.timeout.0,
454+
)
455+
.context(OpenObjectStore)?,
456+
);
454457
let oss_with_metrics = Arc::new(StoreWithMetrics::new(oss));
455458
Arc::new(
456459
StoreWithPrefix::new(aliyun_opts.prefix, oss_with_metrics)

components/object_store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ serde = { workspace = true }
3030
serde_json = { workspace = true }
3131
snafu = { workspace = true }
3232
tokio = { workspace = true }
33-
upstream = { package = "object_store", version = "0.5.3" }
33+
upstream = { package = "object_store", version = "0.5.5", features = [ "aws" ] }
3434

3535
[dev-dependencies]
3636
tempfile = { workspace = true }

0 commit comments

Comments
 (0)