v0.46.0
Upgrade to v0.46
Public API
MSRV Changed to 1.75
Since 0.46, OpenDAL requires Rust 1.75.0 or later to use features like RPITIT
and AFIT
.
Services Feature Flag
Starting with version 0.46, OpenDAL only includes the memory service by default to prevent compiling unnecessary service code. To use other services, please activate their respective feature flags.
Additionally, we have removed all reqwest
-related feature flags:
- Users must now directly use
reqwest
's feature flags for options likerustls
,native-tls
, etc. - The
rustls
feature is no longer enabled by default; it must be activated manually. - OpenDAL no longer offers the
trust-dns
option; users should configure the client builder directly.
Range Based Read
Since v0.46, OpenDAL transformed it's Read IO trait to range based instead of stateful poll based IO. This change will make the IO more efficient, easier for concurrency and ready for completion based IO.
opendal::Reader
now have APIs like:
let r = op.reader("test.txt").await?;
let buf = r.read(1024..2048).await?;
Buffer Based IO
Since version 0.46, OpenDAL features a native Buffer
struct that supports both contiguous and non-contiguous buffers. This update enhances IO efficiency by minimizing unnecessary byte copying and enabling vectored IO.
OpenDAL's Reader
will return Buffer
and Writer
will accept Buffer
as input. Users who have implemented their own IO traits should update their code to use the new Buffer
struct.
let r = op.reader("test.txt").await?;
// read returns `Buffer`
let buf: Buffer = r.read(1024..2048).await?;
let w = op.writer("test.txt").await?;
// Buffer can be created from continues bytes.
w.write("hello, world").await?;
// Buffer can also be created from non-continues bytes.
w.write(vec![Bytes::from("hello,"), Bytes::from("world!")]).await?;
// Make sure file has been written completely.
w.close().await?;
To enhance usability, we've integrated bridges into bytes::Buf
and bytes::BufMut
, allowing users to directly interact with the bytes API.
let r = op.reader("test.txt").await?;
let mut bs = vec![];
// read_into accepts bytes::BufMut
let buf: Buffer = r.read_into(&mut bs, 1024..2048).await?;
let w = op.writer("test.txt").await?;
// write_from accepts bytes::Buf
w.write_from("hello, world".as_bytes()).await?;
// Make sure file has been written completely.
w.close().await?;
Bridge API
OpenDAL's Reader
and Writer
previously implemented APIs such as AsyncRead
and AsyncWrite
directly. This design was not user-friendly, as it could lead to unexpected costs that users were unaware of in advance.
Since v0.46, OpenDAL provides bridge APIs for Reader
and Writer
instead.
let r = op.reader("test.txt").await?;
// Convert into futures AsyncRead + AsyncSeek.
let reader = r.into_futures_async_read(1024..2048);
// Convert into futures bytes stream.
let stream = r.into_bytes_stream(1024..2048);
let w = op.writer("test.txt").await?;
// Convert into futures AsyncWrite
let writer = w.into_futures_async_write();
// Convert into futures bytes sink;
let sink = w.into_bytes_sink();
Raw API
Async in IO trait
Since version 0.46, OpenDAL has adopted Rust's native async_in_trait
for our core IO traits, including oio::Read
, oio::Write
, and oio::List
.
This update eliminates the need for manually written, poll-based state machines and simplifies the codebase. Consequently, OpenDAL now requires Rust version 1.75.0 or later.
Users who have implemented their own IO traits should update their code to use the new async trait syntax.
What's Changed
Added
- feat(services/github): add github contents support by @hoslo in #4281
- feat: Allow selecting webpki for reqwest by @arlyon in #4303
- feat(services/swift): add support for storage_url configuration in swift service by @zjregee in #4302
- feat(services/swift): add ceph test setup for swift by @zjregee in #4307
- docs(website): add local content search based on lunr plugin by @m1911star in #4348
- feat(services/sled): add SledConfig by @yufan022 in #4351
- feat : Implementing config for part of services by @AnuRage-git in #4344
- feat(bindings/java): explicit async runtime by @tisonkun in #4376
- feat(services/surrealdb): support surrealdb service by @yufan022 in #4375
- feat(bindings/java): avoid double dispose NativeObject by @tisonkun in #4377
- feat : Implement config for services/foundationdb by @AnuRage-git in #4355
- feat: add ofs ctrl-c exit unmount hook by @oowl in #4393
- feat: Implement RFC-4382 Range Based Read by @Xuanwo in #4381
- feat(ofs): rename2 lseek copy_file_range getattr API support by @oowl in #4395
- feat(services/github): make access_token optional by @hoslo in #4404
- feat(core/oio): Add readable buf by @Xuanwo in #4407
- feat(ofs): add freebsd OS support by @oowl in #4403
- feat(core/raw/oio): Add Writable Buf by @Xuanwo in #4410
- feat(bin/ofs): Add behavior test for ofs by @ho-229 in #4373
- feat(core/raw/buf): Reduce one allocation by
Arc::from_iter
by @Xuanwo in #4440 - feat: ?Send async trait for HttpBackend when the target is wasm32 by @waynexia in #4444
- feat: add
HttpClient::with()
constructor by @waynexia in #4447 - feat: Move Buffer as public API by @Xuanwo in #4450
- feat: Optimize buffer implementation and add stream support by @Xuanwo in #4458
- feat(core): Implement FromIterator for Buffer by @Xuanwo in #4459
- feat(services/ftp): Support multiple write by @xxxuuu in #4425
- feat(raw/oio): block write change to buffer by @hoslo in #4466
- feat(core): Implement read and read_into for Reader by @Xuanwo in #4467
- feat(core): Implement into_stream for Reader by @Xuanwo in #4473
- feat(core): Tune buffer operations based on benchmark results by @Xuanwo in #4468
- feat(raw/oio): Use
Buffer
as cache inRangeWrite
by @reswqa in #4476 - feat(raw/oio): Use
Buffer
as cache inOneshotWrite
by @reswqa in #4477 - feat: add list/copy/rename for dropbox by @zjregee in #4424
- feat(core): Implement write and write_from for Writer by @zjregee in #4482
- feat(core): Add auto ranged read and concurrent read support by @Xuanwo in #4486
- feat(core): Implement fetch for Reader by @Xuanwo in #4488
- feat(core): Allow concurrent reading on bytes stream by @Xuanwo in #4499
- feat: provide send-wrapper to contidionally implement Send for operators by @waynexia in #4443
- feat(bin/ofs): privileged mount by @ho-229 in #4507
- feat(services/compfs): init compfs by @George-Miao in #4519
- feat(raw/oio): Add PooledBuf to allow reuse buffer by @Xuanwo in #4522
- feat(services/fs): Add PooledBuf in fs to allow reusing memory by @Xuanwo in #4525
- feat(core): add access methods for
Buffer
by @George-Miao in #4530 - feat(core): implement
IoBuf
forBuffer
by @George-Miao in #4532 - feat(services/compfs): compio runtime and compfs structure by @George-Miao in #4534
- feat(core): change Result to default error by @George-Miao in #4535
- feat(services/github): support list recursive by @hoslo in #4423
- feat: Add crc32c checksums to S3 Service by @JWackerbauer in #4533
- feat: Add into_bytes_sink for Writer by @Xuanwo in #4541
Changed
- refactor(core/raw): Migrate
oio::Read
to async in trait by @Xuanwo in #4336 - refactor(core/raw): Align oio::BlockingRead API with oio::Read by @Xuanwo in #4349
- refactor(core/oio): Migrate
oio::List
to async fn in trait by @Xuanwo in #4352 - refactor(core/raw): Migrate oio::Write from WriteBuf to Bytes by @Xuanwo in #4356
- refactor(core/raw): Migrate
oio::Write
to async in trait by @Xuanwo in #4358 - refactor(bindings/python): Change the return type of
File::read
toPyResult<&PyBytes>
by @reswqa in #4360 - refactor(core/raw): Cleanup not used
oio::WriteBuf
andoio::ChunkedBytes
after refactor by @Xuanwo in #4361 - refactor: Remove reqwest related features by @Xuanwo in #4365
- refactor(bin/ofs): make
ofs
API public by @ho-229 in #4387 - refactor: Impl into_futures_io_async_write for Writer by @Xuanwo in #4406
- refactor(core/oio): Use ReadableBuf to remove extra clone during write by @Xuanwo in #4408
- refactor(core/raw/oio): Mark oio::Write::write as an unsafe function by @Xuanwo in #4413
- refactor(core/raw/oio): Use oio buffer in write by @Xuanwo in #4436
- refactor(core/raw): oio::Write is safe operation now by @Xuanwo in #4438
- refactor(core): Use Buffer in http request by @Xuanwo in #4460
- refactor(core): Polish FuturesBytesStream by avoiding extra copy by @Xuanwo in #4474
- refactor: Use Buffer as cache in MultipartWrite by @tisonkun in #4493
- refactor: kv::adapter should use Buffer (read part) by @tisonkun in #4494
- refactor: typed_kv::adapter should use Buffer by @tisonkun in #4497
- refactor: kv::adapter should use Buffer (write part) by @tisonkun in #4496
- refactor: Migrate FuturesAsyncReader to stream based by @Xuanwo in #4508
- refactor(services/fs): Extract FsCore from FsBackend by @Xuanwo in #4523
- refactor(core): Migrate
Accessor
to async fn in trait by @George-Miao in #4562 - refactor(core): Align naming for
Accessor
by @George-Miao in #4564
Fixed
- fix(bin/ofs): crashes when fh=None by @ho-229 in #4297
- fix(services/hdfs): fix poll_close when retry by @hoslo in #4309
- fix: fix main CI by @xxchan in #4319
- fix: fix ghac CI by @xxchan in #4320
- fix(services/dropbox): fix dropbox batch test panic in ci by @zjregee in #4329
- fix(services/hdfs-native): remove unsupported capabilities by @jihuayu in #4333
- fix(bin/ofs): build failed when target_os != linux by @ho-229 in #4334
- fix(bin/ofs): only memory backend available by @ho-229 in #4353
- fix(bindings/python): Fix the semantic of
size
argument for pythonFile::read
by @reswqa in #4359 - fix(bindings/python):
File::write
should return the written bytes by @reswqa in #4367 - fix(services/s3): omit default ports by @yufan022 in #4379
- fix(core/services/gdrive): Fix gdrive test failed for refresh token by @Xuanwo in #4435
- fix(core/services/cos): Don't allow empty credential by @Xuanwo in #4457
- fix(oay): support
WebdavFile
continuous reading and writing by @G-XD in #4374 - fix(integrations/webdav): Fix read file API changes by @Xuanwo in #4462
- fix(s3): don't delete bucket by @sameer in #4430
- fix(core): Buffer offset misuse by @George-Miao in #4481
- fix(core): Read chunk should respect users input by @Xuanwo in #4487
- fix(services/cos): fix mdx by @hoslo in #4510
- fix: minor doc issue by @George-Miao in #4517
- fix(website): community sync calendar iframe by @suyanhanx in #4549
- fix: community sync calendar iframe load failed by @suyanhanx in #4550
Docs
- docs: Add gsoc proposal guide by @Xuanwo in #4287
- docs: Add blog for apache opendal participates in gsoc 2024 by @Xuanwo in #4288
- docs: Fix and improve docs for presign operations by @Xuanwo in #4294
- docs: Polish the docs for writer by @Xuanwo in #4296
- docs: Add redirect for discord and maillist by @Xuanwo in #4312
- docs: update swift docs by @zjregee in #4327
- docs: publish docs for object-store-opendal by @zjregee in #4328
- docs: fix redirect error in object-store-opendal by @zjregee in #4332
- docs(website): fix grammar and spelling by @jbampton in #4340
- docs: fix nodejs binding docs footer copyright by @m1911star in #4346
- docs(bin/ofs): update README by @ho-229 in #4354
- docs(services/gcs): update gcs credentials description by @zjregee in #4362
- docs(bindings/python): ipynb examples for polars and pandas by @reswqa in #4368
- docs(core): correct the doc for icloud and memcached by @Kilerd in #4422
- docs: polish release doc for vote result by @suyanhanx in #4429
- docs: Update links to o.a.o/discord by @Xuanwo in #4442
- docs: add layers example by @zjregee in #4449
- docs: publish docs for dav-server-opendalfs by @zjregee in #4503
- docs: Add docs for read_with and reader_with by @Xuanwo in #4516
- docs: Add upgrade doc for rust core 0.46 by @Xuanwo in #4543
- docs: update the outdated download link by @suyanhanx in #4546
CI
- ci(binding/java): Don't create too many files in CI by @Xuanwo in #4289
- ci: Address Node.js 16 actions are deprecated by @Xuanwo in #4293
- ci: Disable vsftpd test for it's keeping failure by @Xuanwo in #4295
- build: remove
service-*
from default features by @xxchan in #4311 - ci: upgrade typos in ci by @Young-Flash in #4322
- ci: Disable R2 until we figure what happened by @Xuanwo in #4323
- ci(s3/minio): Disable IMDSv2 for mini anonymous tests by @Xuanwo in #4326
- ci: Fix unit tests missing protoc by @Xuanwo in #4369
- ci: Fix foundationdb not setup for unit test by @Xuanwo in #4370
- ci: bump license header formatter by @tisonkun in #4390
- ci: fix dragonflydb docker-compose healthcheck broken by @oowl in #4431
- ci: fix planner for bin ofs by @ho-229 in #4448
- ci: Revert oay changes to fix CI by @Xuanwo in #4463
- ci: Fix CI for all bindings by @Xuanwo in #4469
- ci: Disable dropbox test until #4484 fixed by @Xuanwo in #4485
- ci: Fix build of python binding for chunk write changes by @Xuanwo in #4529
- build(core): bump compio version to v0.10.0 by @George-Miao in #4531
- ci: Disable tikv for pingcap's mirror is unstable by @Xuanwo in #4538
- build: staging website by @tisonkun in #4565
- build: fixup follow asfyaml rules by @tisonkun in #4566
- ci: fixup release java action by @tisonkun in #4568
- ci: fixup release nodejs and rc site by @tisonkun in #4569
- ci: workaround any special character issues on autostage by @tisonkun in #4570
Chore
- chore(deps): bump tempfile from 3.9.0 to 3.10.1 in /bin/oli by @dependabot in #4298
- chore(deps): bump wasm-bindgen-test from 0.3.40 to 0.3.41 in /core by @dependabot in #4299
- chore(deps): bump log from 0.4.20 to 0.4.21 in /bin/ofs by @dependabot in #4301
- chore(services/redis): Fix docs & comments typos by @AJIOB in #4306
- chore(editorconfig): add
yaml
file type by @jbampton in #4339 - chore(editorconfig): add
rdf
file type asindent_size = 2
by @jbampton in #4341 - chore(editorconfig): order entries and add
indent_style = tab
for Go by @jbampton in #4342 - chore(labeler): order the GitHub labeler labels by @jbampton in #4343
- chore: Cleanup of oio::Read, docs, comments, naming by @Xuanwo in #4345
- chore: Remove not exist read operations by @Xuanwo in #4412
- chore(deps): bump toml from 0.8.10 to 0.8.12 in /bin/oay by @dependabot in #4418
- chore(deps): bump toml from 0.8.10 to 0.8.12 in /bin/oli by @dependabot in #4420
- chore(deps): bump tokio from 1.36.0 to 1.37.0 in /bin/ofs by @dependabot in #4419
- chore(deps): bump prometheus-client from 0.22.1 to 0.22.2 in /core by @dependabot in #4417
- chore: update copyright year to 2024 in NOTICE by @shoothzj in #4433
- chore: Bump bytes to 1.6 to avoid compileing error by @Xuanwo in #4472
- chore: Add output types in OperatorFutures by @Xuanwo in #4475
- chore(core): Use reader's chunk size instead by @Xuanwo in #4489
- chore: sort tomls by taplo by @tisonkun in #4491
- chore(core): Align Reader and Writer's API design by @Xuanwo in #4498
- chore: Add docs and tests for reader related types by @Xuanwo in #4513
- chore: Reorganize the blocking reader layout by @Xuanwo in #4514
- chore: Align with chunk instead of confusing buffer by @Xuanwo in #4528
- chore: Refactor Write and BlockingWrite API by @Xuanwo in #4540
- chore(core): Change std result to opendal result in core by @tannal in #4542
- chore: fixup download links by @tisonkun in #4547
- chore(deps): bump clap from 4.5.1 to 4.5.4 in /bin/oay by @dependabot in #4557
- chore(deps): bump anyhow from 1.0.80 to 1.0.82 in /bin/oli by @dependabot in #4559
- chore(deps): bump libc from 0.2.153 to 0.2.154 in /bin/ofs by @dependabot in #4558
- chore: bump version to 0.46.0 by @tisonkun in #4567
New Contributors
- @arlyon made their first contribution in #4303
- @m1911star made their first contribution in #4346
- @yufan022 made their first contribution in #4351
- @AnuRage-git made their first contribution in #4344
- @reswqa made their first contribution in #4359
- @shoothzj made their first contribution in #4433
- @xxxuuu made their first contribution in #4425
- @sameer made their first contribution in #4430
- @George-Miao made their first contribution in #4481
- @mobiusklein made their first contribution in #4384
- @JWackerbauer made their first contribution in #4533
- @tannal made their first contribution in #4542
Full Changelog: v0.45.1...v0.46.0