Class MultiFileBasedCache<T extends java.lang.Comparable<T>>
- java.lang.Object
-
- dk.netarkivet.harvester.indexserver.FileBasedCache<java.util.Set<T>>
-
- dk.netarkivet.harvester.indexserver.MultiFileBasedCache<T>
-
- Type Parameters:
T
- The cache type, must extend java.lang.Comparable.
- Direct Known Subclasses:
CombiningMultiFileBasedCache
,IndexRequestClient
public abstract class MultiFileBasedCache<T extends java.lang.Comparable<T>> extends FileBasedCache<java.util.Set<T>>
Implementation of file based cache, that works with the assumption we are working on a set if ids, of which we might only get a subset correct.Implements generating a filename from this.
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.harvester.indexserver.FileBasedCache
cacheDir
-
-
Constructor Summary
Constructors Constructor Description MultiFileBasedCache(java.lang.String cacheName)
Creates a new FileBasedCache object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
getCacheFile(java.util.Set<T> ids)
Get the filename for the file containing the combined data for a set of IDs.-
Methods inherited from class dk.netarkivet.harvester.indexserver.FileBasedCache
cache, cacheData, get, getCacheDir, getIndex
-
-
-
-
Constructor Detail
-
MultiFileBasedCache
public MultiFileBasedCache(java.lang.String cacheName)
Creates a new FileBasedCache object. This creates a directory under the main cache directory holding cached files.- Parameters:
cacheName
- Name of this cache (enabling sharing among processes). The directoriy creating in the cachedir will have this name.
-
-
Method Detail
-
getCacheFile
public java.io.File getCacheFile(java.util.Set<T> ids)
Get the filename for the file containing the combined data for a set of IDs.- Specified by:
getCacheFile
in classFileBasedCache<java.util.Set<T extends java.lang.Comparable<T>>>
- Parameters:
ids
- A set of IDs to generate a filename for- Returns:
- A filename that uniquely identifies this set of IDs within the cache. It is considered acceptable to have collisions at a likelihood the order of 1/2^128 (i.e. use MD5 to abbreviate long lists).
-
-