ALF-9613: caching content store. Various improvements and bug fixes. Including:

ALF-10097: disk-persistent cache settings in ehcache
ALF-10098: clean up  process should remove empty parent directories from content cache disk directory
ALF-10126: timeToIdle ehcache property was not affecting cache cleaner job
ALF-10127: externally deleted cached content files were not re-cached until after the items expired from ehcache

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30171 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-09-02 09:03:49 +00:00
parent 1b2e8c53ec
commit ac8b3ce1fc
11 changed files with 409 additions and 71 deletions

View File

@@ -59,7 +59,7 @@ public class SlowContentStoreTest
TimedStoreReader storeReader = new TimedStoreReader();
storeReader.execute();
assertTrue("First read should take a while", storeReader.timeTakenMillis() > 1000);
logger.info(String.format("First read took %ds", storeReader.timeTakenMillis()));
logger.debug(String.format("First read took %ds", storeReader.timeTakenMillis()));
// The content came from the slow backing store...
assertEquals("This is the content for my slow ReadableByteChannel", storeReader.content);
@@ -69,7 +69,7 @@ public class SlowContentStoreTest
storeReader = new TimedStoreReader();
storeReader.execute();
assertTrue("Subsequent reads should be fast", storeReader.timeTakenMillis() < 100);
logger.info(String.format("Cache read took %ds", storeReader.timeTakenMillis()));
logger.debug(String.format("Cache read took %ds", storeReader.timeTakenMillis()));
// The content came from the slow backing store, but was cached...
assertEquals("This is the content for my slow ReadableByteChannel", storeReader.content);
}
@@ -89,7 +89,7 @@ public class SlowContentStoreTest
TimedStoreReader storeReader = new TimedStoreReader();
storeReader.execute();
assertTrue("First read should be fast", storeReader.timeTakenMillis() < 100);
logger.info(String.format("First read took %ds", storeReader.timeTakenMillis()));
logger.debug(String.format("First read took %ds", storeReader.timeTakenMillis()));
assertEquals("Content written from " + getClass().getSimpleName(), storeReader.content);
// Subsequent reads will also hit the cache
@@ -98,7 +98,7 @@ public class SlowContentStoreTest
storeReader = new TimedStoreReader();
storeReader.execute();
assertTrue("Subsequent reads should be fast", storeReader.timeTakenMillis() < 100);
logger.info(String.format("Cache read took %ds", storeReader.timeTakenMillis()));
logger.debug(String.format("Cache read took %ds", storeReader.timeTakenMillis()));
// The original cached content, still cached...
assertEquals("Content written from " + getClass().getSimpleName(), storeReader.content);
}
@@ -113,7 +113,7 @@ public class SlowContentStoreTest
protected void doExecute()
{
content = cachingStore.getReader("any-url").getContentString();
logger.info("Read content: " + content);
logger.debug("Read content: " + content);
}
}