reuse pdb writers
This commit is contained in:
@@ -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. ");
|
||||
|
||||
Reference in New Issue
Block a user