Search in sources :

Example 26 with ThreadPoolJobScheduler

use of org.neo4j.test.scheduler.ThreadPoolJobScheduler 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

ThreadPoolJobScheduler (org.neo4j.test.scheduler.ThreadPoolJobScheduler)26 JobScheduler (org.neo4j.scheduler.JobScheduler)15 Test (org.junit.jupiter.api.Test)14 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)9 PageCache (org.neo4j.io.pagecache.PageCache)9 DefaultFileSystemAbstraction (org.neo4j.io.fs.DefaultFileSystemAbstraction)8 Path (java.nio.file.Path)7 Config (org.neo4j.configuration.Config)7 IOException (java.io.IOException)4 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)4 Transaction (org.neo4j.graphdb.Transaction)4 ParallelBatchImporter (org.neo4j.internal.batchimport.ParallelBatchImporter)4 EphemeralFileSystemAbstraction (org.neo4j.io.fs.EphemeralFileSystemAbstraction)4 SingleFilePageSwapperFactory (org.neo4j.io.pagecache.impl.SingleFilePageSwapperFactory)4 MuninnPageCache (org.neo4j.io.pagecache.impl.muninn.MuninnPageCache)4 DatabaseStateService (org.neo4j.dbms.DatabaseStateService)3 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)3 Input (org.neo4j.internal.batchimport.input.Input)3 DatabaseLayout (org.neo4j.io.layout.DatabaseLayout)3 StandalonePageCacheFactory.createPageCache (org.neo4j.io.pagecache.impl.muninn.StandalonePageCacheFactory.createPageCache)3