pub struct SpannerSourceConfig {
pub connection: SpannerConnection,
pub query: String,
pub params: HashMap<String, Value>,
pub batch_size: usize,
pub exact_staleness_secs: Option<u64>,
pub replication: SpannerReplication,
pub state_key: Option<String>,
pub shard: Option<ShardConfig>,
}Expand description
Configuration for SpannerSource.
Fields§
§connection: SpannerConnectionConnection settings (project_id / instance / database / auth /
max_sessions / emulator_host), flattened.
query: StringGoogleSQL query to run. Use named parameters (@name) for
params, and the named parameter @bookmark to bind
the incremental cursor server-side.
params: HashMap<String, Value>Named bind parameters for the query. Values must be scalars (string, integer, float, or boolean) — Spanner parameters are typed, and null/array/object values have no unambiguous parameter type.
batch_size: usizeRecords per emitted StreamPage. 0 emits
the whole result set as a single page. Defaults to
DEFAULT_BATCH_SIZE.
exact_staleness_secs: Option<u64>Read at a timestamp this many seconds in the past instead of a strong read. Stale reads can be served by any replica, offloading the leader — at the cost of missing rows committed within the staleness window.
replication: SpannerReplicationReplication mode. Defaults to SpannerReplication::Full.
state_key: Option<String>Explicit state-store key for the bookmark. When unset, a key is derived from the database path and a query fingerprint.
shard: Option<ShardConfig>Optional primary-key range sharding for clustered (Mode B) execution.
When set, the source advertises itself as shardable: the cluster
coordinator splits the query’s key range into contiguous slices that
different workers process concurrently. Has no effect outside the
cluster coordinator (a plain faucet run streams the whole query).
Implementations§
Source§impl SpannerSourceConfig
impl SpannerSourceConfig
Sourcepub fn new(
project_id: impl Into<String>,
instance: impl Into<String>,
database: impl Into<String>,
query: impl Into<String>,
) -> Self
pub fn new( project_id: impl Into<String>, instance: impl Into<String>, database: impl Into<String>, query: impl Into<String>, ) -> Self
Build a config from connection identifiers and a query, with defaults elsewhere.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate connection, batch size, params, and replication settings.
Trait Implementations§
Source§impl Clone for SpannerSourceConfig
impl Clone for SpannerSourceConfig
Source§fn clone(&self) -> SpannerSourceConfig
fn clone(&self) -> SpannerSourceConfig
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 SpannerSourceConfig
impl Debug for SpannerSourceConfig
Source§impl<'de> Deserialize<'de> for SpannerSourceConfig
impl<'de> Deserialize<'de> for SpannerSourceConfig
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 SpannerSourceConfig
impl JsonSchema for SpannerSourceConfig
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 SpannerSourceConfig
impl RefUnwindSafe for SpannerSourceConfig
impl Send for SpannerSourceConfig
impl Sync for SpannerSourceConfig
impl Unpin for SpannerSourceConfig
impl UnsafeUnpin for SpannerSourceConfig
impl UnwindSafe for SpannerSourceConfig
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> 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