mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-08-25 07:56:35 +00:00
Merge pull request #759 from bnfleb/issue753
Issue #753 verify if bdb is started before generating reports
This commit is contained in:
@@ -76,6 +76,10 @@ public class HostsReport extends Report {
|
||||
|
||||
@Override
|
||||
public void write(final PrintWriter writer, StatisticsTracker stats) {
|
||||
if (!stats.bdb.isRunning()) {
|
||||
writer.println("bdb not started");
|
||||
return;
|
||||
}
|
||||
Collection<String> keys = null;
|
||||
DisposableStoredSortedMap<Long, String> hd = null;
|
||||
if (maxSortSize<0 || maxSortSize>stats.serverCache.hostKeys().size()) {
|
||||
|
||||
@@ -33,6 +33,10 @@ public class MimetypesReport extends Report {
|
||||
|
||||
@Override
|
||||
public void write(PrintWriter writer, StatisticsTracker stats) {
|
||||
if (!stats.bdb.isRunning()) {
|
||||
writer.println("bdb not started");
|
||||
return;
|
||||
}
|
||||
// header
|
||||
writer.print("[#urls] [#bytes] [mime-types]\n");
|
||||
DisposableStoredSortedMap<Long,String> fd = stats.getReverseSortedCopy(stats.getFileDistribution());
|
||||
|
||||
@@ -32,6 +32,10 @@ public class ResponseCodeReport extends Report {
|
||||
|
||||
@Override
|
||||
public void write(PrintWriter writer, StatisticsTracker stats) {
|
||||
if (!stats.bdb.isRunning()) {
|
||||
writer.println("bdb not started");
|
||||
return;
|
||||
}
|
||||
// header
|
||||
writer.print("[#urls] [rescode]\n");
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ public class SeedsReport extends Report {
|
||||
|
||||
@Override
|
||||
public void write(PrintWriter writer, StatisticsTracker stats) {
|
||||
if (!stats.bdb.isRunning()) {
|
||||
writer.println("bdb not started");
|
||||
return;
|
||||
}
|
||||
|
||||
// Build header.
|
||||
writer.print("[code] [status] [seed] [redirect]\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user