git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5311 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 16 years ago
parent 8d07607d1d
commit 5cf0cbb47e

@ -55,6 +55,11 @@ public final class ResourceObserver {
private int disksFree;
private int memoryFree;
/**
* The ResourceObserver checks the resources
* and pauses crawls if necessary
* @param sb the plasmaSwitchboard
*/
public ResourceObserver(final plasmaSwitchboard sb) {
this.sb = sb;
this.log.logInfo("initializing the resource observer");
@ -87,6 +92,9 @@ public final class ResourceObserver {
memoryFree = HIGH;
}
/**
* checks the resources and pauses crawls if necessary
*/
public void resourceObserverJob() {
checkDiskUsageCount++;
checkMemoryUsageCount++;
@ -126,10 +134,16 @@ public final class ResourceObserver {
}
}
/**
* @return <code>true</code> if disk space is available
*/
public boolean getDisksOK () {
return disksFree == HIGH;
}
/**
* @return <code>true</code> if memory is available
*/
public boolean getMemoryOK () {
return memoryFree == HIGH;
}
@ -149,7 +163,6 @@ public final class ResourceObserver {
* <li><code>LOW</code> if lower than 100MB or 1/5 disk space is available</li>
* </ul>
*/
private int checkDisks() {
int ret = HIGH;

Loading…
Cancel
Save