Exemplo n.º 1
0
        public override void Check(RelationshipRecord record, CheckerEngine <RelationshipRecord, Org.Neo4j.Consistency.report.ConsistencyReport_RelationshipConsistencyReport> engine, RecordAccess records)
        {
            try
            {
                IntObjectMap <PropertyBlock> propertyMap = null;
                foreach (StoreIndexDescriptor index in _relationshipIndexes)
                {
                    SchemaDescriptor schema = index.Schema();
                    if (ArrayUtils.contains(Schema.EntityTokenIds, record.Type))
                    {
                        if (propertyMap == null)
                        {
                            ICollection <PropertyRecord> propertyRecs = _propertyReader.getPropertyRecordChain(record.NextProp);
                            propertyMap = properties(_propertyReader.propertyBlocks(propertyRecs));
                        }

                        if (entityIntersectsSchema(propertyMap, schema))
                        {
                            Value[] values = getPropertyValues(_propertyReader, propertyMap, Schema.PropertyIds);
                            using (IndexReader reader = _indexes.accessorFor(index).newReader())
                            {
                                long entityId = record.Id;
                                long count    = reader.CountIndexedNodes(entityId, Schema.PropertyIds, values);
                                ReportIncorrectIndexCount(values, engine, index, count);
                            }
                        }
                    }
                }
            }
            catch (PropertyReader.CircularPropertyRecordChainException)
            {
                // The property chain contains a circular reference and is therefore not sane.
                // Skip it, since this inconsistency has been reported by PropertyChain checker already.
            }
        }
 public override void Check(NodeRecord record, CheckerEngine <NodeRecord, Org.Neo4j.Consistency.report.ConsistencyReport_NodeConsistencyReport> engine, RecordAccess records)
 {
     try
     {
         ICollection <PropertyRecord> properties = _propertyReader.getPropertyRecordChain(record.NextProp);
         _cacheAccess.client().putPropertiesToCache(properties);
         if (_indexes != null)
         {
             MatchIndexesToNode(record, engine, records, properties);
         }
         CheckProperty(record, engine, properties);
     }
     catch (PropertyReader.CircularPropertyRecordChainException e)
     {
         engine.Report().propertyChainContainsCircularReference(e.PropertyRecordClosingTheCircle());
     }
 }