pub struct GcsSourceConfig {
pub bucket: String,
pub prefix: Option<String>,
pub object_keys: Option<Vec<String>>,
pub auth: GcsCredentials,
pub file_format: GcsFileFormat,
pub max_objects: Option<usize>,
pub concurrency: usize,
pub batch_size: usize,
pub verify_length: bool,
pub verify_checksum: bool,
pub storage_host: Option<String>,
pub compression: CompressionConfig,
}Expand description
Configuration for the GCS source connector.
Fields§
§bucket: StringGCS bucket name.
prefix: Option<String>Object name prefix filter. Ignored when object_keys is set.
object_keys: Option<Vec<String>>Explicit object names. When set, listing is skipped and prefix
is ignored.
auth: GcsCredentialsCredential source.
file_format: GcsFileFormatFile format.
max_objects: Option<usize>Hard cap on the number of objects read (after listing).
concurrency: usizeMaximum concurrent object reads (default: 10).
batch_size: usizeRecords per emitted StreamPage. See “Streaming and batching”
in the README. batch_size = 0 is the “no batching” sentinel and
emits one page per object.
verify_length: boolVerify each object’s byte length against the size GCS reports for it,
failing the read with FaucetError::Source
on a short (truncated) or over-long transfer (#161). Cheap (a byte
counter over the body that is read anyway) and defaults to true.
The check is automatically skipped for an object served with a
non-empty Content-Encoding (GCS may decompressively transcode it on
read, so the received byte count would not match the stored size).
verify_checksum: boolVerify each object’s body against the CRC32C (or MD5) checksum GCS
reports for it (#161). Stronger than the length check but costs a hash
over the full body, so it defaults to false. Skipped for an object
with no usable checksum or one served with a non-empty
Content-Encoding (the stored checksum covers the stored bytes, which
transcoding would not return).
storage_host: Option<String>Optional storage-host override (e.g. http://localhost:4443 for
fake-gcs-server). Production users should leave this unset.
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 GcsSourceConfig
impl GcsSourceConfig
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.
pub fn prefix(self, prefix: impl Into<String>) -> Self
pub fn object_keys(self, keys: Vec<String>) -> Self
pub fn auth(self, creds: GcsCredentials) -> Self
pub fn file_format(self, format: GcsFileFormat) -> Self
pub fn max_objects(self, max: usize) -> Self
pub fn concurrency(self, concurrency: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
pub fn storage_host(self, host: impl Into<String>) -> Self
Sourcepub fn verify_length(self, verify: bool) -> Self
pub fn verify_length(self, verify: bool) -> Self
Enable or disable the per-object 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 GcsSourceConfig
impl Clone for GcsSourceConfig
Source§fn clone(&self) -> GcsSourceConfig
fn clone(&self) -> GcsSourceConfig
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 GcsSourceConfig
impl Debug for GcsSourceConfig
Source§impl<'de> Deserialize<'de> for GcsSourceConfig
impl<'de> Deserialize<'de> for GcsSourceConfig
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 GcsSourceConfig
impl JsonSchema for GcsSourceConfig
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 GcsSourceConfig
impl RefUnwindSafe for GcsSourceConfig
impl Send for GcsSourceConfig
impl Sync for GcsSourceConfig
impl Unpin for GcsSourceConfig
impl UnsafeUnpin for GcsSourceConfig
impl UnwindSafe for GcsSourceConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request