bugfix for startup problems

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@850 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent a9c466ef21
commit 6d5d0ac801

@ -65,14 +65,14 @@ You can <a href="http://java.sun.com/j2se/1.4.2/download.html">download the Java
</p>
<p><b>Latest Release:</b>
The latest YaCy release version is 0.40<br>
The latest YaCy release version is 0.41<br>
Nightly builds from compiles out of SVN can be obtained from <a href="http://devbin.yacy-forum.de/">http://devbin.yacy-forum.de/</a>.<br>
<p>Main releases of YaCy are hosted on <a href="http://www.yacy.net/yacy/">yacy.net</a>, <a href="http://developer.berlios.de/projects/yacy/">yacy@BerliOS.de</a> and <a href="http://freshmeat.net/projects/yacyproxy/">yacy@freshmeat.net</a>.<br>
Download Mirrors and YaCy Flavours:
<ul>
<li>Generic release of YaCy (all platforms with J2SE 1.4.2: Linux, Mac OS X, Windows, Solaris):</li>
<ul>
<li><tt>from yacy.net&nbsp;&nbsp;&nbsp;: <a href="http://www.yacy.net/yacy/release/yacy_v0.40_20050816_547.tar.gz"><tt>yacy_v0.40_20050816_547.tar.gz</tt></a></tt></li>
<li><tt>from yacy.net&nbsp;&nbsp;&nbsp;: <a href="http://www.yacy.net/yacy/release/yacy_v0.41_20051004_848.tar.gz"><tt>yacy_v0.41_20051004_848.tar.gz</tt></a></tt></li>
<li><tt>from BerliOS.de&nbsp;: <a href="http://download.berlios.de/yacy/yacy_v0.40_20050816_547.tar.gz"><tt>yacy_v0.40_20050816_547.tar.gz</tt></a></tt></li>
</ul>
<li>Windows-flavour release of YaCy (same code as generic release, but with convenient Windows-Installer):</li>

@ -134,16 +134,16 @@ public class kelondroRecords {
private Handle FREEH; // pointer to first element in list of free Nodes, empty = NUL
private short OHBYTEC; // number of extra bytes in each node
private short OHHANDLEC; // number of handles in each node
private int COLWIDTHS[]; // array with widths of columns
protected int COLWIDTHS[]; // array with widths of columns
private Handle HANDLES[]; // array with handles
private byte[] TXTPROPS[]; // array with text properties
private int TXTPROPW; // size of a single TXTPROPS element
// caching buffer
private HashMap[] XcacheHeaders; // the cache; holds overhead values and key element
private int XcacheSize; // number of cache records
private long XcacheStartup; // startup time; for cache aging
private kelondroMScoreCluster cacheScore; // controls cache aging
protected HashMap[] XcacheHeaders; // the cache; holds overhead values and key element
protected int XcacheSize; // number of cache records
protected long XcacheStartup; // startup time; for cache aging
protected kelondroMScoreCluster cacheScore; // controls cache aging
public kelondroRecords(File file, long buffersize /* bytes */,
@ -345,7 +345,7 @@ public class kelondroRecords {
return new File(filename);
}
private int cacheChunkSize(boolean cacheControl) {
protected int cacheChunkSize(boolean cacheControl) {
return this.headchunksize + element_in_cache + ((cacheControl) ? cache_control_entry : 0);
}

@ -91,6 +91,20 @@ public class kelondroStack extends kelondroRecords {
setHandle(toor, null); // reset the toor value
}
public static kelondroStack reset(kelondroStack stack) throws IOException {
// memorize settings to this file
File f = new File(stack.filename);
long bz = stack.XcacheSize * stack.cacheChunkSize(true);
int[] cols = stack.COLWIDTHS;
// close and delete the file
try {stack.close();} catch (Exception e) {};
if (f.exists()) f.delete();
// re-open a database with same settings as before
return new kelondroStack(f, bz, cols);
}
public class Counter implements Iterator {
Handle nextHandle = null;
public Counter() throws IOException {

@ -70,6 +70,11 @@ public class plasmaCrawlBalancer {
stack = null;
}
public void reset() throws IOException {
stack = kelondroStack.reset(stack);
domainStacks = new HashMap();
}
public Iterator iterator() {
// iterates byte[] - objects
return new KeyIterator(stack.iterator());

@ -146,21 +146,13 @@ public class plasmaCrawlNURL extends plasmaURL {
public void run() {
Iterator i;
try {
//System.out.println("init coreStack index");
i = coreStack.iterator(); while (i.hasNext()) stackIndex.add(new String((byte[]) i.next()));
//System.out.println("init limitStack index");
i = limitStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("init overhangStack index");
i = overhangStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("init remoteStack index");
i = remoteStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("init imageStack index");
i = imageStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("init movieStack index");
i = movieStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("init musicStack index");
i = musicStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));
//System.out.println("finished index init");
try { i = coreStack.iterator(); while (i.hasNext()) stackIndex.add(new String((byte[]) i.next()));} catch (Exception e) {coreStack.reset();}
try { i = limitStack.iterator(); while (i.hasNext()) stackIndex.add(new String((byte[]) i.next()));} catch (Exception e) {limitStack.reset();}
try { i = overhangStack.iterator(); while (i.hasNext()) stackIndex.add(new String((byte[]) i.next()));} catch (Exception e) {overhangStack.reset();}
try { i = remoteStack.iterator(); while (i.hasNext()) stackIndex.add(new String((byte[]) i.next()));} catch (Exception e) {remoteStack.reset();}
try { i = imageStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));} catch (Exception e) {imageStack = kelondroStack.reset(imageStack);}
try { i = movieStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));} catch (Exception e) {movieStack = kelondroStack.reset(movieStack);}
try { i = musicStack.iterator(); while (i.hasNext()) stackIndex.add(new String(((kelondroRecords.Node) i.next()).getKey()));} catch (Exception e) {musicStack = kelondroStack.reset(musicStack);}
} catch (IOException e) {}
}
}

@ -96,17 +96,22 @@ public class enumerateFiles implements Enumeration {
if (f.isDirectory()) {
t = new TreeSet();
String[] l = f.list();
if (l.length == 0) {
if (delete_emptyFolders) {
f.delete();
f = null;
if (l == null) {
// f has disappeared
f = null;
} else {
if (l.length == 0) {
if (delete_emptyFolders) {
f.delete();
f = null;
} else {
if (!(return_folders)) f = null;
}
} else {
for (int i = 0; i < l.length; i++) t.add(new File(f, l[i]));
hierarchy.add(t);
if (!(return_folders)) f = null;
}
} else {
for (int i = 0; i < l.length; i++) t.add(new File(f, l[i]));
hierarchy.add(t);
if (!(return_folders)) f = null;
}
} else {
if (!(return_files)) f = null;

Loading…
Cancel
Save