pub struct OpWriter { /* private fields */ }Expand description
Writes a tenant’s disk through workers: one process for each operation.
Implementations§
Source§impl OpWriter
impl OpWriter
Sourcepub fn new(
command: WorkerCommand,
tenant: &Tenant,
key: impl Into<TenantKey>,
) -> OpWriter
pub fn new( command: WorkerCommand, tenant: &Tenant, key: impl Into<TenantKey>, ) -> OpWriter
A writer for one tenant that starts a worker for each call. key holds the write grant on the
tenant’s directory.
Sourcepub fn observed(self, observer: Arc<dyn Observer>) -> OpWriter
pub fn observed(self, observer: Arc<dyn Observer>) -> OpWriter
Reports each of this writer’s operations to observer as it ends, in place of its pool’s observer.
Sourcepub fn with_settings_xml(self, settings_xml: impl Into<String>) -> OpWriter
pub fn with_settings_xml(self, settings_xml: impl Into<String>) -> OpWriter
Server settings every operation runs under, as the XML a stock writer boots with.
Sourcepub fn with_memory_limit(self, bytes: u64) -> OpWriter
pub fn with_memory_limit(self, bytes: u64) -> OpWriter
Caps the memory each operation’s worker may allocate, on top of the settings document. An operation that
would pass the cap fails with ClickHouse’s MEMORY_LIMIT_EXCEEDED (code 241) before its commit.
Sourcepub fn with_deadline(self, deadline: Duration) -> OpWriter
pub fn with_deadline(self, deadline: Duration) -> OpWriter
How long an operation may run, from the moment its request goes out, before its worker is killed.
Sourcepub fn at_least_once(self) -> OpWriter
pub fn at_least_once(self) -> OpWriter
Lets this writer insert into a table, or a view’s target, that keeps no deduplication tokens, where a retried batch lands twice. Without it a worker refuses such an insert.
Sourcepub fn usage(&self) -> Usage
pub fn usage(&self) -> Usage
What this writer’s workers have spent so far, over every operation a worker answered.
Sourcepub async fn describe(&self, parts: bool) -> Result<Described, Error>
pub async fn describe(&self, parts: bool) -> Result<Described, Error>
The tenant’s catalog as the worker’s engine sees it, with each table’s parts when parts is set.
Hands the tenant’s disk to shared writers once its exclusive writer has stopped: a worker replaces the exclusive writer’s owner with a shared one, which fences that writer.
From an exclusive writer’s start until this call, every other operation of the tenant leaves the owner in
place and ends Fenced, so no operation interrupts the tenant’s DDL or mutation. On a
disk that is shared already the call writes nothing.
Trait Implementations§
Source§impl Writer for OpWriter
impl Writer for OpWriter
Source§async fn insert(&self, insert: Insert<'_>) -> Result<Outcome<Inserted>, Error>
async fn insert(&self, insert: Insert<'_>) -> Result<Outcome<Inserted>, Error>
Source§async fn plan(
&self,
table: &TableName,
budget: &Budget,
) -> Result<Vec<PlannedMerge>, Error>
async fn plan( &self, table: &TableName, budget: &Budget, ) -> Result<Vec<PlannedMerge>, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for OpWriter
impl !UnwindSafe for OpWriter
impl Forget for OpWriter
impl Freeze for OpWriter
impl Move for OpWriter
impl Send for OpWriter
impl Sync for OpWriter
impl Unpin for OpWriter
impl UnsafeUnpin for OpWriter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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