private List<DomainEventMessage> readEventSegmentInternal(String type, Object identifier,
long firstSequenceNumber) {
Query query = EventEntry.forAggregate(type, identifier.toString(), firstSequenceNumber);
PreparedQuery preparedQuery = datastoreService.prepare(query);
List<Entity> entities = preparedQuery.asList(FetchOptions.Builder.withDefaults());
List<DomainEventMessage> events = new ArrayList<DomainEventMessage>(entities.size());
for (Entity entity : entities) {
events.addAll(new EventEntry(entity).getDomainEvent(identifier, eventSerializer, upcasterChain, false));
}