Skip to content

Commit 8db6c5c

Browse files
Rename rust_store -> object_store_ffi (#14)
1 parent 6619521 commit 8db6c5c

File tree

10 files changed

+40
-40
lines changed

10 files changed

+40
-40
lines changed

deps/build.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ run(`which rustup`)
3939
run(`rustup default stable`)
4040
run(`which cargo`)
4141
assert_compatible_version(`cargo -V`, "1.55.0")
42-
rust_source = joinpath(@__DIR__, "rust_store")
42+
rust_source = joinpath(@__DIR__, "object_store_ffi")
4343
# Elide rust warnings - they aren't helpful in this context
4444
if Sys.isapple()
4545
ENV["RUSTFLAGS"]="-Awarnings -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
File renamed without changes.
File renamed without changes.

deps/rust_store/Cargo.lock renamed to deps/object_store_ffi/Cargo.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/rust_store/Cargo.toml renamed to deps/object_store_ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "rust_store"
2+
name = "object_store_ffi"
33
version = "0.1.0"
44
edition = "2021"
55

File renamed without changes.

src/ObjectStore.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
module ObjectStore
22

33

4-
export init_rust_store, blob_get!, blob_put, AzureCredentials, RustStoreConfig
4+
export init_object_store, blob_get!, blob_put, AzureCredentials, ObjectStoreConfig
55

66
const rust_lib_dir = @static if Sys.islinux() || Sys.isapple()
77
joinpath(
88
@__DIR__,
99
"..",
1010
"deps",
11-
"rust_store",
11+
"object_store_ffi",
1212
"target",
1313
"release",
1414
)
1515
elseif Sys.iswindows()
16-
@warn("The rust-store library is currently unsupported on Windows.")
16+
@warn("The object_store_ffi library is currently unsupported on Windows.")
1717
end
1818

1919
const extension = @static if Sys.islinux()
@@ -24,25 +24,25 @@ elseif Sys.iswindows()
2424
"dll"
2525
end
2626

27-
const rust_lib = joinpath(rust_lib_dir, "librust_store.$extension")
27+
const rust_lib = joinpath(rust_lib_dir, "libobject_store_ffi.$extension")
2828

29-
struct RustStoreConfig
29+
struct ObjectStoreConfig
3030
max_retries::Culonglong
3131
retry_timeout_sec::Culonglong
3232
end
3333

34-
const RUST_STORE_STARTED = Ref(false)
34+
const OBJECT_STORE_STARTED = Ref(false)
3535
const _INIT_LOCK::ReentrantLock = ReentrantLock()
36-
function init_rust_store(config::RustStoreConfig = RustStoreConfig(15, 150))
36+
function init_object_store(config::ObjectStoreConfig = ObjectStoreConfig(15, 150))
3737
Base.@lock _INIT_LOCK begin
38-
if RUST_STORE_STARTED[]
38+
if OBJECT_STORE_STARTED[]
3939
return
4040
end
41-
res = @ccall rust_lib.start(config::RustStoreConfig)::Cint
41+
res = @ccall rust_lib.start(config::ObjectStoreConfig)::Cint
4242
if res != 0
43-
error("Failed to init_rust_store")
43+
error("Failed to init_object_store")
4444
end
45-
RUST_STORE_STARTED[] = true
45+
OBJECT_STORE_STARTED[] = true
4646
end
4747
end
4848

test/azure_blobs_exception_tests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Basic BlobStorage exceptions" setup=[InitializeRustStore] begin
1+
@testitem "Basic BlobStorage exceptions" setup=[InitializeObjectStore] begin
22
using CloudBase.CloudTest: Azurite
33
import CloudBase
44
using ObjectStore: blob_get!, blob_put, AzureCredentials
@@ -146,8 +146,8 @@
146146
end
147147

148148
@testset "multiple start" begin
149-
config = RustStoreConfig(5, 5)
150-
res = @ccall ObjectStore.rust_lib.start(config::RustStoreConfig)::Cint
149+
config = ObjectStoreConfig(5, 5)
150+
res = @ccall ObjectStore.rust_lib.start(config::ObjectStoreConfig)::Cint
151151
@test res == 1 # Rust CResult::Error
152152
end
153153
end # @testitem

test/azure_blobs_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@testitem "Basic BlobStorage usage" setup=[InitializeRustStore] begin
1+
@testitem "Basic BlobStorage usage" setup=[InitializeObjectStore] begin
22
using CloudBase.CloudTest: Azurite
33
using ObjectStore: blob_get!, blob_put, AzureCredentials
44

@@ -101,7 +101,7 @@ end # Azurite.with
101101
end # @testitem
102102

103103
# NOTE: PUT on azure always requires credentials, while GET on public containers doesn't
104-
@testitem "Basic BlobStorage usage (anonymous read enabled)" setup=[InitializeRustStore] begin
104+
@testitem "Basic BlobStorage usage (anonymous read enabled)" setup=[InitializeObjectStore] begin
105105
# TODO: implement a way for GET to be called without credentials
106106
@test_skip begin
107107
using CloudBase.CloudTest: Azurite

test/common_testsetup.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@testsetup module InitializeRustStore
1+
@testsetup module InitializeObjectStore
22
using ObjectStore
33
# Since we currently only support centralized configs, we need to have one that is compatible
44
# with all the tests (some of the tests would take too long if we use default values).
55
max_retries = 5
66
retry_timeout_sec = 5
7-
ObjectStore.init_rust_store(ObjectStore.RustStoreConfig(max_retries, retry_timeout_sec))
7+
init_object_store(ObjectStoreConfig(max_retries, retry_timeout_sec))
88
end

0 commit comments

Comments
 (0)