Class CDXIndexCache
- java.lang.Object
-
- dk.netarkivet.harvester.indexserver.FileBasedCache<Set<T>>
-
- dk.netarkivet.harvester.indexserver.MultiFileBasedCache<T>
-
- dk.netarkivet.harvester.indexserver.CombiningMultiFileBasedCache<Long>
-
- dk.netarkivet.harvester.indexserver.CDXIndexCache
-
- All Implemented Interfaces:
JobIndexCache
public class CDXIndexCache extends CombiningMultiFileBasedCache<Long> implements JobIndexCache
A cache that serves CDX index files for job IDs.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.
-
-
Field Summary
-
Fields inherited from class dk.netarkivet.harvester.indexserver.CombiningMultiFileBasedCache
rawcache
-
Fields inherited from class dk.netarkivet.harvester.indexserver.FileBasedCache
cacheDir
-
-
Constructor Summary
Constructors Constructor Description CDXIndexCache()
Creates a new cache for CDX index files.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class dk.netarkivet.harvester.indexserver.CombiningMultiFileBasedCache
cacheData, prepareCombine
-
Methods inherited from class dk.netarkivet.harvester.indexserver.MultiFileBasedCache
getCacheFile
-
Methods inherited from class dk.netarkivet.harvester.indexserver.FileBasedCache
cache, get, getCacheDir, getIndex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dk.netarkivet.common.distribute.indexserver.JobIndexCache
getIndex
-
-
-
-
Method Detail
-
combine
protected void combine(Map<Long,File> filesFound)
Combine parts of an index into one big index.- Specified by:
combine
in classCombiningMultiFileBasedCache<Long>
- Parameters:
filesFound
- A map of IDs and the files caching their content.
-
requestIndex
public void requestIndex(Set<Long> jobSet, Long harvestId)
Description copied from interface:JobIndexCache
Request an index from the indexserver. Prepare the index but don't give it to me.- Specified by:
requestIndex
in interfaceJobIndexCache
- Parameters:
jobSet
- Set of job IDs to generate index for.harvestId
- Harvestdefinition associated with this set of jobs
-
-