Skip to content

Commit 625c402

Browse files
committed
Add xattr-based attribute support to LocalFileSystem
Store object attributes as extended attributes on the local filesystem, enabling put_opts and put_multipart_opts to persist attributes. Attributes are set on the staging file before atomic rename to preserve consistency. - Add xattr dependency (gated by fs feature) - Map standard attributes to user.* xattr namespace - Read attributes back in get_opts
1 parent 8ef1aaa commit 625c402

2 files changed

Lines changed: 272 additions & 31 deletions

File tree

Cargo.toml

Lines changed: 65 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ description = "A generic object store interface for uniformly interacting with A
2525
keywords = ["object", "storage", "cloud"]
2626
repository = "https://github.com/apache/arrow-rs-object-store"
2727
rust-version = "1.85"
28-
include = ["src/**/*.rs", "README.md", "LICENSE.txt", "NOTICE.txt", "Cargo.toml"]
28+
include = [
29+
"src/**/*.rs",
30+
"README.md",
31+
"LICENSE.txt",
32+
"NOTICE.txt",
33+
"Cargo.toml",
34+
]
2935

3036
[package.metadata.docs.rs]
3137
all-features = true
@@ -46,21 +52,52 @@ url = "2.2"
4652
walkdir = { version = "2", optional = true }
4753

4854
# Cloud storage support
49-
base64 = { version = "0.22", default-features = false, features = ["std"], optional = true }
55+
base64 = { version = "0.22", default-features = false, features = [
56+
"std",
57+
], optional = true }
5058
form_urlencoded = { version = "1.2", optional = true }
5159
http-body-util = { version = "0.1.2", optional = true }
52-
httparse = { version = "1.8.0", default-features = false, features = ["std"], optional = true }
60+
httparse = { version = "1.8.0", default-features = false, features = [
61+
"std",
62+
], optional = true }
5363
hyper = { version = "1.2", default-features = false, optional = true }
5464
md-5 = { version = "0.10.6", default-features = false, optional = true }
55-
quick-xml = { version = "0.39.0", features = ["serialize", "overlapped-lists"], optional = true }
56-
rand = { version = "0.9", default-features = false, features = ["std", "std_rng", "thread_rng"], optional = true }
57-
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-native-roots", "http2"], optional = true }
58-
ring = { version = "0.17", default-features = false, features = ["std"], optional = true }
59-
rustls-pki-types = { version = "1.9", default-features = false, features = ["std"], optional = true }
60-
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
61-
serde_json = { version = "1.0", default-features = false, features = ["std"], optional = true }
65+
quick-xml = { version = "0.39.0", features = [
66+
"serialize",
67+
"overlapped-lists",
68+
], optional = true }
69+
rand = { version = "0.9", default-features = false, features = [
70+
"std",
71+
"std_rng",
72+
"thread_rng",
73+
], optional = true }
74+
reqwest = { version = "0.12", default-features = false, features = [
75+
"rustls-tls-native-roots",
76+
"http2",
77+
], optional = true }
78+
ring = { version = "0.17", default-features = false, features = [
79+
"std",
80+
], optional = true }
81+
rustls-pki-types = { version = "1.9", default-features = false, features = [
82+
"std",
83+
], optional = true }
84+
serde = { version = "1.0", default-features = false, features = [
85+
"derive",
86+
], optional = true }
87+
serde_json = { version = "1.0", default-features = false, features = [
88+
"std",
89+
], optional = true }
6290
serde_urlencoded = { version = "0.7", optional = true }
63-
tokio = { version = "1.29.0", features = ["sync", "macros", "rt", "time", "io-util"] }
91+
tokio = { version = "1.29.0", features = [
92+
"sync",
93+
"macros",
94+
"rt",
95+
"time",
96+
"io-util",
97+
] }
98+
99+
[target.'cfg(target_family="unix")'.dependencies]
100+
xattr = { version = "1", optional = true }
64101

65102
[target.'cfg(target_family="unix")'.dev-dependencies]
66103
nix = { version = "0.30.0", features = ["fs"] }
@@ -70,8 +107,22 @@ web-time = { version = "1.1.0" }
70107
wasm-bindgen-futures = "0.4.18"
71108

72109
[features]
73-
default = ["fs"]
74-
cloud = ["serde", "serde_json", "quick-xml", "hyper", "reqwest", "reqwest/stream", "chrono/serde", "base64", "rand", "ring", "http-body-util", "form_urlencoded", "serde_urlencoded"]
110+
default = ["fs", "xattr"]
111+
cloud = [
112+
"serde",
113+
"serde_json",
114+
"quick-xml",
115+
"hyper",
116+
"reqwest",
117+
"reqwest/stream",
118+
"chrono/serde",
119+
"base64",
120+
"rand",
121+
"ring",
122+
"http-body-util",
123+
"form_urlencoded",
124+
"serde_urlencoded",
125+
]
75126
azure = ["cloud", "httparse"]
76127
fs = ["walkdir"]
77128
gcp = ["cloud", "rustls-pki-types"]
@@ -105,4 +156,4 @@ features = ["js"]
105156
[[test]]
106157
name = "get_range_file"
107158
path = "tests/get_range_file.rs"
108-
required-features = ["fs"]
159+
required-features = ["fs"]

0 commit comments

Comments
 (0)