Search in sources :

Example 1 with BadCollector

use of org.neo4j.internal.batchimport.input.BadCollector in project neo4j by neo4j.

the class CsvImporter method doImport.

@Override
public void doImport() throws IOException {
    if (force) {
        fileSystem.deleteRecursively(databaseLayout.databaseDirectory());
        fileSystem.deleteRecursively(databaseLayout.getTransactionLogsDirectory());
    }
    try (OutputStream badOutput = fileSystem.openAsOutputStream(reportFile, false);
        Collector badCollector = getBadCollector(skipBadEntriesLogging, badOutput)) {
        // Extract the default time zone from the database configuration
        ZoneId dbTimeZone = databaseConfig.get(GraphDatabaseSettings.db_temporal_timezone);
        Supplier<ZoneId> defaultTimeZone = () -> dbTimeZone;
        final var nodeData = nodeData();
        final var relationshipsData = relationshipData();
        CsvInput input = new CsvInput(nodeData, defaultFormatNodeFileHeader(defaultTimeZone, normalizeTypes), relationshipsData, defaultFormatRelationshipFileHeader(defaultTimeZone, normalizeTypes), idType, csvConfig, new CsvInput.PrintingMonitor(stdOut), memoryTracker);
        doImport(input, badCollector);
    }
}
Also used : ZoneId(java.time.ZoneId) OutputStream(java.io.OutputStream) Collector(org.neo4j.internal.batchimport.input.Collector) Collectors.badCollector(org.neo4j.internal.batchimport.input.Collectors.badCollector) Collectors.silentBadCollector(org.neo4j.internal.batchimport.input.Collectors.silentBadCollector) BadCollector(org.neo4j.internal.batchimport.input.BadCollector) CsvInput(org.neo4j.internal.batchimport.input.csv.CsvInput)

Aggregations

OutputStream (java.io.OutputStream)1 ZoneId (java.time.ZoneId)1 BadCollector (org.neo4j.internal.batchimport.input.BadCollector)1 Collector (org.neo4j.internal.batchimport.input.Collector)1 Collectors.badCollector (org.neo4j.internal.batchimport.input.Collectors.badCollector)1 Collectors.silentBadCollector (org.neo4j.internal.batchimport.input.Collectors.silentBadCollector)1 CsvInput (org.neo4j.internal.batchimport.input.csv.CsvInput)1