Example #1
0
 private void CheckChainItem(PropertyRecord property, CheckerEngine <RECORD, REPORT> engine, MutableIntSet keys, MandatoryProperties.Check <RECORD, REPORT> mandatory)
 {
     if (!property.InUse())
     {
         engine.Report().propertyNotInUse(property);
     }
     else
     {
         int[] keysInRecord = ChainCheck.Keys(property);
         if (mandatory != null)
         {
             mandatory.Receive(keysInRecord);
         }
         foreach (int key in keysInRecord)
         {
             if (!keys.add(key))
             {
                 engine.Report().propertyKeyNotUniqueInChain();
             }
         }
     }
 }
Example #2
0
        public override void Process(NodeRecord nodeRecord)
        {
            _reporter.forNode(nodeRecord, _nodeIndexCheck);
            Org.Neo4j.Consistency.checking.cache.CacheAccess_Client client = _cacheAccess.client();
            using (MandatoryProperties.Check <NodeRecord, ConsistencyReport_NodeConsistencyReport> mandatoryCheck = _mandatoryProperties.apply(nodeRecord))
            {
                IEnumerable <PropertyRecord> properties = client.PropertiesFromCache;

                // We do this null-check here because even if nodeIndexCheck should provide the properties for us,
                // or an empty list at least, it may fail in one way or another and exception be caught by
                // broad exception handler in reporter. The caught exception will produce an ERROR so it will not
                // go by unnoticed.
                if (properties != null)
                {
                    foreach (PropertyRecord property in properties)
                    {
                        _reporter.forProperty(property, _propertyCheck);
                        mandatoryCheck.Receive(ChainCheck.keys(property));
                    }
                }
            }
        }