From 370c481fa7e9c13a741dacffd9c32de694d7e764 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 2 Jun 2006 22:46:32 +0000 Subject: [PATCH] bugfixes git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2171 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../anomic/kelondro/kelondroCollection.java | 2 ++ .../kelondro/kelondroFScoreCluster.java | 2 +- source/de/anomic/kelondro/kelondroIndex.java | 4 ---- .../de/anomic/kelondro/kelondroMapTable.java | 2 +- source/de/anomic/kelondro/kelondroTree.java | 22 ------------------- .../de/anomic/plasma/plasmaWordIndexFile.java | 4 ++-- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroCollection.java b/source/de/anomic/kelondro/kelondroCollection.java index 551518225..f3a142b5c 100644 --- a/source/de/anomic/kelondro/kelondroCollection.java +++ b/source/de/anomic/kelondro/kelondroCollection.java @@ -93,6 +93,7 @@ public class kelondroCollection { chunkcount++; this.orderkey = null; } + this.lastTimeWrote = System.currentTimeMillis(); } public void addAll(kelondroCollection c) { @@ -129,6 +130,7 @@ public class kelondroCollection { if ((p < 0) || (p >= chunkcount)) return; // out of bounds, nothing to delete System.arraycopy(chunkcache, (p + 1) * chunksize, chunkcache, p * chunksize, (chunkcount - p - 1) * chunksize); chunkcount--; + this.lastTimeWrote = System.currentTimeMillis(); } private int find(byte[] a) { diff --git a/source/de/anomic/kelondro/kelondroFScoreCluster.java b/source/de/anomic/kelondro/kelondroFScoreCluster.java index 7dc89323c..cf41f3fc9 100644 --- a/source/de/anomic/kelondro/kelondroFScoreCluster.java +++ b/source/de/anomic/kelondro/kelondroFScoreCluster.java @@ -143,7 +143,7 @@ public class kelondroFScoreCluster { } public Object next() { - String s = new String(((byte[][]) iterator.next())[0]); + String s = new String(((kelondroRow.Entry) iterator.next()).getColString(0, null)); return s.substring(countlength) + "-" + kelondroBase64Order.enhancedCoder.decodeLong(s.substring(0, countlength)); } diff --git a/source/de/anomic/kelondro/kelondroIndex.java b/source/de/anomic/kelondro/kelondroIndex.java index fbfbac386..c20bb3b2a 100644 --- a/source/de/anomic/kelondro/kelondroIndex.java +++ b/source/de/anomic/kelondro/kelondroIndex.java @@ -59,9 +59,5 @@ public interface kelondroIndex { public kelondroRow.Entry get(byte[] key) throws IOException; public kelondroRow.Entry put(kelondroRow.Entry row) throws IOException; public kelondroRow.Entry remove(byte[] key) throws IOException; - //public Iterator rows(boolean up, boolean rotating, byte[] startKey) throws IOException; // Objects are of type byte[][] - //public Iterator keys(boolean up, boolean rotating, byte[] startKey) throws IOException; // Objects are of type String - //public TreeMap rowMap(boolean up, boolean rotating, byte[] firstKey, boolean including, int count) throws IOException; - //public TreeSet keySet(boolean up, boolean rotating, byte[] firstKey, boolean including, int count) throws IOException; } diff --git a/source/de/anomic/kelondro/kelondroMapTable.java b/source/de/anomic/kelondro/kelondroMapTable.java index 54979a9c7..8f8574675 100644 --- a/source/de/anomic/kelondro/kelondroMapTable.java +++ b/source/de/anomic/kelondro/kelondroMapTable.java @@ -150,7 +150,7 @@ public class kelondroMapTable { return table.maps(up, field); } - public synchronized Iterator /* of byte[][]-Elements */ rows(String tablename, boolean up, boolean rotating, byte[] firstKey) throws IOException { + public synchronized Iterator /* of kelondroRow.Entry-Elements */ rows(String tablename, boolean up, boolean rotating, byte[] firstKey) throws IOException { kelondroTree tree = (kelondroTree) tTables.get(tablename); if (tree == null) throw new RuntimeException("kelondroTables.bytes: tree table '" + tablename + "' does not exist."); return tree.rows(up, rotating, firstKey); diff --git a/source/de/anomic/kelondro/kelondroTree.java b/source/de/anomic/kelondro/kelondroTree.java index 5d113f996..284ec3156 100644 --- a/source/de/anomic/kelondro/kelondroTree.java +++ b/source/de/anomic/kelondro/kelondroTree.java @@ -241,28 +241,6 @@ public class kelondroTree extends kelondroRecords implements kelondroIndex { } return result; } - /* - public byte[][] get(byte[] key) throws IOException { - // System.out.println("kelondroTree.get " + new String(key) + " in " + filename); - kelondroRow.Entry result = (objectCache == null) ? null : (kelondroRow.Entry) objectCache.get(key); - if (result != null) { - //System.out.println("cache hit in objectCache, db:" + super.filename); - return result.getCols(); - } - if ((objectCache != null) && (objectCache.has(key) == -1)) return null; - synchronized (writeSearchObj) { - writeSearchObj.process(key); - if (writeSearchObj.found()) { - result = row().newEntry(writeSearchObj.getMatcher().getValueRow()); - if (objectCache != null) objectCache.put(key, result); - } else { - result = null; - if (objectCache != null) objectCache.hasnot(key); - } - } - return (result == null) ? null : result.getCols(); - } -*/ public class Search { diff --git a/source/de/anomic/plasma/plasmaWordIndexFile.java b/source/de/anomic/plasma/plasmaWordIndexFile.java index 7a9c01b5f..61eb61759 100644 --- a/source/de/anomic/plasma/plasmaWordIndexFile.java +++ b/source/de/anomic/plasma/plasmaWordIndexFile.java @@ -236,8 +236,8 @@ public final class plasmaWordIndexFile { } public Object next() { if (i == null) return null; - byte[][] n = (byte[][]) i.next(); - return new indexURLEntry(new String(n[0]), new String(n[1])); + kelondroRow.Entry n = (kelondroRow.Entry) i.next(); + return new indexURLEntry(n.getColString(0, null), n.getColString(1, null)); } public void remove() { throw new UnsupportedOperationException();