Class TwoLevelFileCache
java.lang.Object
rocks.imsofa.ai.puppychatter.cache.TwoLevelFileCache
the first level is a partial key i.e. a key that may have conflicts
the second level is a map with a real key and content
the cache implementation allows only text contents
- Author:
- lendle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencode2PartialKey(String identifier) a partial key allows duplication to be resolved laterencode2RealKey(String identifier) getFromCache(String identifier) voidsave2Cache(String identifier, String content)
-
Constructor Details
-
TwoLevelFileCache
-
-
Method Details
-
getFromCache
- Parameters:
identifier- the original identifier of the content to be cached, will be encoded to be saved to file system- Returns:
- Throws:
Exception
-
save2Cache
- Parameters:
identifier- the original identifier of the content to be cached, will be encoded to be saved to file systemcontent-- Throws:
Exception
-
encode2PartialKey
a partial key allows duplication to be resolved later- Parameters:
identifier-- Returns:
- Throws:
Exception
-
encode2RealKey
- Throws:
Exception
-