use of io.spine.server.storage.EventRecordStorage in project core-java by SpineEventEngine.
the class EventStorage method createStorage.
@Override
protected EventRecordStorage createStorage(StorageFactory factory) {
final RecordStorage<EventId> recordStorage = super.createStorage(factory);
final EventRecordStorage storage = factory.createEventStorage(recordStorage);
return storage;
}
use of io.spine.server.storage.EventRecordStorage in project core-java by SpineEventEngine.
the class EventStorage method iterator.
Iterator<Event> iterator(EventStreamQuery query) {
final EventRecordStorage storage = recordStorage();
final Map<EventId, EntityRecord> records = storage.readAll(query);
final Collection<EventEntity> entities = transform(records.entrySet(), storageRecordToEntity());
// TODO:2017-05-19:dmytro.dashenkov: Remove after the Entity Column approach is implemented.
final Collection<EventEntity> filtered = filter(entities, createEntityFilter(query));
final List<EventEntity> entityList = newArrayList(filtered);
Collections.sort(entityList, EventEntity.comparator());
final Iterator<Event> result = Iterators.transform(entityList.iterator(), getEventFunc());
return result;
}
Aggregations