no exception in case of uniq() time-out, see also

http://forum.yacy-websuche.de/viewtopic.php?p=13177#p13177

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5955 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 1efe686e3f
commit ad9762746d

@ -762,23 +762,20 @@ public class RowCollection implements Iterable<Row.Entry> {
int i = chunkcount - 2; int i = chunkcount - 2;
final long t = System.currentTimeMillis(); // for time-out final long t = System.currentTimeMillis(); // for time-out
int d = 0; int d = 0;
boolean u = true;
try { try {
while (i >= 0) { while (i >= 0) {
if (match(i, i + 1)) { if (match(i, i + 1)) {
removeRow(i + 1, true); removeRow(i + 1, true);
d++; d++;
if (i + 1 < chunkcount - 1) u = false;
} }
i--; i--;
if (System.currentTimeMillis() - t > 60000) { if (System.currentTimeMillis() - t > 60000) {
throw new RuntimeException("uniq() time-out at " + i + " (backwards) from " + chunkcount + " elements after " + (System.currentTimeMillis() - t) + " milliseconds; " + d + " deletions so far"); Log.logWarning("RowCollection", "uniq() time-out at " + i + " (backwards) from " + chunkcount + " elements after " + (System.currentTimeMillis() - t) + " milliseconds; " + d + " deletions so far");
return;
} }
} }
} catch (final RuntimeException e) { } catch (final RuntimeException e) {
Log.logWarning("kelondroRowCollection", e.getMessage(), e); Log.logWarning("RowCollection", e.getMessage(), e);
} finally {
if (!u) this.sort();
} }
} }

Loading…
Cancel
Save