Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReadNullDynamicRecordFromInlineLabelsField()
        public virtual void ShouldReadNullDynamicRecordFromInlineLabelsField()
        {
            // GIVEN
            NodeRecord node = NodeRecordWithInlinedLabels(23L);

            // WHEN
            bool isDynamicReference = NodeLabelsField.fieldPointsToDynamicRecordOfLabels(node.LabelField);

            // THEN
            assertFalse(isDynamicReference);
        }
Esempio n. 2
0
            public override void Check(RelationshipRecord record, CheckerEngine <RelationshipRecord, ConsistencyReport_RelationshipConsistencyReport> engine, RecordAccess records)
            {
                if (CountUpdateCondition.test(record))
                {
                    if (record.InUse())
                    {
                        Org.Neo4j.Consistency.checking.cache.CacheAccess_Client cacheAccess = records.CacheAccess().client();
                        ISet <long> firstNodeLabels;
                        ISet <long> secondNodeLabels;
                        long        firstLabelsField = cacheAccess.GetFromCache(record.FirstNode, SLOT_LABEL_FIELD);
                        if (NodeLabelsField.fieldPointsToDynamicRecordOfLabels(firstLabelsField))
                        {
                            firstNodeLabels = LabelsFor(NodeStore, engine, records, record.FirstNode);
                        }
                        else
                        {
                            firstNodeLabels = NodeLabelReader.GetListOfLabels(firstLabelsField);
                        }
                        long secondLabelsField = cacheAccess.GetFromCache(record.SecondNode, SLOT_LABEL_FIELD);
                        if (NodeLabelsField.fieldPointsToDynamicRecordOfLabels(secondLabelsField))
                        {
                            secondNodeLabels = LabelsFor(NodeStore, engine, records, record.SecondNode);
                        }
                        else
                        {
                            secondNodeLabels = NodeLabelReader.GetListOfLabels(secondLabelsField);
                        }
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int type = record.getType();
                        int type = record.Type;
                        lock ( Counts )
                        {
                            Counts.addToValue(relationshipKey(WILDCARD, WILDCARD, WILDCARD), 1);
                            Counts.addToValue(relationshipKey(WILDCARD, type, WILDCARD), 1);
                            if (firstNodeLabels != null)
                            {
                                foreach (long firstLabel in firstNodeLabels)
                                {
                                    Counts.addToValue(relationshipKey(( int )firstLabel, WILDCARD, WILDCARD), 1);
                                    Counts.addToValue(relationshipKey(( int )firstLabel, type, WILDCARD), 1);
                                }
                            }
                            if (secondNodeLabels != null)
                            {
                                foreach (long secondLabel in secondNodeLabels)
                                {
                                    Counts.addToValue(relationshipKey(WILDCARD, WILDCARD, ( int )secondLabel), 1);
                                    Counts.addToValue(relationshipKey(WILDCARD, type, ( int )secondLabel), 1);
                                }
                            }
                            if (COMPUTE_DOUBLE_SIDED_RELATIONSHIP_COUNTS)
                            {
                                foreach (long firstLabel in firstNodeLabels)
                                {
                                    foreach (long secondLabel in secondNodeLabels)
                                    {
                                        Counts.addToValue(relationshipKey(( int )firstLabel, WILDCARD, ( int )secondLabel), 1);
                                        Counts.addToValue(relationshipKey(( int )firstLabel, type, ( int )secondLabel), 1);
                                    }
                                }
                            }
                        }
                    }
                }
                Inner.check(record, engine, records);
            }