Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- changed seed file storage to clear text - fixed kill script - fixed saving of seed file (had been corrupted by latest changes) - some refactoring
orbiter78087da2878b
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 1516677dd..dbbc5a75c 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -435,14 +435,6 @@ browserPopUpTrigger=truebrowserPopUpPage=Status.htmlbrowserPopUpApplication=netscape-# the proxy saves it's own seed information. It is positive for the network if-# the seed does not change it's configuration often (or not at all).-# The reason for that is that the seed hash is the target for the-# distributed hash table distribution function.-# The following file will contain the saved seed:-yacyOwnSeedFile=DATA/YACYDB/mySeed.txt-yacyDB=DATA/YACYDB-# index sharing attributes: by default, sharing is on.# If you want to use YaCy only for local indexing (robinson mode),# you may switch this offdiff --git a/killYACY.sh b/killYACY.shindex 6c44e28f0..9790166f2 100755--- a/killYACY.sh+++ b/killYACY.sh@@ -4,7 +4,7 @@# To stop YaCy, use stopYACY.shcd `dirname $0`-PID=`fuser DATA/LOG/yacy00.log | awk '{print $2}'`+PID=`fuser DATA/LOG/yacy00.log | awk '{print $1}'`echo "process-id is " $PIDkill -3 $PIDsleep 1diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 202f75121..7363a8a2a 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -627,8 +627,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo* <p>Name of the setting how many active crawler-threads may maximal be running on the same time</p>*/public static final String CRAWLER_THREADS_ACTIVE_MAX = "crawler.MaxActiveThreads";-- public static final String OWN_SEED_FILE = "yacyOwnSeedFile";public static final String YACY_MODE_DEBUG = "yacyDebugMode";public static final String WORDCACHE_INIT_COUNT = "wordCacheInitCount";/**@@ -814,11 +812,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo* @see bookmarksDB for more detailed overview about the bookmarks structure*/public static final String DBFILE_BOOKMARKS_DATES = "bookmarkDates.db";- /**- * <p><code>public static final String <strong>DBFILE_OWN_SEED</strong> = "mySeed.txt"</code></p>- * <p>Name of the file containing the database holding this peer's seed</p>- */- public static final String DBFILE_OWN_SEED = "mySeed.txt";/*** <p><code>public static final String <strong>DBFILE_CRAWL_PROFILES</strong> = "crawlProfiles0.db"</code>* <p>Name of the file containing the database holding all recent crawl profiles</p>@@ -2057,14 +2050,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo}}- /**- * Creates a new File instance with absolute path of ours Seed File.<br>- * @return a new File instance- */- public File getOwnSeedFile() {- return getConfigPath(OWN_SEED_FILE, DBFILE_OWN_SEED);- }-/*** With this function the crawling process can be paused* @param jobTypediff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.javaindex 84e3bc86f..1e3e55720 100644--- a/source/de/anomic/plasma/plasmaWordIndex.java+++ b/source/de/anomic/plasma/plasmaWordIndex.java@@ -120,7 +120,7 @@ public final class plasmaWordIndex implements indexRI {// create or init seed cacheFile networkRoot = new File(this.primaryRoot, "NETWORK");networkRoot.mkdirs();- File mySeedFile = new File(networkRoot, "mySeed.txt");+ File mySeedFile = new File(networkRoot, yacySeedDB.DBFILE_OWN_SEED);File oldSeedFile = new File(new File(indexPrimaryRoot.getParentFile(), "YACYDB"), "mySeed.txt");if (oldSeedFile.exists()) oldSeedFile.renameTo(mySeedFile);seedDB = new yacySeedDB(diff --git a/source/de/anomic/yacy/yacyCore.java b/source/de/anomic/yacy/yacyCore.javaindex 708b5892e..5a4ba2182 100644--- a/source/de/anomic/yacy/yacyCore.java+++ b/source/de/anomic/yacy/yacyCore.java@@ -117,7 +117,6 @@ public class yacyCore {// create a peer news channelRSSFeed peernews = RSSFeed.channels(RSSFeed.PEERNEWS);- peernews.setMaxsize(1000);peernews.addMessage(new RSSMessage("YaCy started", "", ""));loadSeedUploadMethods();@@ -406,7 +405,7 @@ public class yacyCore {// going through the peer list and starting a new publisher thread for each peerint i = 0;- while (si. hasNext()) {+ while (si.hasNext()) {seed = (yacySeed) si.next();if (seed == null) {sync.P();@@ -503,17 +502,15 @@ public class yacyCore {log.logInfo("PeerPing: No data, staying at myType: " + sb.wordIndex.seedDB.mySeed().orVirgin());}- if (newSeeds >= 0) {- // success! we have published our peer to a senior peer- // update latest news from the other peer- // log.logInfo("publish: handshaked " + t.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + t.seed.getName() + "' at " + t.seed.getAddress());- peerActions.saveMySeed();- return newSeeds;- }+ // success! we have published our peer to a senior peer+ // update latest news from the other peer+ // log.logInfo("publish: handshaked " + t.seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR) + " peer '" + t.seed.getName() + "' at " + t.seed.getAddress());+ sb.wordIndex.seedDB.saveMySeed();// if we have an address, we do nothingif (sb.wordIndex.seedDB.mySeed().isProper() == null && !force) { return 0; }-+ if (newSeeds > 0) return newSeeds;+// still no success: ask own NAT or internet responder//final boolean DI604use = switchboard.getConfig("DI604use", "false").equals("true");//final String DI604pw = switchboard.getConfig("DI604pw", "");@@ -526,7 +523,7 @@ public class yacyCore {sb.wordIndex.seedDB.mySeed().put(yacySeed.PEERTYPE, yacySeed.PEERTYPE_SENIOR); // to start bootstraping, we need to be recognised as PEERTYPE_SENIOR peerlog.logInfo("publish: no recipient found, our address is " +((sb.wordIndex.seedDB.mySeed().getPublicAddress() == null) ? "unknown" : sb.wordIndex.seedDB.mySeed().getPublicAddress()));- peerActions.saveMySeed();+ sb.wordIndex.seedDB.saveMySeed();return 0;} catch (InterruptedException e) {try {diff --git a/source/de/anomic/yacy/yacyNewsPool.java b/source/de/anomic/yacy/yacyNewsPool.javaindex d8acaac48..cb2fe774f 100644--- a/source/de/anomic/yacy/yacyNewsPool.java+++ b/source/de/anomic/yacy/yacyNewsPool.java@@ -263,7 +263,6 @@ public class yacyNewsPool {private yacyNewsQueue outgoingNews, publishedNews, incomingNews, processedNews;private int maxDistribution;-public yacyNewsPool(File yacyDBPath) {newsDB = new yacyNewsDB(new File(yacyDBPath, "news.db"));outgoingNews = new yacyNewsQueue(new File(yacyDBPath, "newsOut.stack"), newsDB);diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.javaindex 13dd715c6..84f237e8f 100644--- a/source/de/anomic/yacy/yacyPeerActions.java+++ b/source/de/anomic/yacy/yacyPeerActions.java@@ -127,12 +127,6 @@ public class yacyPeerActions {seedDB.mySeed().setFlagAcceptRemoteIndex(sb.getConfig("allowReceiveIndex", "").equals("true"));//mySeed.setFlagAcceptRemoteIndex(true);}-- public void saveMySeed() {- try {- seedDB.mySeed().save(sb.getOwnSeedFile());- } catch (IOException e) {}- }public void loadSeedLists() {// uses the superseed to initialize the database with known seedsdiff --git a/source/de/anomic/yacy/yacySeed.java b/source/de/anomic/yacy/yacySeed.javaindex bbc91acb6..1351f6aa5 100644--- a/source/de/anomic/yacy/yacySeed.java+++ b/source/de/anomic/yacy/yacySeed.java@@ -875,7 +875,7 @@ public class yacySeed {}public final void save(File f) throws IOException {- final String out = this.genSeedStr('z', null);+ final String out = this.genSeedStr('p', null);final FileWriter fw = new FileWriter(f);fw.write(out, 0, out.length());fw.close();diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.javaindex 9583189b5..53ff67fd8 100644--- a/source/de/anomic/yacy/yacySeedDB.java+++ b/source/de/anomic/yacy/yacySeedDB.java@@ -93,6 +93,12 @@ public final class yacySeedDB implements httpdAlternativeDomainNames {public static final int commonHashLength = 12;public static final int dhtActivityMagic = 32;+ /**+ * <p><code>public static final String <strong>DBFILE_OWN_SEED</strong> = "mySeed.txt"</code></p>+ * <p>Name of the file containing the database holding this peer's seed</p>+ */+ public static final String DBFILE_OWN_SEED = "mySeed.txt";+public static final String[] sortFields = new String[] {yacySeed.LCOUNT, yacySeed.ICOUNT, yacySeed.UPTIME, yacySeed.VERSION, yacySeed.LASTSEEN};public static final String[] longaccFields = new String[] {yacySeed.LCOUNT, yacySeed.ICOUNT, yacySeed.ISPEED};public static final String[] doubleaccFields = new String[] {yacySeed.RSPEED};@@ -215,6 +221,12 @@ public final class yacySeedDB implements httpdAlternativeDomainNames {} catch (IOException e) {}}+ public void saveMySeed() {+ try {+ this.mySeed().save(myOwnSeedFile);+ } catch (IOException e) {}+ }+public boolean noDHTActivity() {// for small networks, we don't perform DHT transmissions, because it is possible to search over all peersreturn this.sizeConnected() <= dhtActivityMagic;