private int RelTypeId(TestRelType type) { int id = RelationshipTypeId(type); assertNotEquals(NO_TOKEN, id); return(id); }
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"); }
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; } }