auto-delete of corrupted word files during word-migration

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

@ -574,6 +574,7 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
return -container.size();
} else {
// the combined container will fit, read the container
try {
Iterator entries = entity.elements(true);
plasmaWordIndexEntry entry;
while (entries.hasNext()) {
@ -586,6 +587,12 @@ public final class plasmaWordIndexCache implements plasmaWordIndexInterface {
// integrate the container into the assortments; this will work
assortmentCluster.storeTry(wordhash, container);
return size;
} catch (kelondroException e) {
// database corrupted, we simply give up the database and delete it
try {entity.close();} catch (Exception ee) {} entity = null;
try {db.delete();} catch (Exception ee) {}
return 0;
}
}
}
} finally {

@ -663,7 +663,7 @@ public final class yacy {
wordhash = wordfile.getName().substring(0, 12);
migration = wordIndexCache.migrateWords2Assortment(wordhash);
if (migration == 0)
log.logInfo("SKIPPED " + wordhash + ": too big");
log.logInfo("SKIPPED " + wordhash + ": " + ((wordfile.exists()) ? "too big" : "database corrupted; deleted"));
else if (migration > 0)
log.logInfo("MIGRATED " + wordhash + ": " + migration + " entries");
else

Loading…
Cancel
Save