maintenance

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@279 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent a5b40923b6
commit f45dc29f35

@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4 javacTarget=1.4
# Release Configuration # Release Configuration
releaseVersion=0.381 releaseVersion=0.382
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz #releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr} releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}

@ -107,12 +107,14 @@ you must switch off the proxy to go off-line.
#(/omode)# #(/omode)#
</td></tr> </td></tr>
<tr class="TableCellDark"><td>Memory Usage</td><td> <tr class="TableCellDark"><td>Memory Usage</td><td>
free: #[freeMemory]# | total: #[totalMemory]# | max: #[maxMemory]# <form action="Status.html" method="get">free: #[freeMemory]# | total: #[totalMemory]# | max: #[maxMemory]# | <input type="submit" name="gc" value="do Garbage-Collect now"></form>
</td></tr> </td></tr>
<tr class="TableCellLight"><td>Traffic</td><td> <tr class="TableCellLight"><td>Traffic</td><td>
In: #[trafficIn]# | Out: #[trafficOut]# In: #[trafficIn]# | Out: #[trafficOut]#
</td></tr> </td></tr>
<tr class="TableCellDark"><td>System Resources</td><td>
processors: #[processors]#
</td></tr>
</table> </table>
<!-- </td></tr></table> --> <!-- </td></tr></table> -->

