From 60578b45ecf7082551dcef7968fad25374839280 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 3 Oct 2018 16:47:29 +0200 Subject: [PATCH] PdbWriters are now closed by the cache TagsToFile we do not have to close the files when the input streams are idle. --- .../org/lucares/performance/db/PerformanceDb.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java b/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java index e1c2c09..64bf11d 100644 --- a/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java +++ b/performanceDb/src/main/java/org/lucares/performance/db/PerformanceDb.java @@ -9,8 +9,6 @@ import java.util.Iterator; import java.util.List; import java.util.Optional; import java.util.SortedSet; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.stream.Stream; import org.lucares.collections.LongList; @@ -64,7 +62,7 @@ public class PerformanceDb implements AutoCloseable { long nextSync = lastSync + timeBetweenSyncs.toMillis(); while (true) { - final Optional entryOptional = nextEntry(entries); + final Optional entryOptional = entries.next(); if (!entryOptional.isPresent()) { break; } @@ -112,16 +110,6 @@ public class PerformanceDb implements AutoCloseable { } } - private Optional nextEntry(final BlockingIterator entries) throws InterruptedException { - - try { - return entries.next(10, TimeUnit.SECONDS); - } catch (final TimeoutException e) { - tagsToFile.clearWriterCache(); - } - return entries.next(); - } - /** * * @param query