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 isSnapshotProducer
. To create an instance of it,
you need to provide your own implementations of the following interfaces:
SnapshotPageUrlBuilder
to build the public HTTP URLs for pagesSnapshotPageRepository
to save generated pagesSnapshotIndexRepository
to save the snapshot index
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.-
Interface Summary Interface Description SnapshotIndexRepository Repository to store aSnapshotIndex
created by the snapshot consumer.SnapshotPageRepository Repository to store snapshot pages produced bySnapshotProducer
.SnapshotPageUrlBuilder An interface to build an HTTP url for a specific snapshot page.SnapshotProducer ASnapshotProducer
produces a snapshot index, which consists of a list of pages which contain all entities. -
Class Summary Class Description SnapshotProducer.Builder A builder forSnapshotProducer
.