From 96a5b6e8fb6c87e5f81b85254b68df440802a2fc Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 20 Sep 2005 23:15:33 +0000 Subject: [PATCH] removed yacy peer types from serverSwitch git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@758 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/htdocsdefault/welcome.java | 5 +++-- htroot/yacy/hello.java | 20 ++++++++++---------- source/de/anomic/server/serverSwitch.java | 6 ------ source/de/anomic/yacy/yacySeed.java | 1 - yacy.init | 10 +++++----- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/htroot/htdocsdefault/welcome.java b/htroot/htdocsdefault/welcome.java index 0453968b4..e81967b65 100644 --- a/htroot/htdocsdefault/welcome.java +++ b/htroot/htdocsdefault/welcome.java @@ -53,6 +53,7 @@ import de.anomic.server.serverCore; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyCore; +import de.anomic.yacy.yacySeed; public class welcome { @@ -75,8 +76,8 @@ public class welcome { prop.put("port", env.getConfig("port", "8080")); prop.put("clientip", header.get("CLIENTIP", "")); - final String peertype = (yacyCore.seedDB.mySeed == null) ? serverSwitch.PEERTYPE_JUNIOR : yacyCore.seedDB.mySeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_VIRGIN); - final boolean senior = (peertype.equals(serverSwitch.PEERTYPE_SENIOR)) || (peertype.equals(serverSwitch.PEERTYPE_PRINCIPAL)); + final String peertype = (yacyCore.seedDB.mySeed == null) ? yacySeed.PEERTYPE_JUNIOR : yacyCore.seedDB.mySeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN); + final boolean senior = (peertype.equals(yacySeed.PEERTYPE_SENIOR)) || (peertype.equals(yacySeed.PEERTYPE_PRINCIPAL)); if (senior) { prop.put("couldcan", "can"); } else { prop.put("couldcan", "could"); } if (senior) { prop.put("seniorinfo", "This peer runs in senior mode which means that your peer can be accessed using the addresses shown above."); } else { prop.put("seniorinfo", "Nobody can access your peer from the outside of your intranet. You must open your firewall and/or set a 'virtual server' in the settings of your router to enable access to the addresses as shown below."); } prop.put("wwwpath", "/" + env.getConfig("htDocsPath", "DATA/HTDOCS")); diff --git a/htroot/yacy/hello.java b/htroot/yacy/hello.java index 557ac88be..04dc1806a 100644 --- a/htroot/yacy/hello.java +++ b/htroot/yacy/hello.java @@ -92,7 +92,7 @@ public class hello { // we easily know the caller's IP: final String clientip = (String) header.get("CLIENTIP", ""); // read an artificial header addendum final String reportedip = remoteSeed.get(STR_IP, ""); - final String reportedPeerType = remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_JUNIOR); + final String reportedPeerType = remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_JUNIOR); final float clientversion = remoteSeed.getVersion(); int urls = -1; @@ -139,22 +139,22 @@ public class hello { // assign status if (urls >= 0) { - if (remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR) == null) { - prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_SENIOR); - remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR); - } else if (remoteSeed.get(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_PRINCIPAL).equals(serverSwitch.PEERTYPE_PRINCIPAL)) { - prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_PRINCIPAL); + if (remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) == null) { + prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_SENIOR); + remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR); + } else if (remoteSeed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_PRINCIPAL).equals(yacySeed.PEERTYPE_PRINCIPAL)) { + prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_PRINCIPAL); } else { - prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_SENIOR); - remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_SENIOR); + prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_SENIOR); + remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR); } // connect the seed yacyCore.peerActions.peerArrival(remoteSeed, true); } else { - prop.put(STR_YOURTYPE, serverSwitch.PEERTYPE_JUNIOR); + prop.put(STR_YOURTYPE, yacySeed.PEERTYPE_JUNIOR); remoteSeed.put(STR_LASTSEEN, yacyCore.universalDateShortString()); yacyCore.peerActions.juniorConnects++; // update statistics - remoteSeed.put(serverSwitch.PEERTYPE, serverSwitch.PEERTYPE_JUNIOR); + remoteSeed.put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_JUNIOR); yacyCore.log.logInfo("hello: responded remote junior peer '" + remoteSeed.getName() + "' from " + reportedip); // no connection here, instead store junior in connection cache if ((remoteSeed.hash != null) && (remoteSeed.isProper() == null)) { diff --git a/source/de/anomic/server/serverSwitch.java b/source/de/anomic/server/serverSwitch.java index 1fb3f9708..0275a92fe 100644 --- a/source/de/anomic/server/serverSwitch.java +++ b/source/de/anomic/server/serverSwitch.java @@ -55,12 +55,6 @@ import de.anomic.server.logging.serverLog; public interface serverSwitch { - public static final String PEERTYPE = "PeerType"; - public static final String PEERTYPE_VIRGIN = "virgin"; - public static final String PEERTYPE_JUNIOR = "junior"; - public static final String PEERTYPE_SENIOR = "senior"; - public static final String PEERTYPE_PRINCIPAL = "principal"; - // the root path for the application public String getRootPath(); diff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.java index 8469dbdd1..1d93ccb66 100644 --- a/source/de/anomic/yacy/yacySeed.java +++ b/source/de/anomic/yacy/yacySeed.java @@ -82,7 +82,6 @@ public class yacySeed { public static final String PEERTYPE_JUNIOR = "junior"; public static final String PEERTYPE_SENIOR = "senior"; public static final String PEERTYPE_PRINCIPAL = "principal"; - public static final String PEERTYPE = "PeerType"; // class variables diff --git a/yacy.init b/yacy.init index 1c9832a38..544d75238 100644 --- a/yacy.init +++ b/yacy.init @@ -437,23 +437,23 @@ xpstopw=true # ram cache for database files -# ram cache for assortment cache cluster (for all 50 files) +# ram cache for assortment cache cluster (for all 64 files) ramCacheRWI = 8388608 # ram cache for responseHeader.db -ramCacheHTTP = 1048576 +ramCacheHTTP = 4194304 # ram cache for urlHash.db ramCacheLURL = 4194304 # ram cache for urlNotice.db -ramCacheNURL = 524288 +ramCacheNURL = 4194304 # ram cache for urlErr.db -ramCacheEURL = 131072 +ramCacheEURL = 8192 # ram cache for seedDBs -ramCacheDHT = 131072 +ramCacheDHT = 8192 # ram cache for message.db ramCacheMessage = 8192