dk.netarkivet.archive.indexserver
Class CDXIndexCache

java.lang.Object
  extended by dk.netarkivet.archive.indexserver.FileBasedCache<java.util.Set<T>>
      extended by dk.netarkivet.archive.indexserver.MultiFileBasedCache<T>
          extended by dk.netarkivet.archive.indexserver.CombiningMultiFileBasedCache<java.lang.Long>
              extended by dk.netarkivet.archive.indexserver.CDXIndexCache
All Implemented Interfaces:
JobIndexCache

public class CDXIndexCache
extends CombiningMultiFileBasedCache<java.lang.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.archive.indexserver.CombiningMultiFileBasedCache
rawcache
 
Fields inherited from class dk.netarkivet.archive.indexserver.FileBasedCache
cacheDir
 
Constructor Summary
CDXIndexCache()
          Creates a new cache for CDX index files.
 
Method Summary
protected  void combine(java.util.Map<java.lang.Long,java.io.File> filesFound)
          Combine parts of an index into one big index.
 void requestIndex(java.util.Set<java.lang.Long> jobSet, java.lang.Long harvestId)
          Request an index from the indexserver.
 
Methods inherited from class dk.netarkivet.archive.indexserver.CombiningMultiFileBasedCache
cacheData, prepareCombine
 
Methods inherited from class dk.netarkivet.archive.indexserver.MultiFileBasedCache
getCacheFile
 
Methods inherited from class dk.netarkivet.archive.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
 

Constructor Detail

CDXIndexCache

public CDXIndexCache()
Creates a new cache for CDX index files.

Method Detail

combine

protected void combine(java.util.Map<java.lang.Long,java.io.File> filesFound)
Combine parts of an index into one big index.

Specified by:
combine in class CombiningMultiFileBasedCache<java.lang.Long>
Parameters:
filesFound - A map of IDs and the files caching their content.

requestIndex

public void requestIndex(java.util.Set<java.lang.Long> jobSet,
                         java.lang.Long harvestId)
Description copied from interface: JobIndexCache
Request an index from the indexserver. Prepare the indx but don't give it to me.

Specified by:
requestIndex in interface JobIndexCache