Exemplo n.º 1
0
 private RelationshipRecord GetRelationship(long relId, bool inUse, int type)
 {
     if (!inUse)
     {
         type = -1;
     }
     return((new RelationshipRecord(relId)).initialize(inUse, NO_NEXT_PROPERTY.longValue(), 0, 0, type, NO_NEXT_RELATIONSHIP.longValue(), NO_NEXT_RELATIONSHIP.longValue(), NO_NEXT_RELATIONSHIP.longValue(), NO_NEXT_RELATIONSHIP.longValue(), true, false));
 }
Exemplo n.º 2
0
 public override void Clear()
 {
     base.Initialize(false);
     this._entityId           = -1;
     this._entityType         = 0;
     this._prevProp           = NO_PREVIOUS_PROPERTY.intValue();
     this._nextProp           = NO_NEXT_PROPERTY.intValue();
     this._deletedRecords     = null;
     this._blockRecordsCursor = _blocksCursor = 0;
     this._blocksLoaded       = false;
 }
Exemplo n.º 3
0
        private NodeRecord GetNode(int nodeId, bool inUse)
        {
            NodeRecord nodeRecord = new NodeRecord(nodeId);

            nodeRecord = nodeRecord.Initialize(inUse, NO_NEXT_PROPERTY.longValue(), false, NO_NEXT_RELATIONSHIP.longValue(), NO_LABELS_FIELD.longValue());
            if (inUse)
            {
                InlineNodeLabels labelFieldWriter = new InlineNodeLabels(nodeRecord);
                labelFieldWriter.Put(new long[] { ENTITY_TOKEN }, null, null);
            }
            return(nodeRecord);
        }
        private NodeCommand Node(long nodeId)
        {
            NodeRecord after = new NodeRecord(nodeId, true, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue(), 0);

            NodeLabelsField.parseLabelsField(after).add(1, null, null);

            return(new NodeCommand(new NodeRecord(nodeId), after));
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMarkRecordHeavyWhenSettingLabelFieldWithDynamicRecords()
        public virtual void ShouldMarkRecordHeavyWhenSettingLabelFieldWithDynamicRecords()
        {
            // GIVEN
            NodeRecord record = new NodeRecord(0, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue());

            // WHEN
            DynamicRecord dynamicRecord = new DynamicRecord(1);

            record.SetLabelField(0x8000000001L, asList(dynamicRecord));

            // THEN
            assertFalse(record.Light);
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldKeepRecordLightWhenSettingLabelFieldWithoutDynamicRecords()
        public virtual void ShouldKeepRecordLightWhenSettingLabelFieldWithoutDynamicRecords()
        {
            // GIVEN
            NodeRecord record = new NodeRecord(0, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue());

            // WHEN
            record.SetLabelField(0, Collections.emptyList());

            // THEN
            assertTrue(record.Light);
        }
Exemplo n.º 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCombineProperFiveByteLabelField() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldCombineProperFiveByteLabelField()
        {
            // GIVEN
            // -- a store
            EphemeralFileSystemAbstraction fs = _efs.get();

            _nodeStore = NewNodeStore(fs);

            // -- a record with the msb carrying a negative value
            long       nodeId = 0;
            long       labels = 0x8000000001L;
            NodeRecord record = new NodeRecord(nodeId, false, NO_NEXT_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue());

            record.InUse = true;
            record.SetLabelField(labels, Collections.emptyList());
            _nodeStore.updateRecord(record);

            // WHEN
            // -- reading that record back
            NodeRecord readRecord = _nodeStore.getRecord(nodeId, _nodeStore.newRecord(), NORMAL);

            // THEN
            // -- the label field must be the same
            assertEquals(labels, readRecord.LabelField);
        }
Exemplo n.º 8
0
 public override void Clear()
 {
     Initialize(false, NO_NEXT_PROPERTY.intValue(), -1, -1, -1, 1, NO_NEXT_RELATIONSHIP.intValue(), 1, NO_NEXT_RELATIONSHIP.intValue(), true, true);
 }
Exemplo n.º 9
0
 public virtual void Delete(NodeRecord node)
 {
     node.InUse = false;
     Add(node, new NodeRecord(node.Id, false, NO_PREV_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue()));
 }
Exemplo n.º 10
0
 public virtual void Create(NodeRecord node)
 {
     node.SetCreated();
     Update(new NodeRecord(node.Id, false, NO_PREV_RELATIONSHIP.intValue(), NO_NEXT_PROPERTY.intValue()), node);
 }