public override void Initialize(DependencyResolver dependencyResolver) { this._dependencyResolver = dependencyResolver; Input_Estimates estimates = dependencyResolver.ResolveDependency(typeof(Input_Estimates)); BatchingNeoStores neoStores = dependencyResolver.ResolveDependency(typeof(BatchingNeoStores)); IdMapper idMapper = dependencyResolver.ResolveDependency(typeof(IdMapper)); NodeRelationshipCache nodeRelationshipCache = dependencyResolver.ResolveDependency(typeof(NodeRelationshipCache)); _pageCacheArrayFactoryMonitor = dependencyResolver.ResolveDependency(typeof(PageCacheArrayFactoryMonitor)); long biggestCacheMemory = estimatedCacheSize(neoStores, nodeRelationshipCache.MemoryEstimation(estimates.NumberOfNodes()), idMapper.MemoryEstimation(estimates.NumberOfNodes())); 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, bytes(NodesDiskUsage(estimates, neoStores) + RelationshipsDiskUsage(estimates, neoStores) + estimates.SizeOfNodeProperties() + estimates.SizeOfRelationshipProperties()), ESTIMATED_REQUIRED_MEMORY_USAGE, bytes(biggestCacheMemory)); Console.WriteLine(); }
private void InitializeLinking(BatchingNeoStores neoStores, NodeRelationshipCache nodeRelationshipCache, DataStatistics distribution) { PrintStageHeader("(3/4) Relationship linking", ESTIMATED_REQUIRED_MEMORY_USAGE, bytes(BaselineMemoryRequirement(neoStores) + defensivelyPadMemoryEstimate(nodeRelationshipCache.MemoryEstimation(distribution.NodeCount)))); // The reason the highId of the relationship store is used, as opposed to actual number of imported relationships // is that the stages underneath operate on id ranges, not knowing which records are actually in use. long relationshipRecordIdCount = neoStores.RelationshipStore.HighId; // The progress counting of linking stages is special anyway, in that it uses the "progress" stats key, // which is based on actual number of relationships, not relationship ids. long actualRelationshipCount = distribution.RelationshipCount; InitializeProgress(relationshipRecordIdCount + actualRelationshipCount * 2 + actualRelationshipCount * 2, ImportStage.Linking); }