On Thu, Oct 1, 2009 at 12:24 PM, Rickard Öberg <[email protected]> wrote:
> Niclas,
>
> I'm doing backup/restore functionality in StreamFlow now, and am realizing
> that the reindexing service is not really enough. What it does is to go
> through the EntityStore and reindex all the entities. But it should also
> remove any entities in the index which are no longer in the EntityStore. So,
> we would need a way to tell the index to reset itself to basically nothing.
>
> We need an EntityIndexer interface where we could put such a method in, I
> think. Otherwise there's a big risk that the index will contain data that is
> stale (I have already had to add a fix to EntityQuery for this case;
> otherwise it breaks badly when the entity no longer exists).

Well, I think that there might be an additional issue; Since the
reindexing happens through the StateChangeListener interface,
shouldn't we "inform" the listeners that "all data is about to repeat
itself" (as there will be events coming that are NOT state changes),
and by doing so letting the Indexer trigger the "reset of store" on
such 'event'...

If we go with a EntityIndexer interface, then I would suggest that the
normal indexing happens via methods in such interface. So, some
'intermediary' StateChangeListener forwards the indexing events to the
EntityIndexer implementation. This could be the opportunity to place
the intermediary on a thread boundary, allowing the indexer full
asynchronicity at the same time.


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to