GitHub

EventLogRemoteCompaction

API reference for EventLogRemoteCompaction.

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]
ParameterTypeDescription
identityIdentityService
store_idStoreId

Returns Effect[CompactionStatus, EventLogRemoteError]

def status(
    self, *, identity: IdentityService, store_id: StoreId
) -> Effect[CompactionStatus, EventLogRemoteError]: ...

begin

begin(*, identity, store_id) -> Effect[CompactionBeginResult, EventLogRemoteError]
ParameterTypeDescription
identityIdentityService
store_idStoreId

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.

ParameterTypeDescription
stageCompactionStage

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.

ParameterTypeDescription
stageCompactionStage
sequencesSequence[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.

ParameterTypeDescription
stageCompactionStage
entriesSequence[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]
ParameterTypeDescription
stageCompactionStage
resultCompactionResult

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.

ParameterTypeDescription
stageCompactionStage

Returns Effect[None]

def abort(self, stage: CompactionStage, /) -> Effect[None]:
    """Release the stage, ignoring failures."""
    ...