/** * Read all indexes that for the given event type that match the given constraint from the given * typed event repo This method will attempt to find the best possible way of retrieving index * data given the indexes that exists in this {@link Indexing} * * @param eventTypeId {@link Long} event type id * @param constraint {@link FieldConstraint} * @param typedEventRepo {@link TypedEventRepo} where event data can be read from * @return */ public Iterable<EventId> readIndicies( EventTypeId eventTypeId, FieldConstraint constraint, TypedEventRepo typedEventRepo) { if (constraint.hasConstraint()) { EventFieldId eventFieldId = new EventFieldId(eventTypeId, constraint.getFieldName()); if (eventFieldIndexing.isIndexing(eventFieldId)) { return eventFieldIndexing.getIterable(eventFieldId, constraint); } else { return new FallbackFilteringEventIdIterable( eventIndexing.getIndexEntryIterable(eventTypeId), constraint, typedEventRepo); } } else { return eventIndexing.getIndexEntryIterable(eventTypeId); } }
@Override public void onNewEvent(long eventId, EventSerializer ed, Object event) { eventIndexing.onNewEvent(eventId, ed, event); eventFieldIndexing.onNewEvent(eventId, ed, event); }
public EventRepoReport report() { EventRepoReport report = new EventRepoReport().appendLine(Indexing.class.getSimpleName()); report.appendReport("EventIndexing", eventIndexing.report()); report.appendLine("IndexUpdater: " + indexUpdater.getClass().getSimpleName()); return report; }
/** * Stops this {@link Indexing} and closes all associated files. This indexing is no longer usable * after this method has been called. */ public void stop() { eventIndexing.stop(); eventFieldIndexing.stop(); indexUpdater.stop(); }