Skip to main content

krabka_object_store/
lib.rs

1//! Unified object-store construction for Krabka.
2//!
3//! Krabka's KIP-405 tiered storage, `krabka-remote-storage`, and the
4//! observability blockstore, `krabka-blockstore`, share `krabka-object-store`.
5//!
6//! The scope is the object-store access and plumbing layer only. The crate
7//! turns a typed `ObjectStoreConfig` into an `object_store::ObjectStore`
8//! handle. The data representation stays in the respective consumer crates.
9//! That representation is verbatim Kafka segment bytes or Parquet blocks.
10//!
11//! On `wasm32-wasip1` the crate has only the in-memory backend. The S3, GCS
12//! and local-filesystem backends need an HTTP client stack or a filesystem
13//! walk that `object_store` does not build for that target, so their
14//! configurations fail with [`ObjectStoreError::InvalidConfig`] there, and so
15//! do the WORM bucket checks. The multipart-upload listing is not exported.
16
17use object_store as object_store_api;
18
19#[cfg(all(feature = "object-store-013", not(target_family = "wasm")))]
20pub mod v013;
21
22#[cfg(feature = "clap")]
23mod archive_args;
24
25mod build;
26mod config;
27#[cfg(not(target_family = "wasm"))]
28mod control_plane;
29mod error;
30pub mod fault;
31#[cfg(not(target_family = "wasm"))]
32mod multipart;
33mod ops;
34mod prefix;
35mod read;
36#[cfg(target_family = "wasm")]
37mod unavailable;
38#[cfg(not(target_family = "wasm"))]
39mod worm;
40
41#[cfg(feature = "clap")]
42pub use archive_args::{ArchiveArgs, ArchiveArgsError, DEFAULT_S3_REGION};
43#[cfg(not(target_family = "wasm"))]
44pub use multipart::{IncompleteMultipartUpload, list_s3_multipart_uploads};
45#[cfg(target_family = "wasm")]
46pub use unavailable::{verify_gcs_worm_bucket, verify_s3_worm_bucket};
47#[cfg(not(target_family = "wasm"))]
48pub use worm::{verify_gcs_worm_bucket, verify_s3_worm_bucket};
49pub use {
50    build::build_object_store,
51    config::{
52        DEFAULT_CONNECT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_MULTIPART_CHUNK_SIZE,
53        DEFAULT_MULTIPART_THRESHOLD, DEFAULT_REQUEST_TIMEOUT, DEFAULT_RETRY_TIMEOUT, GcsConfig,
54        ObjectStoreConfig, S3Config,
55    },
56    error::ObjectStoreError,
57    ops::{ObjectOps, ObjectStoreClient, PutMode, PutOutcome, PutRequest},
58    prefix::{normalize_prefix, prefixed_key},
59    read::read_capped,
60};
61
62#[cfg(test)]
63#[cfg(not(target_family = "wasm"))]
64mod test_support;