Search in sources :

Example 1 with EstimationSanityChecker

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

the class ImportLogic method initialize.

public void initialize(Input input) throws IOException {
    log.info("Import starting");
    startTime = currentTimeMillis();
    this.input = input;
    PageCacheArrayFactoryMonitor numberArrayFactoryMonitor = new PageCacheArrayFactoryMonitor();
    numberArrayFactory = auto(neoStore.getPageCache(), pageCacheTracer, databaseDirectory, config.allowCacheAllocationOnHeap(), numberArrayFactoryMonitor, log, databaseName);
    // Some temporary caches and indexes in the import
    idMapper = instantiateIdMapper(input);
    nodeRelationshipCache = new NodeRelationshipCache(numberArrayFactory, dbConfig.get(GraphDatabaseSettings.dense_node_threshold), memoryTracker);
    Input.Estimates inputEstimates = input.calculateEstimates(neoStore.getPropertyStore().newValueEncodedSizeCalculator());
    // Sanity checking against estimates
    new EstimationSanityChecker(recordFormats, monitor).sanityCheck(inputEstimates);
    new HeapSizeSanityChecker(monitor).sanityCheck(inputEstimates, recordFormats, neoStore, NodeRelationshipCache.memoryEstimation(inputEstimates.numberOfNodes()), idMapper.memoryEstimation(inputEstimates.numberOfNodes()));
    dependencies.satisfyDependencies(inputEstimates, idMapper, neoStore, nodeRelationshipCache, numberArrayFactoryMonitor);
    if (neoStore.determineDoubleRelationshipRecordUnits(inputEstimates)) {
        monitor.doubleRelationshipRecordUnitsEnabled();
    }
    executionMonitor.initialize(dependencies);
}
Also used : NodeRelationshipCache(org.neo4j.internal.batchimport.cache.NodeRelationshipCache) Input(org.neo4j.internal.batchimport.input.Input) PageCacheArrayFactoryMonitor(org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor) EstimationSanityChecker(org.neo4j.internal.batchimport.input.EstimationSanityChecker)

Aggregations

NodeRelationshipCache (org.neo4j.internal.batchimport.cache.NodeRelationshipCache)1 PageCacheArrayFactoryMonitor (org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor)1 EstimationSanityChecker (org.neo4j.internal.batchimport.input.EstimationSanityChecker)1 Input (org.neo4j.internal.batchimport.input.Input)1