@ -56,47 +56,47 @@ import de.anomic.yacy.yacyCore;
public class Status { public class Status {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
// return variable that accumulates replacements // return variable that accumulates replacements
serverObjects prop = new serverObjects(); serverObjects prop = new serverObjects();
// set values // set values
String s; String s;
int pos; int pos;
/* /*
versionProbe=http://www.anomic.de/AnomicHTTPProxy/release.txt versionProbe=http://www.anomic.de/AnomicHTTPProxy/release.txt
superseedFile=superseed.txt superseedFile=superseed.txt
*/ */
// update seed info // update seed info
yacyCore.peerActions.updateMySeed(); yacyCore.peerActions.updateMySeed();
// password protection // password protection
if (env.getConfig("adminAccountBase64MD5", "").length() == 0) if (env.getConfig("adminAccountBase64MD5", "").length() == 0)
prop.put("protection", 0);//not protected prop.put("protection", 0);//not protected
else else
prop.put("protection", 1);//protected prop.put("protection", 1);//protected
// version information // version information
if ((yacyCore.latestVersion == null) || (yacyCore.latestVersion.length() < 3) || (yacyCore.latestVersion.equals(env.getConfig("version","")))) if ((yacyCore.latestVersion == null) || (yacyCore.latestVersion.length() < 3) || (yacyCore.latestVersion.equals(env.getConfig("version",""))))
prop.put("versioncomment", 0);//no commet prop.put("versioncomment", 0);//no commet
else else
prop.put("versioncomment", 1);//new version prop.put("versioncomment", 1);//new version
prop.put("versioncomment_latestVersion", yacyCore.latestVersion); prop.put("versioncomment_latestVersion", yacyCore.latestVersion);
prop.put("host", serverCore.publicIP()); prop.put("host", serverCore.publicIP());
prop.put("port", env.getConfig("port", "<unknown>")); prop.put("port", env.getConfig("port", "<unknown>"));
if (env.getConfig("remoteProxyUse", "false").equals("true")) { if (env.getConfig("remoteProxyUse", "false").equals("true")) {
prop.put("remoteProxy", 1); prop.put("remoteProxy", 1);
prop.put("remoteProxy_host", env.getConfig("remoteProxyHost", "<unknown>")); prop.put("remoteProxy_host", env.getConfig("remoteProxyHost", "<unknown>"));
prop.put("remoteProxy_port", env.getConfig("remoteProxyPort", "<unknown>")); prop.put("remoteProxy_port", env.getConfig("remoteProxyPort", "<unknown>"));
} else { } else {
prop.put("remoteProxy", 0);//not used prop.put("remoteProxy", 0);//not used
} }
// peer information // peer information
String thisHash = ""; String thisHash = "";
String thisName = env.getConfig("peerName", "<nameless>"); String thisName = env.getConfig("peerName", "<nameless>");
if (yacyCore.seedDB.mySeed == null) { if (yacyCore.seedDB.mySeed == null) {
thisHash = "not assigned"; thisHash = "not assigned";
prop.put("peerAddress", 0);//not assigned prop.put("peerAddress", 0);//not assigned
prop.put("peerStatistics", 0);//unknown prop.put("peerStatistics", 0);//unknown
@ -120,66 +120,69 @@ public class Status {
prop.put("peerAddress_peername", env.getConfig("peerName", "<nameless>").toLowerCase()); prop.put("peerAddress_peername", env.getConfig("peerName", "<nameless>").toLowerCase());
} }
} }
String peerStatus = ((yacyCore.seedDB.mySeed == null) ? "virgin" : yacyCore.seedDB.mySeed.get("PeerType", "virgin")); String peerStatus = ((yacyCore.seedDB.mySeed == null) ? "virgin" : yacyCore.seedDB.mySeed.get("PeerType", "virgin"));
if (peerStatus.equals("virgin")) { if (peerStatus.equals("virgin")) {
prop.put("peerStatus", 0);//virgin prop.put("peerStatus", 0);//virgin
} else if (peerStatus.equals("junior")) { } else if (peerStatus.equals("junior")) {
prop.put("peerStatus", 1);//junior prop.put("peerStatus", 1);//junior
} else if (peerStatus.equals("senior")) { } else if (peerStatus.equals("senior")) {
prop.put("peerStatus", 2);//senior prop.put("peerStatus", 2);//senior
} else if (peerStatus.equals("principal")) { } else if (peerStatus.equals("principal")) {
prop.put("peerStatus", 3);//principal prop.put("peerStatus", 3);//principal
prop.put("peerStatus_seedURL", yacyCore.seedDB.mySeed.get("seedURL", "?")); prop.put("peerStatus_seedURL", yacyCore.seedDB.mySeed.get("seedURL", "?"));
} }
prop.put("peerName", thisName); prop.put("peerName", thisName);
prop.put("hash", thisHash); prop.put("hash", thisHash);
if ((env.getConfig("seedFTPServer","").length() != 0) && if ((env.getConfig("seedFTPServer","").length() != 0) &&
(env.getConfig("seedFTPAccount","").length() != 0) && (env.getConfig("seedFTPAccount","").length() != 0) &&
(env.getConfig("seedFTPPassword","").length() != 0) && (env.getConfig("seedFTPPassword","").length() != 0) &&
(env.getConfig("seedFTPPath","").length() != 0)) { (env.getConfig("seedFTPPath","").length() != 0)) {
prop.put("seedServer", 1);//enabled prop.put("seedServer", 1);//enabled
prop.put("seedServer_seedFTPServer", env.getConfig("seedFTPServer","")); prop.put("seedServer_seedFTPServer", env.getConfig("seedFTPServer",""));
} else { } else {
prop.put("seedServer", 0);//disabled prop.put("seedServer", 0);//disabled
} }
if ((yacyCore.seedDB != null) && (yacyCore.seedDB.sizeConnected() > 0)){ if ((yacyCore.seedDB != null) && (yacyCore.seedDB.sizeConnected() > 0)){
prop.put("otherPeers", 1); prop.put("otherPeers", 1);
prop.put("otherPeers_num", yacyCore.seedDB.sizeConnected()); prop.put("otherPeers_num", yacyCore.seedDB.sizeConnected());
}else{ }else{
prop.put("otherPeers", 0);//not online prop.put("otherPeers", 0);//not online
} }
// pop-up trigger management Runtime rt = Runtime.getRuntime();
if (post != null) {
if (post.containsKey("dispop")) env.setConfig("browserPopUpTrigger", "false");
if (post.containsKey("enpop")) env.setConfig("browserPopUpTrigger", "true");
}
if (env.getConfig("browserPopUpTrigger", "false").equals("false")) {
prop.put("popup", 0);
} else {
prop.put("popup", 1);
}
if (env.getConfig("onlineMode", "1").equals("1")) {
prop.put("omode", 1);
} else {
prop.put("omode", 2);
}
// memory usage // pop-up trigger management and gc
Runtime rt = Runtime.getRuntime(); if (post != null) {
prop.put("freeMemory", bytesToString(rt.freeMemory())); if (post.containsKey("dispop")) env.setConfig("browserPopUpTrigger", "false");
prop.put("totalMemory", bytesToString(rt.totalMemory())); if (post.containsKey("enpop")) env.setConfig("browserPopUpTrigger", "true");
prop.put("maxMemory", bytesToString(rt.maxMemory())); if (post.containsKey("gc")) rt.gc();
}
// proxy traffic
prop.put("trafficIn",bytesToString(httpdByteCountInputStream.getGlobalCount())); if (env.getConfig("browserPopUpTrigger", "false").equals("false")) {
prop.put("trafficOut",bytesToString(httpdByteCountOutputStream.getGlobalCount())); prop.put("popup", 0);
} else {
// return rewrite properties prop.put("popup", 1);
return prop; }
if (env.getConfig("onlineMode", "1").equals("1")) {
prop.put("omode", 1);
} else {
prop.put("omode", 2);
}
// memory usage and system attributes
prop.put("freeMemory", bytesToString(rt.freeMemory()));
prop.put("totalMemory", bytesToString(rt.totalMemory()));
prop.put("maxMemory", bytesToString(rt.maxMemory()));
prop.put("processors", rt.availableProcessors());
// proxy traffic
prop.put("trafficIn",bytesToString(httpdByteCountInputStream.getGlobalCount()));
prop.put("trafficOut",bytesToString(httpdByteCountOutputStream.getGlobalCount()));
// return rewrite properties
return prop;
} }
public static String intervalToString(String minsAsString) public static String intervalToString(String minsAsString)

@ -469,10 +469,14 @@ public final class yacy {
} }
private static void checkMigrate(File dbroot, serverLog log, File file, plasmaWordIndex wordIndex) throws IOException { private static void checkMigrate(File dbroot, serverLog log, File file, plasmaWordIndex wordIndex) throws IOException {
long length = file.length();
if (length > 3000) {
log.logInfo("SKIPPED " + file.toString() + ": too big, size=" + (length / 1024) + "kb");
return;
}
kelondroTree db = new kelondroTree(file, 0); kelondroTree db = new kelondroTree(file, 0);
String wordhash = file.getName().substring(0, 12); String wordhash = file.getName().substring(0, 12);
int size = db.size(); int size = db.size();
long length = file.length();
db.close(); db.close();
if (size <= 50) { if (size <= 50) {
plasmaWordIndexEntryContainer container = new plasmaWordIndexEntryContainer(wordhash); plasmaWordIndexEntryContainer container = new plasmaWordIndexEntryContainer(wordhash);

Loading…
Cancel
Save