configurable disk space hardlimit for dht

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6441 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
lotus 2009-10-31 19:12:53 +00:00
parent a0e891c63d
commit 79251e6f60
3 changed files with 19 additions and 2 deletions

View File

@ -896,6 +896,8 @@ compare_yacy.right = YaCy
# minimum free disk space for crawling (MiB)
disk.free = 3000
# minimum for DHT or 1/5th of former, whatever is max
disk.free.hardlimit = 1000
# setting if execution of CGI files is allowed or not
cgi.allow = false

View File

@ -161,7 +161,14 @@ public final class ResourceObserver {
* @return amount of space (MiB) that should be kept free
*/
public long getMinFreeDiskSpace () {
return sb.getConfigLong("disk.free", 3000) /* MiB */ * 1024L * 1024L;
return sb.getConfigLong(SwitchboardConstants.DISK_FREE, 3000) /* MiB */ * 1024L * 1024L;
}
/**
* @return amount of space (MiB) that should at least be kept free
*/
public long getMinFreeDiskSpace_hardlimit () {
return sb.getConfigLong(SwitchboardConstants.DISK_FREE_HARDLIMIT, 100) /* MiB */ * 1024L * 1024L;
}
/**
@ -187,7 +194,7 @@ public final class ResourceObserver {
log.logWarning("Volume " + entry.getKey() + ": free space (" + (val[1] / 1024 / 1024) + " MB) is too low (< " + (getMinFreeDiskSpace() / 1024 / 1024) + " MB)");
ret = MEDIUM;
}
if (val[1] < Math.min(getMinFreeDiskSpace() / 5L, 100L)) {
if (val[1] < Math.max(getMinFreeDiskSpace() / 5L, getMinFreeDiskSpace_hardlimit())) {
ret = LOW;
}
}

View File

@ -385,6 +385,14 @@ public final class SwitchboardConstants {
public static final String WORK_PATH = "workPath";
public static final String WORK_PATH_DEFAULT = "DATA/WORK";
/**
* ResourceObserver
*/
public static final String DISK_FREE = "disk.free";
public static final String DISK_FREE_HARDLIMIT = "disk.free.hardlimit";
/*
* Some constants
*/