reuse pdb writers

This commit is contained in:
2016-12-28 08:39:20 +01:00
parent db0b3d6d24
commit 68ac1dd631
8 changed files with 157 additions and 150 deletions

View File

@@ -158,11 +158,15 @@ public class TcpIngestor implements AutoCloseable {
serverThreadPool.submit(() -> {
Thread.currentThread().setName("db-ingestion");
try {
db.put(new BlockingQueueIterator<>(queue, Entry.POISON));
} catch (final Exception e) {
e.printStackTrace();
throw e;
boolean finished = false;
while (!finished) {
try {
db.put(new BlockingQueueIterator<>(queue, Entry.POISON));
finished = true;
} catch (final Exception e) {
e.printStackTrace();
}
}
return null;
});
@@ -188,6 +192,8 @@ public class TcpIngestor implements AutoCloseable {
} catch (final SocketTimeoutException e) {
// expected every 100ms
// needed to be able to stop the server
} catch (final Exception e) {
e.printStackTrace();
}
}
System.out.println("not accepting new connections. ");