From ef9473d92cc5d451d05ff8a8bd00221aa74566a2 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 4 Feb 2010 16:25:05 +0000 Subject: [PATCH] added another sixcooler suggestion: recycle corrupted records git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6647 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/kelondro/blob/HeapReader.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/net/yacy/kelondro/blob/HeapReader.java b/source/net/yacy/kelondro/blob/HeapReader.java index e93e3a33c..d39221be0 100644 --- a/source/net/yacy/kelondro/blob/HeapReader.java +++ b/source/net/yacy/kelondro/blob/HeapReader.java @@ -29,6 +29,7 @@ import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.util.Arrays; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; @@ -225,6 +226,11 @@ public class HeapReader { indexready.consume(key, seek); key = new byte[keylength]; } else { + // free the lost space + free.put(seek, reclen); + file.seek(seek + 4); + Arrays.fill(key, (byte) 0); + file.write(key); // mark the place as empty record Log.logWarning("kelondroBLOBHeap", "BLOB " + heapFile.getName() + ": skiped not wellformed key " + new String(key) + " at seek pos " + seek); } }