From 083533e5ec8674d9569a39b70486c451f69e3790 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 4 May 2009 21:37:59 +0000 Subject: [PATCH] fix for bugs in IODispatcher git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5921 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/index/RowSet.java | 17 ++++++++++++++-- .../de/anomic/kelondro/text/IODispatcher.java | 20 +++++++++++++++---- source/de/anomic/plasma/plasmaWordIndex.java | 6 ------ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/source/de/anomic/kelondro/index/RowSet.java b/source/de/anomic/kelondro/index/RowSet.java index 9ecf5637a..5deb740f7 100644 --- a/source/de/anomic/kelondro/index/RowSet.java +++ b/source/de/anomic/kelondro/index/RowSet.java @@ -33,6 +33,7 @@ import java.util.Random; import de.anomic.kelondro.order.Base64Order; import de.anomic.kelondro.order.CloneableIterator; import de.anomic.kelondro.order.NaturalOrder; +import de.anomic.kelondro.util.Log; public class RowSet extends RowCollection implements ObjectIndex, Iterable { @@ -410,8 +411,20 @@ public class RowSet extends RowCollection implements ObjectIndex, Iterable extends Thread { // prefer dump actions to flush memory to disc if (dumpQueue.size() > 0) { + File f = null; try { dumpJob = dumpQueue.take(); + f = dumpJob.file; dumpJob.dump(); } catch (InterruptedException e) { - e.printStackTrace(); Log.logSevere("IODispatcher", "main run job was interrupted (1)", e); + e.printStackTrace(); + } catch (Exception e) { + Log.logSevere("IODispatcher", "main run job had errors (1), dump to " + f + " failed.", e); + e.printStackTrace(); } continue loop; } // otherwise do a merge operation if (mergeQueue.size() > 0) { + File f = null, f1 = null, f2 = null; try { mergeJob = mergeQueue.take(); + f = mergeJob.newFile; + f1 = mergeJob.f1; + f2 = mergeJob.f2; mergeJob.merge(); } catch (InterruptedException e) { - e.printStackTrace(); Log.logSevere("IODispatcher", "main run job was interrupted (2)", e); + e.printStackTrace(); + } catch (Exception e) { + Log.logSevere("IODispatcher", "main run job had errors (2), dump to " + f + " failed. Input files are " + f1 + " and " + f2, e); + e.printStackTrace(); } continue loop; } @@ -167,11 +179,11 @@ public class IODispatcher extends Thread { } Log.logInfo("IODispatcher", "loop terminated"); } catch (InterruptedException e) { - e.printStackTrace(); Log.logSevere("IODispatcher", "main run job was interrupted (3)", e); - } catch (Exception e) { e.printStackTrace(); + } catch (Exception e) { Log.logSevere("IODispatcher", "main run job failed (4)", e); + e.printStackTrace(); } finally { Log.logInfo("IODispatcher", "terminating run job"); controlQueue = null; diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java index 2b2a77f55..86d732b81 100644 --- a/source/de/anomic/plasma/plasmaWordIndex.java +++ b/source/de/anomic/plasma/plasmaWordIndex.java @@ -429,12 +429,6 @@ public final class plasmaWordIndex { final int urlLength = url.toNormalform(true, true).length(); final int urlComps = htmlFilterContentScraper.urlComps(url.toString()).length; - // check if merger is running - if (this.merger != null && !this.merger.isAlive()) { - log.logSevere("re-starting IODispatcher"); - this.merger.start(); - } - // iterate over all words of context text final Iterator> i = condenser.words().entrySet().iterator(); Map.Entry wentry;