add flag to make CSV upload wait until entries are flushed
To make it easier/possible to write stable unit test the CSV upload can optionally wait until all entries have been flushed to disk. This is necessary for tests that ingest data and then read the data.
This commit is contained in:
@@ -12,6 +12,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.lucares.pdb.api.Entries;
|
||||
@@ -50,7 +51,7 @@ public final class IngestionHandler implements Callable<Void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void handleInputStream(final InputStream in) throws IOException, InterruptedException {
|
||||
private void handleInputStream(final InputStream in) throws IOException, InterruptedException, TimeoutException {
|
||||
in.mark(1);
|
||||
final byte firstByte = (byte) in.read();
|
||||
if (firstByte == '{') {
|
||||
|
||||
Reference in New Issue
Block a user