From 33aafa9b4b560ee177fcae39d53390bc27ba4817 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 19 Jun 2009 17:02:50 +0000 Subject: [PATCH] better logging when writing merged dumps git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6098 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/kelondro/blob/HeapWriter.java | 24 ++++++++----------- .../text/ReferenceContainerCache.java | 3 +-- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/source/de/anomic/kelondro/blob/HeapWriter.java b/source/de/anomic/kelondro/blob/HeapWriter.java index 3567b6d02..02557e675 100644 --- a/source/de/anomic/kelondro/blob/HeapWriter.java +++ b/source/de/anomic/kelondro/blob/HeapWriter.java @@ -154,21 +154,17 @@ public final class HeapWriter { if (writeIDX && index.size() > 3) { // now we can create a dump of the index and the gap information // to speed up the next start - try { - long start = System.currentTimeMillis(); - String fingerprint = HeapWriter.fingerprintFileHash(this.heapFileREADY); - if (fingerprint == null) { - Log.logSevere("kelondroBLOBHeapWriter", "cannot write a dump for " + heapFileREADY.getName()+ ": fingerprint is null"); - } else { - new Gap().dump(fingerprintGapFile(this.heapFileREADY, fingerprint)); - index.dump(fingerprintIndexFile(this.heapFileREADY, fingerprint)); - Log.logInfo("kelondroBLOBHeapWriter", "wrote a dump for the " + this.index.size() + " index entries of " + heapFileREADY.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds."); - } - index.close(); - index = null; - } catch (IOException e) { - e.printStackTrace(); + long start = System.currentTimeMillis(); + String fingerprint = HeapWriter.fingerprintFileHash(this.heapFileREADY); + if (fingerprint == null) { + Log.logSevere("kelondroBLOBHeapWriter", "cannot write a dump for " + heapFileREADY.getName()+ ": fingerprint is null"); + } else { + new Gap().dump(fingerprintGapFile(this.heapFileREADY, fingerprint)); + index.dump(fingerprintIndexFile(this.heapFileREADY, fingerprint)); + Log.logInfo("kelondroBLOBHeapWriter", "wrote a dump for the " + this.index.size() + " index entries of " + heapFileREADY.getName()+ " in " + (System.currentTimeMillis() - start) + " milliseconds."); } + index.close(); + index = null; } else { // this is small.. just free resources, do not write index index.close(); diff --git a/source/de/anomic/kelondro/text/ReferenceContainerCache.java b/source/de/anomic/kelondro/text/ReferenceContainerCache.java index f5f23c1b1..6732e1e7b 100644 --- a/source/de/anomic/kelondro/text/ReferenceContainerCache.java +++ b/source/de/anomic/kelondro/text/ReferenceContainerCache.java @@ -133,8 +133,7 @@ public final class ReferenceContainerCache exte dump.close(true); Log.logInfo("indexContainerRAMHeap", "finished rwi heap dump: " + wordcount + " words, " + urlcount + " word/URL relations in " + (System.currentTimeMillis() - startTime) + " milliseconds"); } catch (IOException e) { - e.printStackTrace(); - Log.logInfo("indexContainerRAMHeap", "failed rwi heap dump: " + e.getMessage()); + Log.logSevere("indexContainerRAMHeap", "failed rwi heap dump: " + e.getMessage(), e); } finally { dump = null; }