Search in sources :

Example 6 with IndexImporterFactoryImpl

use of org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl in project neo4j by neo4j.

the class CsvInputBatchImportIT method shouldImportDataComingFromCsvFiles.

@Test
void shouldImportDataComingFromCsvFiles() throws Exception {
    // GIVEN
    Config dbConfig = Config.newBuilder().set(db_timezone, LogTimeZone.SYSTEM).set(dense_node_threshold, 5).build();
    try (JobScheduler scheduler = new ThreadPoolJobScheduler()) {
        BatchImporter importer = new ParallelBatchImporter(databaseLayout, fileSystem, PageCacheTracer.NULL, smallBatchSizeConfig(), NullLogService.getInstance(), ExecutionMonitor.INVISIBLE, EMPTY, dbConfig, defaultFormat(), ImportLogic.NO_MONITOR, scheduler, Collector.EMPTY, TransactionLogInitializer.getLogFilesInitializer(), new IndexImporterFactoryImpl(dbConfig), INSTANCE);
        List<InputEntity> nodeData = randomNodeData();
        List<InputEntity> relationshipData = randomRelationshipData(nodeData);
        // WHEN
        importer.doImport(csv(nodeDataAsFile(nodeData), relationshipDataAsFile(relationshipData), IdType.STRING, lowBufferSize(COMMAS)));
        // THEN
        verifyImportedData(nodeData, relationshipData);
    }
}
Also used : JobScheduler(org.neo4j.scheduler.JobScheduler) ThreadPoolJobScheduler(org.neo4j.test.scheduler.ThreadPoolJobScheduler) ParallelBatchImporter(org.neo4j.internal.batchimport.ParallelBatchImporter) BatchImporter(org.neo4j.internal.batchimport.BatchImporter) ParallelBatchImporter(org.neo4j.internal.batchimport.ParallelBatchImporter) Config(org.neo4j.configuration.Config) InputEntity(org.neo4j.internal.batchimport.input.InputEntity) IndexImporterFactoryImpl(org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl) ThreadPoolJobScheduler(org.neo4j.test.scheduler.ThreadPoolJobScheduler) Test(org.junit.jupiter.api.Test)

Aggregations

IndexImporterFactoryImpl (org.neo4j.kernel.impl.index.schema.IndexImporterFactoryImpl)6 JobScheduler (org.neo4j.scheduler.JobScheduler)5 Config (org.neo4j.configuration.Config)4 BatchImporter (org.neo4j.internal.batchimport.BatchImporter)4 Path (java.nio.file.Path)3 ParallelBatchImporter (org.neo4j.internal.batchimport.ParallelBatchImporter)3 ExecutionMonitor (org.neo4j.internal.batchimport.staging.ExecutionMonitor)3 ThreadPoolJobScheduler (org.neo4j.test.scheduler.ThreadPoolJobScheduler)3 IOException (java.io.IOException)2 IndexImporterFactory (org.neo4j.internal.batchimport.IndexImporterFactory)2 Groups (org.neo4j.internal.batchimport.input.Groups)2 SpectrumExecutionMonitor (org.neo4j.internal.batchimport.staging.SpectrumExecutionMonitor)2 SimpleLogService (org.neo4j.logging.internal.SimpleLogService)2 OutputStream (java.io.OutputStream)1 PrintStream (java.io.PrintStream)1 UncheckedIOException (java.io.UncheckedIOException)1 DirectoryNotEmptyException (java.nio.file.DirectoryNotEmptyException)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 LongAdder (java.util.concurrent.atomic.LongAdder)1