Package io.datareplication.producer.snapshot

The snapshot producer creates snapshot pages and the matching snapshot index from a stream of entities and saves them in user-provided repositories.

Usage

The main interface is SnapshotProducer. To create an instance of it, you need to provide your own implementations of the following interfaces: Then call SnapshotProducer.produce(java.util.concurrent.Flow.Publisher) with a Flow.Publisher of entities to create a snapshot.

Repository Implementations

The snapshot producer itself only needs write access to its repositories: it generates pages and an index and hands them to the repository. The repository interfaces only define write access because the producer never needs to read the pages. This allows the repository implementation a lot of flexibility because it only to consider the needs of its own HTTP server when deciding how to save pages.