Struct mz_stash::postgres::Consolidator
source · struct Consolidator {
config: Arc<Mutex<Config>>,
tls: MakeTlsConnector,
schema: Option<String>,
sinces_rx: UnboundedReceiver<ConsolidateRequest>,
consolidations: BTreeMap<i64, (Antichain<Timestamp>, Vec<Sender<()>>)>,
client: Option<Client>,
reconnect: Interval,
stmt_candidates: Option<Statement>,
stmt_insert: Option<Statement>,
stmt_delete: Option<Statement>,
}
Expand description
The Consolidator receives since advancements on a channel and transactionally consolidates them. These can safely be done at a later time in a separate connection that doesn’t do leader or epoch checking because 1) having data that needs to be consolidated is not a correctness error and 2) the operations here are idempotent (can safely be run concurrently with a second stash).
Fields§
§config: Arc<Mutex<Config>>
§tls: MakeTlsConnector
§schema: Option<String>
§sinces_rx: UnboundedReceiver<ConsolidateRequest>
§consolidations: BTreeMap<i64, (Antichain<Timestamp>, Vec<Sender<()>>)>
§client: Option<Client>
§reconnect: Interval
§stmt_candidates: Option<Statement>
§stmt_insert: Option<Statement>
§stmt_delete: Option<Statement>
Implementations§
source§impl Consolidator
impl Consolidator
fn start( config: Arc<Mutex<Config>>, schema: Option<String>, tls: MakeTlsConnector, sinces_rx: UnboundedReceiver<ConsolidateRequest> )
fn spawn(self)
fn insert(&mut self, req: ConsolidateRequest)
async fn consolidate( &mut self, id: i64, since: &Antichain<Timestamp>, attempt: u64 ) -> Result<(), StashError>
async fn connect(&mut self) -> Result<(), StashError>
Auto Trait Implementations§
impl !RefUnwindSafe for Consolidator
impl Send for Consolidator
impl Sync for Consolidator
impl Unpin for Consolidator
impl !UnwindSafe for Consolidator
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<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
.