public class AggregationWorker extends Object implements CleanupIF
AggregationWorker
singleton contains the schedule and file bookkeeping functionality needed in the
aggregation of indexes.
The AggregationWorker
has the responsibility of ensuring each index in the raw index files ends up
appearing exactly once in the index files used by Wayback. If this isn't possible the fallback is to allow duplicate
occurrences of index lines ensuring index lines appears at least once.
Modifier and Type | Field and Description |
---|---|
static File |
FINAL_INDEX_FILE
The final Wayback index file currently used to intermediate indexes into.
|
static File |
INTERMEDIATE_INDEX_FILE
The intermediate Wayback index file currently used to merge new indexes into.
|
static File |
TEMP_FILE_INDEX
The Files to store sorted indexes until they have been merge into a intermediate index files.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Used to clean up a class from within a shutdown hook.
|
static AggregationWorker |
getInstance()
Factory method which creates a singleton aggregator and sets it running.
|
protected void |
initialize()
Creates the needed working directories.
|
protected void |
runAggregation()
Runs the actual aggregation.
|
public static final File TEMP_FILE_INDEX
public static final File INTERMEDIATE_INDEX_FILE
public static final File FINAL_INDEX_FILE
public static AggregationWorker getInstance()
A temp directory is create if it doesn't exist. The aggregator won't run if a temp directory is already present, as this might indicate an instance of the aggregator already running.
protected void runAggregation()
Is synchronized so several subsequent scheduled runs of the method will have to run one at a time.
public void cleanup()
CleanupIF
protected void initialize()
Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.