Struct mz_adapter::catalog::Source
source · pub struct Source {
pub create_sql: String,
pub data_source: DataSourceDesc,
pub desc: RelationDesc,
pub timeline: Timeline,
pub resolved_ids: ResolvedIds,
pub custom_logical_compaction_window: Option<Duration>,
pub is_retained_metrics_object: bool,
}
Fields§
§create_sql: String
§data_source: DataSourceDesc
§desc: RelationDesc
§timeline: Timeline
§resolved_ids: ResolvedIds
§custom_logical_compaction_window: Option<Duration>
§is_retained_metrics_object: bool
Whether the source’s logical compaction window is controlled by METRICS_RETENTION
Implementations§
source§impl Source
impl Source
sourcepub fn new(
id: GlobalId,
plan: CreateSourcePlan,
cluster_id: Option<StorageInstanceId>,
resolved_ids: ResolvedIds,
custom_logical_compaction_window: Option<Duration>,
is_retained_metrics_object: bool
) -> Source
pub fn new( id: GlobalId, plan: CreateSourcePlan, cluster_id: Option<StorageInstanceId>, resolved_ids: ResolvedIds, custom_logical_compaction_window: Option<Duration>, is_retained_metrics_object: bool ) -> Source
Creates a new Source
.
Panics
- If an ingestion-based plan is not given a cluster_id.
- If a non-ingestion-based source has a defined cluster config in its plan.
- If a non-ingestion-based source is given a cluster_id.
sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Returns whether this source ingests data from an external source.
sourcepub fn source_type(&self) -> &str
pub fn source_type(&self) -> &str
Type of the source.
sourcepub fn connection_id(&self) -> Option<GlobalId>
pub fn connection_id(&self) -> Option<GlobalId>
Connection ID of the source, if one exists.
sourcepub fn user_controllable_persist_shard_count(&self) -> i64
pub fn user_controllable_persist_shard_count(&self) -> i64
The expensive resource that each source consumes is persist shards. To prevent abuse, we want to prevent users from creating sources that use an unbounded number of persist shards. But we also don’t want to count persist shards that are mandated by teh system (e.g., the progress shard) so that future versions of Materialize can introduce additional per-source shards (e.g., a per-source status shard) without impacting the limit calculation.
Trait Implementations§
source§impl Serialize for Source
impl Serialize for Source
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> PreferredContainer for Twhere
T: Clone,
impl<T> PreferredContainer for Twhere T: Clone,
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
See
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
See
RustType::into_proto
.