On Fri, 20 Jul 2001 11:37:42 EDT, Berin Loritsch wrote:

>I know we talked about a CVS freeze earlier this week (or was that last week?)
>.  Is the current CVS ready for a release at this time?  I think the last
>issues were MRUMemmoryStore bug fixes.

Hello all,

It looks like there's still a bit of a problem with the MRUMemoryStore.
It's only happening if the fs store is used.

The reading and writing of cached files are looking in different places.
Basically, the calls to fsstore.get() and fsstore.store() are using
different parameters.  The call to fsstore.store() is adding in
the cachedir path and the call to fsstore.get() isn't.

I've attached a Q&D patch to this and it works ...

BUT I've also noticed that the cache keys are used by other methods
such as remove().  

This patch is assuming that the key and the file on the filesystem are in fact
the same thing.  Is that the intent?  The keys now being passed to the store()
and get() methods look like this:

  cache-dir-prefix/PCK%3ACCK%3A3-html-1PCK%3...

rather than just

  PCK%3ACCK%3A3-html-1PCK%3...
 
Other methods would not be getting the cache-dir-prefix/ .  Are the
cache keys intended to look like filesystem-like things? Or are
the keys supposed to be some abstraction of that?

Anyway, here's the quick & dirty patch that'll get the fs store working.


Index: src/org/apache/cocoon/components/store/MRUMemoryStore.java
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 MRUMemoryStore.java
--- src/org/apache/cocoon/components/store/MRUMemoryStore.java  2001/07/20 10:27:57    
 1.2.2.5
+++ src/org/apache/cocoon/components/store/MRUMemoryStore.java  2001/07/20 16:43:46
@@ -232,7 +232,7 @@
             tmpstackobject = (TmpStackObject)this.writerstack.pop();
             key = tmpstackobject.getKey();
             object = tmpstackobject.getObject();
-            this.fsstore.store(this.cachedirstr + "/" + 
URLEncoder.encode(key.toString()),object);
+            this.fsstore.store(this.cachedirstr + File.separator + 
+URLEncoder.encode(key.toString()),object);
             key = null;
             object = null;
             tmpstackobject = null;
@@ -316,8 +316,9 @@
       getLogger().debug("MRUMemoryStore object not found in memory");
       /** try to fetch from filesystem */
       if(this.filesystem) {
-        tmpobject = this.fsstore.get(URLEncoder.encode(key.toString()));
+        tmpobject = this.fsstore.get(this.cachedirstr + File.separator + 
+URLEncoder.encode(key.toString()));
         if (tmpobject == null) {
+         getLogger().debug( "MRUMemoryStore did NOT find object on fs.  Looked for: " 
++ URLEncoder.encode(key.toString()) );
           return null;
         } else {
           getLogger().debug("MRUMemoryStore found object on fs");
@@ -449,4 +450,4 @@
       return this.object;
     }
   }
-}
\ No newline at end of file
+}
Rick Tessner    [EMAIL PROTECTED]
MYRA Systems Corp. Fone: (250) 381 1335 x125  Phax: (250) 381 1304
                   Cell: (250) 885 9452

"Time grabs you by the wrist, directs you where to go.
 So make the best of this test and don't ask why.'

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to