pub struct S3SourceConfig {
pub bucket: String,
pub prefix: Option<String>,
pub region: Option<String>,
pub endpoint_url: Option<String>,
pub file_format: S3FileFormat,
pub max_objects: Option<usize>,
pub concurrency: usize,
pub batch_size: usize,
pub verify_length: bool,
pub verify_checksum: bool,
pub compression: CompressionConfig,
}Expand description
Configuration for the S3 source connector.
Fields§
§bucket: StringS3 bucket name.
prefix: Option<String>Object key prefix filter.
region: Option<String>AWS region. None uses the SDK default.
endpoint_url: Option<String>Custom endpoint URL for S3-compatible services (e.g. MinIO).
file_format: S3FileFormatFormat of the files to read.
max_objects: Option<usize>Maximum number of objects to read.
concurrency: usizeMaximum number of concurrent object reads (default: 10).
batch_size: usizeRecords per emitted StreamPage. For
JsonLines and RawText formats, the object body is decoded
line-by-line via tokio::io::AsyncBufReadExt and a page is yielded
whenever the buffer reaches this size; multi-object scans flatten so
a single page may contain lines from any object. For JsonArray,
each object is buffered fully before its records are chunked into
pages of this size (see the README “Streaming and batching” section
for the caveat). Defaults to DEFAULT_BATCH_SIZE.
batch_size = 0 is the “no batching” sentinel: every page is one
complete object — no within-object chunking. Useful for small
lookup files, or for sinks (e.g. SQL COPY, BigQuery load jobs)
that prefer one large request per file to many small ones.
verify_length: boolVerify each object’s byte length against the Content-Length the
store advertises, failing the read with FaucetError::Source
on a short (truncated) or over-long transfer (#161). The check is
cheap (a byte counter over the body that is read anyway) and defaults
to true. Disable it only for an S3-compatible store that does not
return a reliable Content-Length. When the store reports no length,
the check is skipped (a debug log notes it) rather than failing.
verify_checksum: boolVerify each object’s body against the checksum the store advertises —
an x-amz-checksum-{crc32,crc32c,sha1,sha256} header when present, or
the ETag as MD5 for a non-multipart upload (#161). Stronger than the
length check but costs a hash over the full body, so it defaults to
false. Enabling it sets ChecksumMode::Enabled on each GetObject
so the store returns its stored checksum. When the store advertises no
usable checksum for an object, verification is skipped for that object
(a debug log notes it); the length check still applies.
compression: CompressionConfigcompression only.Compression codec applied to each downloaded object. Defaults to
CompressionConfig::Auto —
the codec is resolved per-object-key, so a single source can read a
mix of compressed and uncompressed objects. Requires the
crate-local compression feature.
Implementations§
Source§impl S3SourceConfig
impl S3SourceConfig
Sourcepub fn new(bucket: impl Into<String>) -> Self
pub fn new(bucket: impl Into<String>) -> Self
Create a new config with the required bucket name and sensible defaults.
Sourcepub fn endpoint_url(self, url: impl Into<String>) -> Self
pub fn endpoint_url(self, url: impl Into<String>) -> Self
Set a custom endpoint URL for S3-compatible services.
Sourcepub fn file_format(self, format: S3FileFormat) -> Self
pub fn file_format(self, format: S3FileFormat) -> Self
Set the file format.
Sourcepub fn max_objects(self, max: usize) -> Self
pub fn max_objects(self, max: usize) -> Self
Set the maximum number of objects to read.
Sourcepub fn concurrency(self, concurrency: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
Set the maximum number of concurrent object reads.
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
Set the per-page record count for Source::stream_pages.
Pass 0 to opt out of within-object chunking — every emitted
StreamPage corresponds to exactly one
S3 object.
Sourcepub fn verify_length(self, verify: bool) -> Self
pub fn verify_length(self, verify: bool) -> Self
Enable or disable the per-object Content-Length verification
(default true). See verify_length.
Sourcepub fn verify_checksum(self, verify: bool) -> Self
pub fn verify_checksum(self, verify: bool) -> Self
Enable or disable per-object checksum verification (default false).
See verify_checksum.
Sourcepub fn compression(self, c: CompressionConfig) -> Self
Available on crate feature compression only.
pub fn compression(self, c: CompressionConfig) -> Self
compression only.Set the compression codec. Available only with the compression feature.
Trait Implementations§
Source§impl Clone for S3SourceConfig
impl Clone for S3SourceConfig
Source§fn clone(&self) -> S3SourceConfig
fn clone(&self) -> S3SourceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for S3SourceConfig
impl Debug for S3SourceConfig
Source§impl<'de> Deserialize<'de> for S3SourceConfig
impl<'de> Deserialize<'de> for S3SourceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for S3SourceConfig
impl JsonSchema for S3SourceConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for S3SourceConfig
impl RefUnwindSafe for S3SourceConfig
impl Send for S3SourceConfig
impl Sync for S3SourceConfig
impl Unpin for S3SourceConfig
impl UnsafeUnpin for S3SourceConfig
impl UnwindSafe for S3SourceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more