|
|
@ -542,7 +542,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
|
|
|
|
|
|
|
|
// clean up profiles
|
|
|
|
// clean up profiles
|
|
|
|
this.log.logConfig("Cleaning Profiles");
|
|
|
|
this.log.logConfig("Cleaning Profiles");
|
|
|
|
cleanProfiles();
|
|
|
|
try { cleanProfiles(); } catch (InterruptedException e) { /* Ignore this here */ }
|
|
|
|
|
|
|
|
|
|
|
|
// init ranking transmission
|
|
|
|
// init ranking transmission
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -769,13 +769,17 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
initProfiles();
|
|
|
|
initProfiles();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean cleanProfiles() {
|
|
|
|
public boolean cleanProfiles() throws InterruptedException {
|
|
|
|
if ((sbQueue.size() > 0) || (cacheLoader.size() > 0) || (urlPool.noticeURL.stackSize() > 0)) return false;
|
|
|
|
if ((sbQueue.size() > 0) || (cacheLoader.size() > 0) || (urlPool.noticeURL.stackSize() > 0)) return false;
|
|
|
|
final Iterator iter = profiles.profiles(true);
|
|
|
|
final Iterator iter = profiles.profiles(true);
|
|
|
|
plasmaCrawlProfile.entry entry;
|
|
|
|
plasmaCrawlProfile.entry entry;
|
|
|
|
boolean hasDoneSomething = false;
|
|
|
|
boolean hasDoneSomething = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
while (iter.hasNext()) {
|
|
|
|
while (iter.hasNext()) {
|
|
|
|
|
|
|
|
// check for interruption
|
|
|
|
|
|
|
|
if (Thread.currentThread().isInterrupted()) throw new InterruptedException("Shutdown in progress");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getting next profile
|
|
|
|
entry = (plasmaCrawlProfile.entry) iter.next();
|
|
|
|
entry = (plasmaCrawlProfile.entry) iter.next();
|
|
|
|
if (!((entry.name().equals("proxy")) || (entry.name().equals("remote")))) {
|
|
|
|
if (!((entry.name().equals("proxy")) || (entry.name().equals("remote")))) {
|
|
|
|
iter.remove();
|
|
|
|
iter.remove();
|
|
|
@ -1085,10 +1089,11 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean cleanupJob() {
|
|
|
|
public boolean cleanupJob() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
boolean hasDoneSomething = false;
|
|
|
|
boolean hasDoneSomething = false;
|
|
|
|
|
|
|
|
|
|
|
|
// do transmission of cr-files
|
|
|
|
// do transmission of cr-files
|
|
|
|
|
|
|
|
checkInterruption();
|
|
|
|
int count = rankingOwnDistribution.size() / 100;
|
|
|
|
int count = rankingOwnDistribution.size() / 100;
|
|
|
|
if (count == 0) count = 1;
|
|
|
|
if (count == 0) count = 1;
|
|
|
|
if (count > 5) count = 5;
|
|
|
|
if (count > 5) count = 5;
|
|
|
@ -1096,6 +1101,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
rankingOtherDistribution.transferRanking(1);
|
|
|
|
rankingOtherDistribution.transferRanking(1);
|
|
|
|
|
|
|
|
|
|
|
|
// clean up error stack
|
|
|
|
// clean up error stack
|
|
|
|
|
|
|
|
checkInterruption();
|
|
|
|
if ((urlPool.errorURL.stackSize() > 1000)) {
|
|
|
|
if ((urlPool.errorURL.stackSize() > 1000)) {
|
|
|
|
log.logFine("Cleaning Error-URLs report stack, " + urlPool.errorURL.stackSize() + " entries on stack");
|
|
|
|
log.logFine("Cleaning Error-URLs report stack, " + urlPool.errorURL.stackSize() + " entries on stack");
|
|
|
|
urlPool.errorURL.clearStack();
|
|
|
|
urlPool.errorURL.clearStack();
|
|
|
@ -1103,6 +1109,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clean up loadedURL stack
|
|
|
|
// clean up loadedURL stack
|
|
|
|
for (int i = 1; i <= 6; i++) {
|
|
|
|
for (int i = 1; i <= 6; i++) {
|
|
|
|
|
|
|
|
checkInterruption();
|
|
|
|
if (urlPool.loadedURL.getStackSize(i) > 1000) {
|
|
|
|
if (urlPool.loadedURL.getStackSize(i) > 1000) {
|
|
|
|
log.logFine("Cleaning Loaded-URLs report stack, " + urlPool.loadedURL.getStackSize(i) + " entries on stack " + i);
|
|
|
|
log.logFine("Cleaning Loaded-URLs report stack, " + urlPool.loadedURL.getStackSize(i) + " entries on stack " + i);
|
|
|
|
urlPool.loadedURL.clearStack(i);
|
|
|
|
urlPool.loadedURL.clearStack(i);
|
|
|
@ -1110,15 +1117,21 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clean up profiles
|
|
|
|
// clean up profiles
|
|
|
|
|
|
|
|
checkInterruption();
|
|
|
|
if (cleanProfiles()) hasDoneSomething = true;
|
|
|
|
if (cleanProfiles()) hasDoneSomething = true;
|
|
|
|
|
|
|
|
|
|
|
|
// clean up news
|
|
|
|
// clean up news
|
|
|
|
|
|
|
|
checkInterruption();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
log.logFine("Cleaning Incoming News, " + yacyCore.newsPool.size(yacyNewsPool.INCOMING_DB) + " entries on stack");
|
|
|
|
log.logFine("Cleaning Incoming News, " + yacyCore.newsPool.size(yacyNewsPool.INCOMING_DB) + " entries on stack");
|
|
|
|
if (yacyCore.newsPool.automaticProcess() > 0) hasDoneSomething = true;
|
|
|
|
if (yacyCore.newsPool.automaticProcess() > 0) hasDoneSomething = true;
|
|
|
|
} catch (IOException e) {}
|
|
|
|
} catch (IOException e) {}
|
|
|
|
|
|
|
|
|
|
|
|
return hasDoneSomething;
|
|
|
|
return hasDoneSomething;
|
|
|
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
|
|
this.log.logInfo("cleanupJob: Shutdown detected");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|