Search in sources :

Example 1 with PageCacheArrayFactoryMonitor

use of org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor 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)

Example 2 with PageCacheArrayFactoryMonitor

use of org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor in project neo4j by neo4j.

the class HumanUnderstandableExecutionMonitor method initialize.

@Override
public void initialize(DependencyResolver dependencyResolver) {
    this.dependencyResolver = dependencyResolver;
    Input.Estimates estimates = dependencyResolver.resolveDependency(Input.Estimates.class);
    BatchingNeoStores neoStores = dependencyResolver.resolveDependency(BatchingNeoStores.class);
    IdMapper idMapper = dependencyResolver.resolveDependency(IdMapper.class);
    pageCacheArrayFactoryMonitor = dependencyResolver.resolveDependency(PageCacheArrayFactoryMonitor.class);
    long biggestCacheMemory = estimatedCacheSize(neoStores, NodeRelationshipCache.memoryEstimation(estimates.numberOfNodes()), idMapper.memoryEstimation(estimates.numberOfNodes()));
    System.out.println();
    printStageHeader("Import starting", ESTIMATED_NUMBER_OF_NODES, count(estimates.numberOfNodes()), ESTIMATED_NUMBER_OF_NODE_PROPERTIES, count(estimates.numberOfNodeProperties()), ESTIMATED_NUMBER_OF_RELATIONSHIPS, count(estimates.numberOfRelationships()), ESTIMATED_NUMBER_OF_RELATIONSHIP_PROPERTIES, count(estimates.numberOfRelationshipProperties()), ESTIMATED_DISK_SPACE_USAGE, bytesToString(nodesDiskUsage(estimates, neoStores) + relationshipsDiskUsage(estimates, neoStores) + estimates.sizeOfNodeProperties() + estimates.sizeOfRelationshipProperties()), ESTIMATED_REQUIRED_MEMORY_USAGE, bytesToString(biggestCacheMemory));
    System.out.println();
}
Also used : Input(org.neo4j.internal.batchimport.input.Input) BatchingNeoStores(org.neo4j.internal.batchimport.store.BatchingNeoStores) PageCacheArrayFactoryMonitor(org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor) IdMapper(org.neo4j.internal.batchimport.cache.idmapping.IdMapper)

Aggregations

PageCacheArrayFactoryMonitor (org.neo4j.internal.batchimport.cache.PageCacheArrayFactoryMonitor)2 Input (org.neo4j.internal.batchimport.input.Input)2 NodeRelationshipCache (org.neo4j.internal.batchimport.cache.NodeRelationshipCache)1 IdMapper (org.neo4j.internal.batchimport.cache.idmapping.IdMapper)1 EstimationSanityChecker (org.neo4j.internal.batchimport.input.EstimationSanityChecker)1 BatchingNeoStores (org.neo4j.internal.batchimport.store.BatchingNeoStores)1