Example #1
0
 public override void CheckReference(RECORD record, NodeRecord nodeRecord, CheckerEngine <RECORD, REPORT> engine, RecordAccess records)
 {
     if (nodeRecord.InUse())
     {
         NodeLabels nodeLabels = NodeLabelsField.parseLabelsField(nodeRecord);
         if (nodeLabels is DynamicNodeLabels)
         {
             DynamicNodeLabels dynamicNodeLabels = ( DynamicNodeLabels )nodeLabels;
             long firstRecordId = dynamicNodeLabels.FirstDynamicRecordId;
             RecordReference <DynamicRecord>   firstRecordReference      = records.NodeLabels(firstRecordId);
             ExpectedNodeLabelsChecker         expectedNodeLabelsChecker = new ExpectedNodeLabelsChecker(this, nodeRecord);
             LabelChainWalker <RECORD, REPORT> checker = new LabelChainWalker <RECORD, REPORT>(expectedNodeLabelsChecker);
             engine.ComparativeCheck(firstRecordReference, checker);
             nodeRecord.DynamicLabelRecords;                              // I think this is empty in production
         }
         else
         {
             long[] storeLabels = nodeLabels.Get(null);
             REPORT report      = engine.Report();
             ValidateLabelIds(nodeRecord, storeLabels, report);
         }
     }
     else if (_indexLabels.Length != 0)
     {
         engine.Report().nodeNotInUse(nodeRecord);
     }
 }
Example #2
0
 public override bool HasLabel(int label)
 {
     //Get labels from store and put in intSet, unfortunately we get longs back
     long[] longs = NodeLabelsField.get(this, _read);
     foreach (long labelToken in longs)
     {
         if (labelToken == label)
         {
             assert(int) labelToken == labelToken : "value too big to be represented as and int";
             return(true);
         }
     }
     return(false);
 }
Example #3
0
        public override bool Process(NodeRecord node)
        {
            long[] labels = NodeLabelsField.get(node, _nodeStore);
            if (labels.Length > 0)
            {
                foreach (long labelId in labels)
                {
                    _labelCounts[( int )labelId]++;
                }
                _cache.put(node.Id, labels);
            }
            _labelCounts[_anyLabel]++;
            _progressReporter.progress(1);

            // No need to update the store, we're just reading things here
            return(false);
        }
Example #4
0
 public override long[] Labels()
 {
     return(NodeLabelsField.get(this, _read));
 }