Interface CurrentEventsBySliceStartingFromSnapshotsQuery

  • All Superinterfaces:
    ReadJournal

    public interface CurrentEventsBySliceStartingFromSnapshotsQuery
    extends ReadJournal
    A plugin may optionally support this query by implementing this trait.

    API May Change

    • Method Detail

      • currentEventsBySlicesStartingFromSnapshots

        <Snapshot,​Event> Source<EventEnvelope<Event>,​NotUsed> currentEventsBySlicesStartingFromSnapshots​(java.lang.String entityType,
                                                                                                                     int minSlice,
                                                                                                                     int maxSlice,
                                                                                                                     Offset offset,
                                                                                                                     java.util.function.Function<Snapshot,​Event> transformSnapshot)
        Same as EventsBySliceStartingFromSnapshotsQuery but with the purpose to use snapshots as starting points and thereby reducing number of events that have to be loaded. This can be useful if the consumer start from zero without any previously processed offset or if it has been disconnected for a long while and its offset is far behind.

        Same type of query as EventsBySliceStartingFromSnapshotsQuery.eventsBySlicesStartingFromSnapshots but the event stream is completed immediately when it reaches the end of the "result set".

      • sliceForPersistenceId

        int sliceForPersistenceId​(java.lang.String persistenceId)
      • sliceRanges

        java.util.List<Pair<java.lang.Integer,​java.lang.Integer>> sliceRanges​(int numberOfRanges)