PdbWriters are now closed by the cache TagsToFile
we do not have to close the files when the input streams are idle.
This commit is contained in:
@@ -9,8 +9,6 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.concurrent.TimeoutException;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import org.lucares.collections.LongList;
|
import org.lucares.collections.LongList;
|
||||||
@@ -64,7 +62,7 @@ public class PerformanceDb implements AutoCloseable {
|
|||||||
long nextSync = lastSync + timeBetweenSyncs.toMillis();
|
long nextSync = lastSync + timeBetweenSyncs.toMillis();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
final Optional<Entry> entryOptional = nextEntry(entries);
|
final Optional<Entry> entryOptional = entries.next();
|
||||||
if (!entryOptional.isPresent()) {
|
if (!entryOptional.isPresent()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -112,16 +110,6 @@ public class PerformanceDb implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Entry> nextEntry(final BlockingIterator<Entry> entries) throws InterruptedException {
|
|
||||||
|
|
||||||
try {
|
|
||||||
return entries.next(10, TimeUnit.SECONDS);
|
|
||||||
} catch (final TimeoutException e) {
|
|
||||||
tagsToFile.clearWriterCache();
|
|
||||||
}
|
|
||||||
return entries.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param query
|
* @param query
|
||||||
|
|||||||
Reference in New Issue
Block a user