extract CSV reading code to new file

Refactoring to prepare the addition of CSV parsing rules. The parsing
rules will contain information about which columns to ingest or ignore.
This will be used to add the ability to upload files via HTTP post in
addition to the TcpIngestor.
This commit is contained in:
2019-11-30 17:58:01 +01:00
parent 0cdf30e9a2
commit 08b1be5334
4 changed files with 299 additions and 280 deletions

View File

@@ -267,7 +267,7 @@ public class TcpIngestorTest {
Instant.ofEpochMilli(1).atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_ZONED_DATE_TIME));
entry.put("duration", 1);
entry.put("host", "someHost");
entry.put(TcpIngestor.Handler.COLUM_IGNORE_PREFIX + "ignored", "ignoredValue");
entry.put(CsvToEntryTransformer.COLUM_IGNORE_PREFIX + "ignored", "ignoredValue");
PdbTestUtil.sendAsCsv(entry);
} catch (final Exception e) {
@@ -284,9 +284,9 @@ public class TcpIngestorTest {
public void testCsvIngestorHandlesDurationAtEnd() throws Exception {
String host = "someHost";
long value1 = 222;
long value2 = 1;
final String host = "someHost";
final long value1 = 222;
final long value2 = 1;
try (TcpIngestor ingestor = new TcpIngestor(dataDirectory)) {
ingestor.start();