mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@768 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
1dd7047af5
commit
18d9e1a256
|
@ -333,6 +333,11 @@ public class kelondroRecords {
|
|||
this.XcacheStartup = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public File file() {
|
||||
if (filename == null) return null;
|
||||
return new File(filename);
|
||||
}
|
||||
|
||||
private int cacheChunkSize(boolean cacheControl) {
|
||||
return this.headchunksize + element_in_cache + ((cacheControl) ? cache_control_entry : 0);
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ import java.util.TreeMap;
|
|||
|
||||
import de.anomic.kelondro.kelondroRecords;
|
||||
import de.anomic.kelondro.kelondroTree;
|
||||
import de.anomic.kelondro.kelondroException;
|
||||
|
||||
public class plasmaWordIndexEntity {
|
||||
|
||||
|
@ -237,18 +238,29 @@ public class plasmaWordIndexEntity {
|
|||
public class dbenum implements Enumeration {
|
||||
Iterator i;
|
||||
public dbenum(boolean up) {
|
||||
i = theIndex.nodeIterator(up, false);
|
||||
try {
|
||||
i = theIndex.nodeIterator(up, false);
|
||||
} catch (kelondroException e) {
|
||||
e.printStackTrace();
|
||||
theIndex.file().delete();
|
||||
i = null;
|
||||
}
|
||||
}
|
||||
public boolean hasMoreElements() {
|
||||
return i.hasNext();
|
||||
return (i != null) && (i.hasNext());
|
||||
}
|
||||
public Object nextElement() {
|
||||
if (i == null) return null;
|
||||
try {
|
||||
byte[][] n = ((kelondroRecords.Node) i.next()).getValues();
|
||||
return new plasmaWordIndexEntry(new String(n[0]), new String(n[1]));
|
||||
} catch (IOException e) {
|
||||
i = null;
|
||||
throw new RuntimeException("dbenum: " + e.getMessage());
|
||||
}
|
||||
} catch (kelondroException e) {
|
||||
i = null;
|
||||
throw new RuntimeException("dbenum: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
public class tmpenum implements Enumeration {
|
||||
|
|
Loading…
Reference in New Issue
Block a user