added another sixcooler suggestion: recycle corrupted records

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6647 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent fe78edac32
commit ef9473d92c

@ -29,6 +29,7 @@ import java.io.DataInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -225,6 +226,11 @@ public class HeapReader {
indexready.consume(key, seek); indexready.consume(key, seek);
key = new byte[keylength]; key = new byte[keylength];
} else { } 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); Log.logWarning("kelondroBLOBHeap", "BLOB " + heapFile.getName() + ": skiped not wellformed key " + new String(key) + " at seek pos " + seek);
} }
} }

Loading…
Cancel
Save