Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void execute(final org.neo4j.kernel.api.direct.DirectStoreAccess directStoreAccess, final org.neo4j.consistency.checking.CheckDecorator decorator, final org.neo4j.consistency.store.RecordAccess recordAccess, final org.neo4j.consistency.report.InconsistencyReport report, org.neo4j.consistency.checking.cache.CacheAccess cacheAccess, org.neo4j.consistency.report.ConsistencyReporter.Monitor reportMonitor) throws ConsistencyCheckIncompleteException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        internal virtual void Execute(DirectStoreAccess directStoreAccess, CheckDecorator decorator, RecordAccess recordAccess, InconsistencyReport report, CacheAccess cacheAccess, ConsistencyReporter.Monitor reportMonitor)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.consistency.report.ConsistencyReporter reporter = new org.neo4j.consistency.report.ConsistencyReporter(recordAccess, report, reportMonitor);
            ConsistencyReporter reporter          = new ConsistencyReporter(recordAccess, report, reportMonitor);
            StoreProcessor      processEverything = new StoreProcessor(decorator, reporter, Stage_Fields.SequentialForward, cacheAccess);

            ProgressMonitorFactory.MultiPartBuilder progress = _progressFactory.multipleParts("Full Consistency Check");
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.kernel.impl.store.StoreAccess nativeStores = directStoreAccess.nativeStores();
            StoreAccess nativeStores = directStoreAccess.NativeStores();

            try
            {
                using (IndexAccessors indexes = new IndexAccessors(directStoreAccess.Indexes(), nativeStores.SchemaStore, _samplingConfig))
                {
                    MultiPassStore.Factory multiPass   = new MultiPassStore.Factory(decorator, recordAccess, cacheAccess, report, reportMonitor);
                    ConsistencyCheckTasks  taskCreator = new ConsistencyCheckTasks(progress, processEverything, nativeStores, _statistics, cacheAccess, directStoreAccess.LabelScanStore(), indexes, directStoreAccess.TokenHolders(), multiPass, reporter, _threads);

                    if (_checkIndexStructure)
                    {
                        ConsistencyCheckIndexStructure(directStoreAccess.LabelScanStore(), indexes, reporter, _progressFactory);
                    }

                    IList <ConsistencyCheckerTask> tasks = taskCreator.CreateTasksForFullCheck(_checkLabelScanStore, _checkIndexes, _checkGraph);
                    progress.Build();
                    TaskExecutor.Execute(tasks, decorator.prepare);
                }
            }
            catch (Exception e)
            {
                throw new ConsistencyCheckIncompleteException(e);
            }
        }
Example #2
0
 public PropertyAndNode2LabelIndexProcessor(ConsistencyReporter reporter, IndexAccessors indexes, PropertyReader propertyReader, CacheAccess cacheAccess, System.Func <NodeRecord, MandatoryProperties.Check <NodeRecord, ConsistencyReport_NodeConsistencyReport> > mandatoryProperties)
 {
     this._reporter            = reporter;
     this._cacheAccess         = cacheAccess;
     this._mandatoryProperties = mandatoryProperties;
     this._nodeIndexCheck      = new PropertyAndNodeIndexedCheck(indexes, propertyReader, cacheAccess);
     this._propertyCheck       = new PropertyRecordCheck();
 }
Example #3
0
 private SchemaRecordCheck(SchemaRuleAccess ruleAccess, IndexAccessors indexAccessors, IDictionary <long, DynamicRecord> indexObligations, IDictionary <long, DynamicRecord> constraintObligations, IDictionary <SchemaRule, DynamicRecord> verifiedRulesWithRecords, CheckStrategy strategy)
 {
     this.RuleAccess                = ruleAccess;
     this._indexAccessors           = indexAccessors;
     this._indexObligations         = indexObligations;
     this._constraintObligations    = constraintObligations;
     this._verifiedRulesWithRecords = verifiedRulesWithRecords;
     this._strategy = strategy;
 }
