pub trait WritePlugin: Send + Sync {
// Required method
fn prepare_insert(
&self,
quads: &[Quad],
commit_ts: CommitTs,
op: StorageOp,
) -> Result<PreparedInsert, ComputeError>;
}Expand description
Write-path hook (runs on ingest and offline import alike).
Required Methods§
Sourcefn prepare_insert(
&self,
quads: &[Quad],
commit_ts: CommitTs,
op: StorageOp,
) -> Result<PreparedInsert, ComputeError>
fn prepare_insert( &self, quads: &[Quad], commit_ts: CommitTs, op: StorageOp, ) -> Result<PreparedInsert, ComputeError>
Prepare one batch. commit_ts is the batch’s assigned timestamp; the
plugin stamps postings with it. op distinguishes a put from a delete:
a plugin may rewrite both to the same native term key, while only puts
contribute index postings. Must be pure (no I/O, no storage). Term
rewrites are sparse (PreparedInsert::object_rewrites) so several
write plugins compose over one plain encoding.