@Test public void createEventStorageEngine() throws ExecutionException, InterruptedException { EventStorageEngine snapshotStorageEngine = testSubject.createSnapshotStorageEngine( "DEMO2"); snapshotStorageEngine.init(false); EventStorageEngine storageEngine = testSubject.createEventStorageEngine( "DEMO2"); storageEngine.init(false); List<CompletableFuture<Long>> futures = IntStream.range(0, 100) .mapToObj(index -> storageEngine .store(Collections.singletonList(newEvent("EVENT_AGGREGATE" + index, 0)))) .collect(Collectors.toList()); CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).get(); storageEngine.close(false); EventStorageEngine storageEngine2 = testSubject.createEventStorageEngine( "DEMO2"); storageEngine2.init(true); assertEquals(0, (long) storageEngine2.getLastSequenceNumber("EVENT_AGGREGATE0").orElse(-1L)); storageEngine2.close(true); snapshotStorageEngine.close(true); }
@Override public EventStorageEngine createEventStorageEngine(String context) { StandardIndexManager indexManager = new StandardIndexManager(context, embeddedDBProperties.getEvent(), EventType.EVENT, meterFactory); InputStreamEventStore second = new InputStreamEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), meterFactory); return new PrimaryEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), second, meterFactory); }
StandardEventStoreFactory implements EventStoreFactory { @Override public EventStorageEngine createEventStorageEngine(String context) { StandardIndexManager indexManager = new StandardIndexManager(context, embeddedDBProperties.getEvent(), EventType.EVENT, meterFactory); InputStreamEventStore second = new InputStreamEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), meterFactory); return new PrimaryEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), second, meterFactory); } }
StandardEventStoreFactory implements EventStoreFactory { @Override public EventStorageEngine createEventStorageEngine(String context) { StandardIndexManager indexManager = new StandardIndexManager(context, embeddedDBProperties.getEvent(), EventType.EVENT, meterFactory); InputStreamEventStore second = new InputStreamEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), meterFactory); return new PrimaryEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), second, meterFactory); } StandardEventStoreFactory(EmbeddedDBProperties embeddedDBProperties,
                                     EventTransformerFactory eventTransformerFactory,
                                     StorageTransactionManagerFactory storageTransactionManagerFactory,
                                     MeterFactory meterFactory); }
StandardEventStoreFactory implements EventStoreFactory { @Override public EventStorageEngine createEventStorageEngine(String context) { StandardIndexManager indexManager = new StandardIndexManager(context, embeddedDBProperties.getEvent(), EventType.EVENT, meterFactory); InputStreamEventStore second = new InputStreamEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), meterFactory); return new PrimaryEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), second, meterFactory); } StandardEventStoreFactory(EmbeddedDBProperties embeddedDBProperties,
                                     EventTransformerFactory eventTransformerFactory,
                                     StorageTransactionManagerFactory storageTransactionManagerFactory,
                                     MeterFactory meterFactory); @Override EventStorageEngine createEventStorageEngine(String context); @Override EventStorageEngine createSnapshotStorageEngine(String context); }
StandardEventStoreFactory implements EventStoreFactory { @Override public EventStorageEngine createEventStorageEngine(String context) { StandardIndexManager indexManager = new StandardIndexManager(context, embeddedDBProperties.getEvent(), EventType.EVENT, meterFactory); InputStreamEventStore second = new InputStreamEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), meterFactory); return new PrimaryEventStore(new EventTypeContext(context, EventType.EVENT), indexManager, eventTransformerFactory, embeddedDBProperties.getEvent(), second, meterFactory); } StandardEventStoreFactory(EmbeddedDBProperties embeddedDBProperties,
                                     EventTransformerFactory eventTransformerFactory,
                                     StorageTransactionManagerFactory storageTransactionManagerFactory,
                                     MeterFactory meterFactory); @Override EventStorageEngine createEventStorageEngine(String context); @Override EventStorageEngine createSnapshotStorageEngine(String context);  }