Skip to content

Commit

Permalink
refactor: remove custom oss impl (#720)
Browse files Browse the repository at this point in the history
* refactor: remove custom oss impl

* fix endpoint

* add region issue
  • Loading branch information
jiacai2050 authored Mar 10, 2023
1 parent 11a3b5c commit a803efc
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 254 deletions.
21 changes: 15 additions & 6 deletions Cargo.lock

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

21 changes: 12 additions & 9 deletions analytic_engine/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use common_util::define_result;
use futures::Future;
use message_queue::kafka::kafka_impl::KafkaImpl;
use object_store::{
aliyun::AliyunOSS,
aliyun,
disk_cache::DiskCacheStore,
mem_cache::{MemCache, MemCacheStore},
metrics::StoreWithMetrics,
Expand Down Expand Up @@ -443,14 +443,17 @@ fn open_storage(
Arc::new(store) as _
}
ObjectStoreOptions::Aliyun(aliyun_opts) => {
let oss = Arc::new(AliyunOSS::new(
aliyun_opts.key_id,
aliyun_opts.key_secret,
aliyun_opts.endpoint,
aliyun_opts.bucket,
aliyun_opts.pool_max_idle_per_host,
aliyun_opts.timeout,
));
let oss: ObjectStoreRef = Arc::new(
aliyun::try_new(
aliyun_opts.key_id,
aliyun_opts.key_secret,
aliyun_opts.endpoint,
aliyun_opts.bucket,
aliyun_opts.pool_max_idle_per_host,
aliyun_opts.timeout.0,
)
.context(OpenObjectStore)?,
);
let oss_with_metrics = Arc::new(StoreWithMetrics::new(oss));
Arc::new(
StoreWithPrefix::new(aliyun_opts.prefix, oss_with_metrics)
Expand Down
2 changes: 1 addition & 1 deletion components/object_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
snafu = { workspace = true }
tokio = { workspace = true }
upstream = { package = "object_store", version = "0.5.3" }
upstream = { package = "object_store", version = "0.5.5", features = [ "aws" ] }

[dev-dependencies]
tempfile = { workspace = true }
Loading

0 comments on commit a803efc

Please sign in to comment.