Apache Arrow Rust Object Store

repository·main·Indexed 43 days ago

https://github.com/apache/arrow-rs-object-store

A high-performance, asynchronous Rust library providing a generic interface for interacting with object storage backends, including AWS S3, Azure Blob Storage, Google Cloud Storage, local filesystems, memory, and HTTP/WebDAV. Version 0.14.2 supports advanced features like SSE-C, paginated listing, and custom HTTP clients via optional reqwest dependency.

Tokens
30.9K
Snippets
83
Records
142
Agent score
55%

What's inside object_store

  1. Overview of Rust Object Store

    main

    The object_store crate is a high-performance, asynchronous, and idiomatic Rust library designed for interacting with various object storage backends. It allows developers to write code that can run across multiple cloud environments and local test setups by simply changing the runtime configuration.

    Supported backends include:

    • AWS S3
    • Azure Blob Storage
    • Google Cloud Storage
    • Local files
    • Memory
    • HTTP/WebDAV Storage
    • Custom implementations
  2. Use the ObjectStoreExt trait for convenience methods

    main

    Starting with version 0.13.0, many high-level convenience methods were moved out of the primary ObjectStore trait and into the ObjectStoreExt trait to keep the core trait lean. To use these methods, ensure you have imported the ObjectStoreExt trait into your scope.

    Methods available in ObjectStoreExt:

    • get
    • head
    • get_range
    • delete
    • put_multipart
    use object_store::ObjectStore;
    use object_store::ObjectStoreExt; // Required to access convenience methods
    
    // Now methods like .get() or .head() are accessed via ObjectStoreExt
    let metadata = store.head(path).await?;
  3. Migrate from v0.13.2 to v0.14.0

    main

    Upgrading to v0.14.0 introduces several breaking changes that require updates to your configuration and dependency management:

    • Feature Flags: The cloud feature alias has been removed. You must now enable specific cloud provider features directly.
    • Optional reqwest: The reqwest dependency is now optional. If your application does not require HTTP-based object stores, you can disable it to reduce binary size and dependencies.
    • Result Extensions: *Result objects now include Extensions. Ensure your error handling logic accounts for this new field if you rely on metadata passed through results.
    • Crypto Provider: The default crypto provider has changed from ring to aws-rust-lc (via aws-lc-rs).
    # Example: If you previously used the 'cloud' feature, 
    # you must now specify your required providers explicitly.
    # [object_store-0.14.0-dependencies]
    # object_store = { version = "0.14.0", features = ["s3", "azure"] }
  4. Disable `reqwest` to use custom HTTP clients or target `wasm32-wasip1`

    main

    The standard cloud features (aws, azure, gcp, and http) bundle a reqwest-based HTTP transport. If you need to target wasm32-wasip1 (where reqwest does not compile) or if you want to provide your own HTTP client, you must disable default features and use the corresponding *-base feature instead.

    cargo build -p object_store --no-default-features --features aws-base --target wasm32-wasip1
  5. Migrate to v0.13.0: Breaking API Changes

    main

    Upgrading to version 0.13.0 introduces several breaking changes to the ObjectStore API. The core ObjectStore trait was refactored to separate core functionality from convenience methods, which were moved to the ObjectStoreExt trait.

    Key Changes:

    • Consolidated Options: copy and copy_if_not_exists have been replaced by copy_opts. Similarly, rename and rename_if_not_exists have been replaced by rename_opts.
    • Trait Migration: The following methods have been moved from the ObjectStore trait to the ObjectStoreExt trait:
      • get
      • head
      • get_range
      • delete
      • put_multipart
    • Lifetime Changes: delete_stream now uses a 'static lifetime.
    • Toolchain Requirements: The Rust edition has been bumped to 2024, and the minimum supported Rust version (MSRV) is now 1.85.
    // Example of the new pattern for consolidated options in v0.13.0
    // Instead of: store.copy(src, dest)
    // Use: store.copy_opts(src, dest, options)
  6. Build for the `wasm32-unknown-unknown` target

    main

    You can build object_store for the wasm32-unknown-unknown target. However, note that the cloud storage features (aws, azure, gcp, and http) are not supported on this target.

    cargo build -p object_store --target wasm32-unknown-unknown
  7. Configure ObjectStore using the simplified configuration pattern

    main
    Starting with object_store version 0.6.0, the configuration pattern for ObjectStore was simplified. Users should adopt the new pattern for instantiating stores (e.g., S3, Azure, GCS) to ensure compatibility with the updated builder and options API.