On Thu, Aug 25, 2011 at 12:00 PM, Caleb James DeLisle
<calebdelisle(a)lavabit.com> wrote:
In order to fix a problem with the cache, I would
like to add a pointer type to the storage api.
The problem with the cache is there are multiple names which, when asked of the
persistent store,
return the same document. There is no effective way to know what all names which will
return that
document. When a document is modified, it is removed from the cache but the only version
removed is it's
"real" name. All of the other names for it linger in the cache eating up memory
and threatening to
provide someone stale data.
Instead of caching the document, we could cache a pointer to the document and when it
became stale,
the pointer could be set to null and then any other name under which that document was
cached would look
up a null pointer and the cache logic could remove it.
I would like to add it to xwiki-platform-store-api module and it will look roughly like
this:
package org.xwiki.store;
public final class Pointer<T>
{
/** The thing which this pointer points to. */
public T target;
}
WDYT?
Why is there several cache keys for the same document ? Can't we make
sure a same document always use the same key ?
When you get a document and put it in the cache, you can put it under it's canonical
key which might,
for instance, be xwiki:Main.WebHome:en but most of the requests for that document will go
to
xwiki:Main.WebHome (which returns the same document from the store). If you refuse to
cache under
any key but the canonical key, you will defeat most of the cache's usefulness.
BTW: This is the issue:
Caleb
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs