@Override public void check( RelationshipGroupRecord record, CheckerEngine<RelationshipGroupRecord, RelationshipGroupConsistencyReport> engine, RecordAccess records ) { if ( !record.inUse() ) { return; } for ( RecordField<RelationshipGroupRecord, RelationshipGroupConsistencyReport> field : fields ) { field.checkConsistency( record, engine, records ); } } }
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { // These records are read page-wise forwards, but should be cached in reverse // since the records exists in the store in reverse order. for ( int i = batch.length - 1; i >= 0; i-- ) { RelationshipGroupRecord record = batch[i]; if ( record.inUse() ) { cache.put( record ); } } } }
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { for ( RelationshipGroupRecord record : batch ) { if ( record.inUse() ) { cache.incrementGroupCount( record.getOwningNode() ); } } } }
@Override public String toString() { return "RelationshipGroup[" + getId() + ",type=" + type + ",out=" + firstOut + ",in=" + firstIn + ",loop=" + firstLoop + ",prev=" + prev + ",next=" + next + ",used=" + inUse() + ",owner=" + getOwningNode() + ",secondaryUnitId=" + getSecondaryUnitId() + "]"; }
@Override public RelationshipGroupRecord clone() { RelationshipGroupRecord clone = new RelationshipGroupRecord( getId() ).initialize( inUse(), type, firstOut, firstIn, firstLoop, owningNode, next ); clone.setSecondaryUnitId( getSecondaryUnitId() ); return clone; }
@Override public void checkReference( NodeRecord record, RelationshipGroupRecord group, CheckerEngine<NodeRecord, NodeConsistencyReport> engine, RecordAccess records ) { if ( !group.inUse() ) { engine.report().relationshipGroupNotInUse( group ); } else { if ( group.getOwningNode() != record.getId() ) { engine.report().relationshipGroupHasOtherOwner( group ); } } } }
@Override public void checkReference( RelationshipGroupRecord record, RelationshipGroupRecord referred, CheckerEngine<RelationshipGroupRecord, RelationshipGroupConsistencyReport> engine, RecordAccess records ) { if ( !referred.inUse() ) { engine.report().nextGroupNotInUse(); } else { if ( record.getType() >= referred.getType() ) { engine.report().invalidTypeSortOrder(); } if ( record.getOwningNode() != referred.getOwningNode() ) { engine.report().nextHasOtherOwner( referred ); } } } }
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { for ( RelationshipGroupRecord group : batch ) { if ( !group.inUse() ) { continue; } long nodeId = group.getOwningNode(); if ( cache.getByte( nodeId, 0 ) == 0 ) { cache.setByte( nodeId, 0, (byte) 1 ); NodeRecord nodeRecord = nodeStore.newRecord(); nodeStore.getRecordByCursor( nodeId, nodeRecord, NORMAL, nodeCursor ); nodeRecord.setNextRel( group.getId() ); nodeRecord.setDense( true ); current[cursor++] = nodeRecord; if ( cursor == batchSize ) { sender.send( current ); newBatch(); } } } control.recycle( batch ); }
recordChangeSet.getRelGroupRecords().changes() ) if ( change.isCreated() && !change.forReadingLinkage().inUse() )
private static void assertValidRelGroupCommand( StorageCommand command ) { assertThat( command, instanceOf( RelationshipGroupCommand.class ) ); RelationshipGroupCommand relGroupCommand = (RelationshipGroupCommand) command; RelationshipGroupRecord record = relGroupCommand.getAfter(); assertEquals( ID, record.getId() ); if ( IN_USE_FLAG == Record.IN_USE.byteValue() ) { assertTrue( record.inUse() ); } else if ( IN_USE_FLAG == Record.NOT_IN_USE.byteValue() ) { assertFalse( record.inUse() ); } else { throw new IllegalStateException( "Illegal inUse flag: " + IN_USE_FLAG ); } assertEquals( TYPE_AS_INT, record.getType() ); assertEquals( NEXT, record.getNext() ); assertEquals( FIRST_OUT, record.getFirstOut() ); assertEquals( FIRST_IN, record.getFirstIn() ); assertEquals( FIRST_LOOP, record.getNext() ); assertEquals( OWNING_NODE, record.getOwningNode() ); }
private void writeRelationshipGroupRecord( WritableChannel channel, RelationshipGroupRecord record ) throws IOException { byte flags = bitFlags( bitFlag( record.inUse(), Record.IN_USE.byteValue() ), bitFlag( record.requiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT ), bitFlag( record.hasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT ), bitFlag( record.isUseFixedReferences(), Record.USES_FIXED_REFERENCE_FORMAT ) ); channel.put( flags ); channel.putShort( (short) record.getType() ); channel.putLong( record.getNext() ); channel.putLong( record.getFirstOut() ); channel.putLong( record.getFirstIn() ); channel.putLong( record.getFirstLoop() ); channel.putLong( record.getOwningNode() ); if ( record.hasSecondaryUnitId() ) { channel.putLong( record.getSecondaryUnitId() ); } } }
@Override public void write( RelationshipGroupRecord record, PageCursor cursor, int recordSize ) if ( record.inUse() )
if ( !groupRecord.inUse() )
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { // These records are read page-wise forwards, but should be cached in reverse // since the records exists in the store in reverse order. for ( int i = batch.length - 1; i >= 0; i-- ) { RelationshipGroupRecord record = batch[i]; if ( record.inUse() ) { cache.put( record ); } } } }
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { for ( RelationshipGroupRecord record : batch ) { if ( record.inUse() ) { cache.incrementGroupCount( record.getOwningNode() ); } } } }
@Override public String toString() { return "RelationshipGroup[" + getId() + ",type=" + type + ",out=" + firstOut + ",in=" + firstIn + ",loop=" + firstLoop + ",prev=" + prev + ",next=" + next + ",used=" + inUse() + ",owner=" + getOwningNode() + ",secondaryUnitId=" + getSecondaryUnitId() + "]"; }
@Override public RelationshipGroupRecord clone() { RelationshipGroupRecord clone = new RelationshipGroupRecord( getId() ).initialize( inUse(), type, firstOut, firstIn, firstLoop, owningNode, next ); clone.setSecondaryUnitId( getSecondaryUnitId() ); return clone; }
@Override protected void process( RelationshipGroupRecord[] batch, BatchSender sender ) { for ( RelationshipGroupRecord group : batch ) { if ( !group.inUse() ) { continue; } long nodeId = group.getOwningNode(); if ( cache.getByte( nodeId, 0 ) == 0 ) { cache.setByte( nodeId, 0, (byte) 1 ); NodeRecord nodeRecord = nodeStore.newRecord(); nodeStore.getRecordByCursor( nodeId, nodeRecord, NORMAL, nodeCursor ); nodeRecord.setNextRel( group.getId() ); nodeRecord.setDense( true ); current[cursor++] = nodeRecord; if ( cursor == batchSize ) { sender.send( current ); newBatch(); } } } control.recycle( batch ); }
private void writeRelationshipGroupRecord( WritableChannel channel, RelationshipGroupRecord record ) throws IOException { byte flags = bitFlags( bitFlag( record.inUse(), Record.IN_USE.byteValue() ), bitFlag( record.requiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT ), bitFlag( record.hasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT ), bitFlag( record.isUseFixedReferences(), Record.USES_FIXED_REFERENCE_FORMAT ) ); channel.put( flags ); channel.putShort( (short) record.getType() ); channel.putLong( record.getNext() ); channel.putLong( record.getFirstOut() ); channel.putLong( record.getFirstIn() ); channel.putLong( record.getFirstLoop() ); channel.putLong( record.getOwningNode() ); if ( record.hasSecondaryUnitId() ) { channel.putLong( record.getSecondaryUnitId() ); } } }
@Override public void write( RelationshipGroupRecord record, PageCursor cursor, int recordSize ) if ( record.inUse() )