@Override public long getNextRecordReference( RECORD record ) { return Record.NULL_REFERENCE.intValue(); }
@Override public long getNextRecordReference( RECORD record ) { return Record.NULL_REFERENCE.intValue(); }
private static long[] getInitVals( int[] slotSizes ) { long[] initVals = new long[slotSizes.length]; for ( int i = 0; i < initVals.length; i++ ) { initVals[i] = isId( slotSizes, i ) ? Record.NO_NEXT_RELATIONSHIP.intValue() : 0; } return initVals; }
@Override protected boolean isRecordReserved( PageCursor cursor ) { return cursor.getInt() == Record.RESERVED.intValue(); } }
@Override public boolean endOfChain( RelationshipRecord rel ) { return rel.getSecondNextRel() == Record.NO_NEXT_RELATIONSHIP.intValue(); } },
@Override public void clear() { initialize( false, Record.NO_NEXT_BLOCK.intValue() ); }
@Override public boolean endOfChain( RelationshipRecord rel ) { return rel.getFirstNextRel() == Record.NO_NEXT_RELATIONSHIP.intValue(); } },
@Override public void clear() { initialize( false, true, Record.NO_NEXT_BLOCK.intValue(), -1, 0 ); }
@Override public void clear() { super.clear(); nextProp = Record.NO_NEXT_PROPERTY.intValue(); }
@Override public void checkConsistency( RelationshipGroupRecord record, CheckerEngine<RelationshipGroupRecord, RelationshipGroupConsistencyReport> engine, RecordAccess records ) { long relId = valueFrom( record ); if ( relId != Record.NO_NEXT_RELATIONSHIP.intValue() ) { engine.comparativeCheck( records.relationship( relId ), this ); } }
private boolean primitiveHasProperty( PrimitiveRecord record, String propertyName ) { int propertyKeyId = tokenHolders.propertyKeyTokens().getIdByName( propertyName ); return propertyKeyId != NO_TOKEN && propertyTraverser.findPropertyRecordContaining( record, propertyKeyId, recordAccess.getPropertyRecords(), false ) != Record.NO_NEXT_PROPERTY.intValue(); }
@Override public Map<String,Object> getRelationshipProperties( long relId ) { RelationshipRecord record = recordAccess.getRelRecords().getOrLoad( relId, null ).forChangingData(); if ( record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue() ) { return getPropertyChain( record.getNextProp() ); } return Collections.emptyMap(); }
@Test public 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.isLight() ); }
@Test public 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.isLight() ); }
@Override public void setNodeProperties( long node, Map<String, Object> properties ) { NodeRecord record = getNodeRecord( node ).forChangingData(); if ( record.getNextProp() != Record.NO_NEXT_PROPERTY.intValue() ) { propertyDeletor.deletePropertyChain( record, recordAccess.getPropertyRecords() ); } record.setNextProp( propertyCreator.createPropertyChain( record, propertiesIterator( properties ), recordAccess.getPropertyRecords() ) ); flushStrategy.flush(); }
private static int manuallyCountRelationships( RecordChangeSet recordChangeSet, long nodeId, long firstRelId ) { int count = 0; long relId = firstRelId; while ( relId != Record.NO_NEXT_RELATIONSHIP.intValue() ) { count++; RelationshipRecord record = recordChangeSet.getRelRecords().getOrLoad( relId, null ).forReadingData(); relId = record.getFirstNode() == nodeId ? record.getFirstNextRel() : record.getSecondNextRel(); } return count; }
@Override protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next ) { long node = next.node(); long group = next.relationshipGroup(); tx.create( inUse( new NodeRecord( node, true, group, NO_NEXT_PROPERTY.intValue() ) ) ); tx.create( withOwner( withNext( inUse( new RelationshipGroupRecord( group, C ) ), group + 1 /*non-existent group id*/ ), node ) ); } } );
@Override protected void transactionData( GraphStoreFixture.TransactionDataBuilder tx, GraphStoreFixture.IdGenerator next ) { long node = next.node(); long group = next.relationshipGroup(); int nonExistentType = next.relationshipType() + 1; tx.create( inUse( new NodeRecord( node, true, group, NO_NEXT_PROPERTY.intValue() ) ) ); tx.create( withOwner( inUse( new RelationshipGroupRecord( group, nonExistentType ) ), node ) ); } } );