swh.journal.writer.stream module

class swh.journal.writer.stream.StreamJournalWriter(output_stream: BinaryIO, value_sanitizer: Callable[[str, Dict[str, Any]], Dict[str, Any]])[source]

Bases: Generic[swh.journal.writer.stream.TValue]

A simple JournalWriter which serializes objects in a stream

Might be used to serialize a storage in a file to generate a test dataset.

write_addition(object_type: str, object_: swh.journal.writer.stream.TValue, privileged: bool = False) None[source]
write_update(object_type: str, object_: swh.journal.writer.stream.TValue, privileged: bool = False) None
write_additions(object_type: str, objects: List[swh.journal.writer.stream.TValue], privileged: bool = False) None[source]