configurable free disk space via disk.free

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5163 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 16 years ago
parent 7c5867a832
commit fd9233244e

@ -885,3 +885,5 @@ autoReCrawl_memprereq = -1
compare_yacy.left = YaCy
compare_yacy.right = YaCy
# minimum free disk space for crawling (MiB)
disk.free = 3000

@ -32,9 +32,6 @@ import de.anomic.server.logging.serverLog;
import de.anomic.tools.diskUsage;
public final class ResourceObserver {
// The minimal free space on every used volume, for now set to 1000 MB.
// TODO make it configurable
private final static long MIN_FREE_DISK_SPACE = 1000L /* MiB */ * 1024L * 1024L;
// Unknown for now
//private final static long MIN_FREE_MEMORY = 0;
// We are called with the cleanup job every five minutes;
@ -126,10 +123,10 @@ public final class ResourceObserver {
}
/**
* @return amount of space that should be kept free
* @return amount of space (MiB) that should be kept free
*/
public long getMinFreeDiskSpace () {
return MIN_FREE_DISK_SPACE;
return sb.getConfigLong("disk.free", 3000) /* MiB */ * 1024L * 1024L;
}
/**
@ -146,8 +143,8 @@ public final class ResourceObserver {
for (final Map.Entry<String, long[]> entry: usage.entrySet()) {
val = entry.getValue();
this.log.logInfo("df of Volume " + entry.getKey() + ": " + (val[1] / 1024 / 1024) + " MB");
if (val[1] < MIN_FREE_DISK_SPACE) {
this.log.logWarning("Volume " + entry.getKey() + ": free space (" + (val[1] / 1024 / 1024) + " MB) is too low (< " + (MIN_FREE_DISK_SPACE / 1024 / 1024) + " MB)");
if (val[1] < getMinFreeDiskSpace()) {
this.log.logWarning("Volume " + entry.getKey() + ": free space (" + (val[1] / 1024 / 1024) + " MB) is too low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
below = true;
}
}

Loading…
Cancel
Save