public class CDXIndexCache extends CombiningMultiFileBasedCache<Long> implements JobIndexCache
Notice that since data for some IDs may not be available, the actual cached file might not correspond in its content to what was asked for. For instance, if asking for data for IDs 2, 3, and 4, and 3 fails, a cached file for IDs 2 and 4 will be returned. There is currently no way to tell if you got everything you asked for.
This cache uses the Unix sort(1) command as an external process call, as that one is optimized for handling large, disk-based sorts.
rawcache
cacheDir
Constructor and Description |
---|
CDXIndexCache()
Creates a new cache for CDX index files.
|
Modifier and Type | Method and Description |
---|---|
protected void |
combine(Map<Long,File> filesFound)
Combine parts of an index into one big index.
|
void |
requestIndex(Set<Long> jobSet,
Long harvestId)
Request an index from the indexserver.
|
cacheData, prepareCombine
getCacheFile
cache, get, getCacheDir, getIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndex
public CDXIndexCache()
protected void combine(Map<Long,File> filesFound)
combine
in class CombiningMultiFileBasedCache<Long>
filesFound
- A map of IDs and the files caching their content.public void requestIndex(Set<Long> jobSet, Long harvestId)
JobIndexCache
requestIndex
in interface JobIndexCache
jobSet
- Set of job IDs to generate index for.harvestId
- Harvestdefinition associated with this set of jobsCopyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.