Example #4
0
 public SchemaRecordCheck(SchemaRuleAccess ruleAccess, IndexAccessors indexAccessors)
 {
     this.RuleAccess                = ruleAccess;
     this._indexAccessors           = indexAccessors;
     this._indexObligations         = new Dictionary <long, DynamicRecord>();
     this._constraintObligations    = new Dictionary <long, DynamicRecord>();
     this._verifiedRulesWithRecords = new Dictionary <SchemaRule, DynamicRecord>();
     this._strategy = new RulesCheckStrategy(this);
 }
Example #5
0
 internal ConsistencyCheckTasks(ProgressMonitorFactory.MultiPartBuilder multiPartBuilder, StoreProcessor defaultProcessor, StoreAccess nativeStores, Statistics statistics, CacheAccess cacheAccess, LabelScanStore labelScanStore, IndexAccessors indexes, TokenHolders tokenHolders, MultiPassStore.Factory multiPass, ConsistencyReporter reporter, int numberOfThreads)
 {
     this._multiPartBuilder = multiPartBuilder;
     this._defaultProcessor = defaultProcessor;
     this._nativeStores     = nativeStores;
     this._statistics       = statistics;
     this._cacheAccess      = cacheAccess;
     this._tokenHolders     = tokenHolders;
     this._multiPass        = multiPass;
     this._reporter         = reporter;
     this._labelScanStore   = labelScanStore;
     this._indexes          = indexes;
     this._numberOfThreads  = numberOfThreads;
 }
Example #6
0
        private static void ConsistencyCheckSchemaIndexes(IndexAccessors indexes, ConsistencyReporter report, ProgressListener listener)
        {
            IList <StoreIndexDescriptor> rulesToRemove = new List <StoreIndexDescriptor>();

            foreach (StoreIndexDescriptor onlineRule in indexes.OnlineRules())
            {
                ConsistencyReporter.FormattingDocumentedHandler handler = report.FormattingHandler(RecordType.INDEX);
                ReporterFactory reporterFactory = new ReporterFactory(handler);
                IndexAccessor   accessor        = indexes.AccessorFor(onlineRule);
                if (!accessor.ConsistencyCheck(reporterFactory))
                {
                    rulesToRemove.Add(onlineRule);
                }
                handler.UpdateSummary();
                listener.Add(1);
            }
            foreach (StoreIndexDescriptor toRemove in rulesToRemove)
            {
                indexes.Remove(toRemove);
            }
        }
 internal RelationshipIndexProcessor(ConsistencyReporter reporter, IndexAccessors indexes, PropertyReader propertyReader, IList <StoreIndexDescriptor> relationshipIndexes)
 {
     this._reporter = reporter;
     _checker       = new RelationshipToIndexCheck(relationshipIndexes, indexes, propertyReader);
 }
Example #8
0
 internal RelationshipToIndexCheck(IList <StoreIndexDescriptor> relationshipIndexes, IndexAccessors indexes, PropertyReader propertyReader)
 {
     this._relationshipIndexes = relationshipIndexes.ToArray();
     this._indexes             = indexes;
     this._propertyReader      = propertyReader;
 }
Example #9
0
        private static void ConsistencyCheckIndexStructure(LabelScanStore labelScanStore, IndexAccessors indexes, ConsistencyReporter report, ProgressMonitorFactory progressMonitorFactory)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final long schemaIndexCount = org.neo4j.helpers.collection.Iterables.count(indexes.onlineRules());
            long       schemaIndexCount = Iterables.count(indexes.OnlineRules());
            const long additionalCount  = 1;              // LabelScanStore
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final long totalCount = schemaIndexCount + additionalCount;
            long totalCount = schemaIndexCount + additionalCount;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.neo4j.helpers.progress.ProgressListener listener = progressMonitorFactory.singlePart("Index structure consistency check", totalCount);
            ProgressListener listener = progressMonitorFactory.SinglePart("Index structure consistency check", totalCount);

            listener.Started();

            ConsistencyCheckLabelScanStore(labelScanStore, report, listener);
            ConsistencyCheckSchemaIndexes(indexes, report, listener);

            listener.Done();
        }
 internal PropertyAndNodeIndexedCheck(IndexAccessors indexes, PropertyReader propertyReader, CacheAccess cacheAccess)
 {
     this._indexes        = indexes;
     this._propertyReader = propertyReader;
     this._cacheAccess    = cacheAccess;
 }