mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-25 23:25:44 +00:00
HER-1756 improved crawl status reporting: more definitive start-after-setup, conclusion-after-logging of crawling
* AbstractFrontier.java
call new finalTasks just before announcing FINISH state
* WorkQueueFrontier.java
eliminate closeQueue
* BdbFrontier.java
move dumpAllPendingToLog from closeQueue (triggered by CrawlController FINISHED) to finalTasks (before Frontier FINISH)
replace closeQueue with close() override
This commit is contained in:
@@ -408,6 +408,7 @@ public abstract class AbstractFrontier
|
||||
// continue to process discovered and finished URIs
|
||||
inbound.take().process();
|
||||
}
|
||||
finalTasks();
|
||||
// TODO: more cleanup?
|
||||
reachedState(State.FINISH);
|
||||
break loop;
|
||||
@@ -435,6 +436,14 @@ public abstract class AbstractFrontier
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform any tasks necessary before entering
|
||||
* FINISH frontier state/FINISHED crawl state
|
||||
*/
|
||||
protected void finalTasks() {
|
||||
// by default; nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the outbound queue with eligible CrawlURIs, to capacity
|
||||
* or as much as possible.
|
||||
|
||||
@@ -181,7 +181,13 @@ implements Checkpointable, BeanNameAware {
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeQueue() {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.archive.crawler.frontier.AbstractFrontier#finalTasks()
|
||||
*/
|
||||
@Override
|
||||
protected void finalTasks() {
|
||||
super.finalTasks();
|
||||
// before closing/releasing, dump if requested
|
||||
if (getDumpPendingAtClose()) {
|
||||
try {
|
||||
@@ -190,7 +196,15 @@ implements Checkpointable, BeanNameAware {
|
||||
logger.log(Level.WARNING, "dump pending problem", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.archive.crawler.frontier.WorkQueueFrontier#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() {
|
||||
ArchiveUtils.closeQuietly(pendingUris);
|
||||
super.close();
|
||||
}
|
||||
|
||||
protected BdbMultipleWorkQueues getWorkQueues() {
|
||||
|
||||
@@ -312,8 +312,7 @@ implements Closeable,
|
||||
* Release resources only needed when running
|
||||
*/
|
||||
public void close() {
|
||||
ArchiveUtils.closeQuietly(uriUniqFilter);
|
||||
closeQueue();
|
||||
ArchiveUtils.closeQuietly(uriUniqFilter);
|
||||
ArchiveUtils.closeQuietly(allQueues);
|
||||
}
|
||||
|
||||
@@ -1551,8 +1550,6 @@ implements Closeable,
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void closeQueue();
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the WorkQueue implementation of this
|
||||
* Frontier stores its workload on disk instead of relying
|
||||
|
||||
Reference in New Issue
Block a user