Esempio n. 1
0
 /**
  * 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);
   }
 }
Esempio n. 2
0
 @Override
 public void onNewEvent(long eventId, EventSerializer ed, Object event) {
   eventIndexing.onNewEvent(eventId, ed, event);
   eventFieldIndexing.onNewEvent(eventId, ed, event);
 }
Esempio n. 3
0
 /**
  * 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();
 }