Search in sources :

Example 1 with SnapshotStorage

use of io.zeebe.logstreams.spi.SnapshotStorage in project zeebe by zeebe-io.

the class StreamProcessorService method start.

@Override
public void start(ServiceStartContext ctx) {
    final LogStream logStream = logStreamInjector.getValue();
    final SnapshotStorage snapshotStorage = snapshotStorageInjector.getValue();
    final ActorScheduler actorScheduler = ctx.getScheduler();
    MetadataFilter metadataFilter = versionFilter;
    if (customEventFilter != null) {
        metadataFilter = metadataFilter.and(customEventFilter);
    }
    final EventFilter eventFilter = new MetadataEventFilter(metadataFilter);
    streamProcessorController = LogStreams.createStreamProcessor(name, id, streamProcessor).logStream(logStream).snapshotStorage(snapshotStorage).snapshotPeriod(Duration.ofMinutes(15)).actorScheduler(actorScheduler).eventFilter(eventFilter).readOnly(readOnly).build();
    ctx.async(streamProcessorController.openAsync());
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) SnapshotStorage(io.zeebe.logstreams.spi.SnapshotStorage) LogStream(io.zeebe.logstreams.log.LogStream)

Aggregations

LogStream (io.zeebe.logstreams.log.LogStream)1 SnapshotStorage (io.zeebe.logstreams.spi.SnapshotStorage)1 ActorScheduler (io.zeebe.util.sched.ActorScheduler)1