pub struct RedisSourceConfig {
pub url: String,
pub source_type: RedisSourceType,
pub max_records: Option<usize>,
pub batch_size: usize,
}Expand description
Configuration for the Redis source connector.
Fields§
§url: StringRedis connection URL (e.g. "redis://127.0.0.1:6379").
source_type: RedisSourceTypeThe type of Redis data structure to read from.
max_records: Option<usize>Optional maximum number of records to return.
batch_size: usizeRecords per emitted StreamPage. Each mode
maps the knob onto its native paging primitive:
Keys:SCAN COUNT batch_sizehint, followed by anMGETbatched tobatch_sizerecords per page.Stream:XRANGE - + COUNT batch_size, advancing the start ID per page.List:LRANGE start stop, sliding the window bybatch_size.
Defaults to DEFAULT_BATCH_SIZE.
batch_size = 0 is the “no batching” sentinel: every mode drains its
underlying primitive in a single round-trip (or, for Keys, the
minimum number of round-trips the SCAN cursor needs) and emits the
entire result set as a single page. Useful for small lookup tables or
for sinks like SQL COPY / BigQuery load jobs that prefer one large
request to many small ones.
Implementations§
Source§impl RedisSourceConfig
impl RedisSourceConfig
Sourcepub fn new(url: impl Into<String>, source_type: RedisSourceType) -> Self
pub fn new(url: impl Into<String>, source_type: RedisSourceType) -> Self
Create a new config with the given URL and source type.
Sourcepub fn max_records(self, max: usize) -> Self
pub fn max_records(self, max: usize) -> Self
Set the maximum number of records to return.
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 batching — the entire result set is emitted in
a single StreamPage.
Trait Implementations§
Source§impl Clone for RedisSourceConfig
impl Clone for RedisSourceConfig
Source§fn clone(&self) -> RedisSourceConfig
fn clone(&self) -> RedisSourceConfig
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 RedisSourceConfig
impl Debug for RedisSourceConfig
Source§impl<'de> Deserialize<'de> for RedisSourceConfig
impl<'de> Deserialize<'de> for RedisSourceConfig
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 RedisSourceConfig
impl JsonSchema for RedisSourceConfig
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 more