download the Java
Latest Release:
The latest YaCy release version is 0.45
Nightly builds from compiles out of SVN can be obtained from http://latest.yacy-forum.de/.
-
Main releases of YaCy are hosted on yacy.net, yacy@BerliOS.de and yacy@freshmeat.net.
+
Main releases of YaCy are hosted on yacy.net, yacy@BerliOS.de and yacy@freshmeat.net.
Download Mirrors and YaCy Flavours:
- Generic release of YaCy (all platforms with J2SE 1.4.2: Linux, Mac OS X, Windows, Solaris):
diff --git a/source/de/anomic/index/indexURL.java b/source/de/anomic/index/indexURL.java
index 36f6658ff..83f72d652 100644
--- a/source/de/anomic/index/indexURL.java
+++ b/source/de/anomic/index/indexURL.java
@@ -1,3 +1,29 @@
+// indexURL.java
+// (C) 2006 by Michael Peter Christen; mc@anomic.de, Frankfurt a. M., Germany
+// first published 20.05.2006 on http://www.anomic.de
+//
+// This is a part of YaCy, a peer-to-peer based web search engine
+//
+// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
+// $LastChangedRevision: 1986 $
+// $LastChangedBy: orbiter $
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
package de.anomic.index;
import java.io.IOException;
@@ -391,6 +417,15 @@ public class indexURL {
return urlHashCache.size();
}
+ public boolean remove(String hash) {
+ try {
+ urlHashCache.remove(hash.getBytes());
+ return true;
+ } catch (IOException e) {
+ return false;
+ }
+ }
+
public void close() throws IOException {
if (urlHashCache != null) urlHashCache.close();
}
diff --git a/source/de/anomic/kelondro/kelondroObjectCache.java b/source/de/anomic/kelondro/kelondroObjectCache.java
index 518dc9163..8cf603e21 100644
--- a/source/de/anomic/kelondro/kelondroObjectCache.java
+++ b/source/de/anomic/kelondro/kelondroObjectCache.java
@@ -66,8 +66,8 @@ public class kelondroObjectCache {
private int maxSize;
private long maxAge;
private long minMem;
- private int readHit, readMiss, writeUnique, writeDouble;
- private int hasnotHit, hasnotMiss, hasnotUnique, hasnotDouble;
+ private int readHit, readMiss, writeUnique, writeDouble, cacheFlush;
+ private int hasnotHit, hasnotMiss, hasnotUnique, hasnotDouble, hasnotFlush;
private String name;
public kelondroObjectCache(String name, int maxSize, long maxAge, long minMem) {
@@ -83,10 +83,12 @@ public class kelondroObjectCache {
this.readMiss = 0;
this.writeUnique = 0;
this.writeDouble = 0;
+ this.cacheFlush = 0;
this.hasnotHit = 0;
this.hasnotMiss = 0;
this.hasnotUnique = 0;
this.hasnotDouble = 0;
+ this.hasnotFlush = 0;
}
public String getName() {
@@ -133,7 +135,13 @@ public class kelondroObjectCache {
Integer.toString(readHit),
Integer.toString(readMiss),
Integer.toString(writeUnique),
- Integer.toString(writeDouble)
+ Integer.toString(writeDouble),
+ Integer.toString(cacheFlush),
+ Integer.toString(hasnotHit),
+ Integer.toString(hasnotMiss),
+ Integer.toString(hasnotUnique),
+ Integer.toString(hasnotDouble),
+ Integer.toString(hasnotFlush)
};
}
@@ -147,7 +155,13 @@ public class kelondroObjectCache {
Integer.toString(Integer.parseInt(a[5]) + Integer.parseInt(b[5])),
Integer.toString(Integer.parseInt(a[6]) + Integer.parseInt(b[6])),
Integer.toString(Integer.parseInt(a[7]) + Integer.parseInt(b[7])),
- Integer.toString(Integer.parseInt(a[8]) + Integer.parseInt(b[8]))
+ Integer.toString(Integer.parseInt(a[8]) + Integer.parseInt(b[8])),
+ Integer.toString(Integer.parseInt(a[9]) + Integer.parseInt(b[9])),
+ Integer.toString(Integer.parseInt(a[10]) + Integer.parseInt(b[10])),
+ Integer.toString(Integer.parseInt(a[11]) + Integer.parseInt(b[11])),
+ Integer.toString(Integer.parseInt(a[12]) + Integer.parseInt(b[12])),
+ Integer.toString(Integer.parseInt(a[13]) + Integer.parseInt(b[13])),
+ Integer.toString(Integer.parseInt(a[14]) + Integer.parseInt(b[14]))
};
}
@@ -183,29 +197,14 @@ public class kelondroObjectCache {
}
public Object get(byte[] key) {
- if (key == null) return null;
- String keys = new String(key);
- Object r = cache.get(keys);
- flushc();
- if (r == null) {
- this.readMiss++;
- } else {
- hasnot.deleteScore(keys);
- this.readHit++;
- }
- return r;
+ return get(new String(key));
}
public Object get(String key) {
if (key == null) return null;
Object r = cache.get(key);
flushc();
- if (r == null) {
- this.readMiss++;
- } else {
- hasnot.deleteScore(key);
- this.readHit++;
- }
+ if (r == null) this.readMiss++; else this.readHit++;
return r;
}
@@ -272,6 +271,7 @@ public class kelondroObjectCache {
) {
cache.remove(k);
ages.deleteScore(k);
+ cacheFlush++;
}
}
}
@@ -286,7 +286,7 @@ public class kelondroObjectCache {
(Runtime.getRuntime().freeMemory() < minMem))
) {
hasnot.deleteScore(k);
-
+ hasnotFlush++;
}
}
}
diff --git a/source/de/anomic/plasma/plasmaCrawlEURL.java b/source/de/anomic/plasma/plasmaCrawlEURL.java
index dce1821e8..1ea59d51d 100644
--- a/source/de/anomic/plasma/plasmaCrawlEURL.java
+++ b/source/de/anomic/plasma/plasmaCrawlEURL.java
@@ -125,14 +125,6 @@ public class plasmaCrawlEURL extends indexURL {
}
}
- public boolean remove(String urlHash) {
- try {
- return (this.urlHashCache.remove(urlHash.getBytes()) != null);
- } catch (IOException e) {
- return false;
- }
- }
-
public void clearStack() {
rejectedStack.clear();
}
diff --git a/source/de/anomic/plasma/plasmaCrawlLURL.java b/source/de/anomic/plasma/plasmaCrawlLURL.java
index e2e316701..dba489f81 100644
--- a/source/de/anomic/plasma/plasmaCrawlLURL.java
+++ b/source/de/anomic/plasma/plasmaCrawlLURL.java
@@ -269,10 +269,12 @@ public final class plasmaCrawlLURL extends indexURL {
}
public boolean remove(String urlHash) {
+ if (!super.remove(urlHash)) return false;
for (int stack = 1; stack <= 6; stack++) {
for (int i = getStackSize(stack) - 1; i >= 0; i--) {
if (getUrlHash(stack,i).equals(urlHash)) {
- return removeStack(stack,i);
+ removeStack(stack,i);
+ return true;
}
}
}
diff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.java
index cb8e6cd9b..c32f50161 100644
--- a/source/de/anomic/plasma/plasmaCrawlNURL.java
+++ b/source/de/anomic/plasma/plasmaCrawlNURL.java
@@ -442,14 +442,6 @@ public class plasmaCrawlNURL extends indexURL {
return new Entry(hash);
}
- public synchronized boolean remove(String hash) {
- try {
- return (urlHashCache.remove(hash.getBytes())!=null);
- } catch (IOException e) {
- return false;
- }
- }
-
public class Entry {
private String initiator; // the initiator hash, is NULL or "" if it is the own proxy;
// if this is generated by a crawl, the own peer hash in entered