Esempio n. 1
0
        private int RelTypeId(TestRelType type)
        {
            int id = RelationshipTypeId(type);

            assertNotEquals(NO_TOKEN, id);
            return(id);
        }
Esempio n. 2
0
        private void MarkRandomRelsInGroupNotInUse(long nodeId, TestRelType type)
        {
            NodeRecord node = GetNodeRecord(nodeId);

            assertTrue(node.Dense);

            long relGroupId = node.NextRel;

            while (relGroupId != NO_NEXT_RELATIONSHIP.intValue())
            {
                RelationshipGroupRecord relGroup = GetRelGroupRecord(relGroupId);

                if (type == RelTypeForId(relGroup.Type))
                {
                    MarkRandomRelsInChainNotInUse(relGroup.FirstOut);
                    MarkRandomRelsInChainNotInUse(relGroup.FirstIn);
                    MarkRandomRelsInChainNotInUse(relGroup.FirstLoop);
                    return;
                }

                relGroupId = relGroup.Next;
            }

            throw new System.InvalidOperationException("No relationship group with type: " + type + " found");
        }
Esempio n. 3
0
        private void MarkRelGroupNotInUse(long nodeId, params TestRelType[] types)
        {
            NodeRecord node = GetNodeRecord(nodeId);

            assertTrue(node.Dense);

            ISet <TestRelType> typesToRemove = asSet(types);

            long relGroupId = node.NextRel;

            while (relGroupId != NO_NEXT_RELATIONSHIP.intValue())
            {
                RelationshipGroupRecord relGroup = GetRelGroupRecord(relGroupId);
                TestRelType             type     = RelTypeForId(relGroup.Type);

                if (typesToRemove.Contains(type))
                {
                    relGroup.InUse = false;
                    Update(relGroup);
                }

                relGroupId = relGroup.Next;
            }
        }