Client side of encrypted remote compaction. A run opens a stage with
begin, reads its input headers with input, fetches the batches
it needs with fetch, uploads the kept entries with upload and
calls commit; abort releases a stage that will not be
committed.
Functions#
status#
status(*, identity, store_id) -> Effect[CompactionStatus, EventLogRemoteError]| Parameter | Type | Description |
|---|---|---|
identity | IdentityService | |
store_id | StoreId |
Returns Effect[CompactionStatus, EventLogRemoteError]
def status(
self, *, identity: IdentityService, store_id: StoreId
) -> Effect[CompactionStatus, EventLogRemoteError]: ...begin#
begin(*, identity, store_id) -> Effect[CompactionBeginResult, EventLogRemoteError]| Parameter | Type | Description |
|---|---|---|
identity | IdentityService | |
store_id | StoreId |
Returns Effect[CompactionBeginResult, EventLogRemoteError]
def begin(
self, *, identity: IdentityService, store_id: StoreId
) -> Effect[CompactionBeginResult, EventLogRemoteError]: ...input#
input(stage) -> Stream[CompactionInputHeader, EventLogRemoteError]The stage's input batch headers, in input order.
| Parameter | Type | Description |
|---|---|---|
stage | CompactionStage |
Returns Stream[CompactionInputHeader, EventLogRemoteError]
def input(
self, stage: CompactionStage, /
) -> Stream[CompactionInputHeader, EventLogRemoteError]:
"""The stage's input batch headers, in input order."""
...fetch#
fetch(stage, sequences) -> Stream[RemoteEntry, EventLogRemoteError]The input batches at sequences, decrypted.
| Parameter | Type | Description |
|---|---|---|
stage | CompactionStage | |
sequences | Sequence[int] |
Returns Stream[RemoteEntry, EventLogRemoteError]
def fetch(
self, stage: CompactionStage, sequences: Sequence[int], /
) -> Stream[RemoteEntry, EventLogRemoteError]:
"""The input batches at ``sequences``, decrypted."""
...upload#
upload(stage, entries) -> Effect[int, EventLogRemoteError]Encrypt the kept entries (in input-sequence order) and upload
them in segments of about ChunkedMessage.chunk_size, succeeding
with the segment count. An oversized segment is split into pieces,
and a segment is resent in full after a dropped connection.
| Parameter | Type | Description |
|---|---|---|
stage | CompactionStage | |
entries | Sequence[Entry] |
Returns Effect[int, EventLogRemoteError]
def upload(
self, stage: CompactionStage, entries: Sequence[Entry], /
) -> Effect[int, EventLogRemoteError]:
"""Encrypt the kept ``entries`` (in input-sequence order) and upload
them in segments of about ``ChunkedMessage.chunk_size``, succeeding
with the segment count. An oversized segment is split into pieces,
and a segment is resent in full after a dropped connection."""
...commit#
commit(stage, result) -> Effect[Literal['Committed', 'Superseded'], EventLogRemoteError]| Parameter | Type | Description |
|---|---|---|
stage | CompactionStage | |
result | CompactionResult |
Returns Effect[Literal['Committed', 'Superseded'], EventLogRemoteError]
def commit(
self, stage: CompactionStage, result: CompactionResult, /
) -> Effect[Literal["Committed", "Superseded"], EventLogRemoteError]: ...abort#
abort(stage) -> Effect[None]Release the stage, ignoring failures.
| Parameter | Type | Description |
|---|---|---|
stage | CompactionStage |
Returns Effect[None]
def abort(self, stage: CompactionStage, /) -> Effect[None]:
"""Release the stage, ignoring failures."""
...