git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2171 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2006-06-02 22:46:32 +00:00
parent 8e5e111ec8
commit 370c481fa7
6 changed files with 6 additions and 30 deletions

View File

@ -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) {

View File

@ -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));
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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 {

View File

@ -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();