private void InitializeNodeImport(Input_Estimates estimates, IdMapper idMapper, BatchingNeoStores neoStores)
        {
            long numberOfNodes = estimates.NumberOfNodes();

            PrintStageHeader("(1/4) Node import", ESTIMATED_NUMBER_OF_NODES, count(numberOfNodes), ESTIMATED_DISK_SPACE_USAGE, bytes(NodesDiskUsage(estimates, neoStores) + estimates.SizeOfNodeProperties()), ESTIMATED_REQUIRED_MEMORY_USAGE, bytes(BaselineMemoryRequirement(neoStores) + defensivelyPadMemoryEstimate(idMapper.MemoryEstimation(numberOfNodes))));

            // A difficulty with the goal here is that we don't know how much work there is to be done in id mapper preparation stage.
            // In addition to nodes themselves and SPLIT,SORT,DETECT there may be RESOLVE,SORT,DEDUPLICATE too, if there are collisions
            long goal = idMapper.NeedsPreparation() ? numberOfNodes + Weighted(IdMapperPreparationStage.NAME, numberOfNodes * 4) : numberOfNodes;

            InitializeProgress(goal, ImportStage.NodeImport);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldWarnAboutCounthigherThanCapacity()
        public virtual void ShouldWarnAboutCounthigherThanCapacity()
        {
            // given
            RecordFormats   formats   = Standard.LATEST_RECORD_FORMATS;
            Monitor         monitor   = mock(typeof(Monitor));
            Input_Estimates estimates = Inputs.KnownEstimates(formats.Node().MaxId * 2, formats.Relationship().MaxId * 2, 0, 0, 0, 0, 0);                 // we don't care about the rest of the estimates in this checking

            // when
            (new EstimationSanityChecker(formats, monitor)).SanityCheck(estimates);

            // then
            verify(monitor).mayExceedNodeIdCapacity(formats.Node().MaxId, estimates.NumberOfNodes());
            verify(monitor).mayExceedRelationshipIdCapacity(formats.Relationship().MaxId, estimates.NumberOfRelationships());
        }
        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 static long NodesDiskUsage(Input_Estimates estimates, BatchingNeoStores neoStores)
 {
     return(estimates.NumberOfNodes() * neoStores.NodeStore.RecordSize + estimates.NumberOfNodeLabels());
 }
Example #5
0
 public virtual void SanityCheck(Input_Estimates estimates)
 {
     SanityCheckEstimateWithMaxId(estimates.NumberOfNodes(), _formats.node().MaxId, _monitor.mayExceedNodeIdCapacity);
     SanityCheckEstimateWithMaxId(estimates.NumberOfRelationships(), _formats.relationship().MaxId, _monitor.mayExceedRelationshipIdCapacity);
 }