record.setUseFixedReferences( usesFixedReferenceFormat );
record.setUseFixedReferences( usesFixedReferenceFormat );
@Test public void nodeCommandWithFixedReferenceFormat300() throws Exception { // Given InMemoryClosableChannel channel = new InMemoryClosableChannel(); NodeRecord before = new NodeRecord( 42, true, false, 33, 99, 66 ); NodeRecord after = new NodeRecord( 42, true, false, 33, 99, 66 ); before.setUseFixedReferences( true ); after.setUseFixedReferences( true ); new Command.NodeCommand( before, after ).serialize( channel ); // When PhysicalLogCommandReaderV3_0 reader = new PhysicalLogCommandReaderV3_0(); Command command = reader.read( channel ); assertTrue( command instanceof Command.NodeCommand); Command.NodeCommand nodeCommand = (Command.NodeCommand) command; // Then assertEquals( before, nodeCommand.getBefore() ); assertEquals( after, nodeCommand.getAfter() ); assertTrue( nodeCommand.getBefore().isUseFixedReferences() ); assertTrue( nodeCommand.getAfter().isUseFixedReferences() ); }
@Test public void nodeCommandWithFixedReferenceFormat302() throws Exception { // Given InMemoryClosableChannel channel = new InMemoryClosableChannel(); NodeRecord before = new NodeRecord( 42, true, false, 33, 99, 66 ); NodeRecord after = new NodeRecord( 42, true, false, 33, 99, 66 ); before.setUseFixedReferences( true ); after.setUseFixedReferences( true ); new Command.NodeCommand( before, after ).serialize( channel ); // When PhysicalLogCommandReaderV3_0_2 reader = new PhysicalLogCommandReaderV3_0_2(); Command command = reader.read( channel ); assertTrue( command instanceof Command.NodeCommand); Command.NodeCommand nodeCommand = (Command.NodeCommand) command; // Then assertEquals( before, nodeCommand.getBefore() ); assertEquals( after, nodeCommand.getAfter() ); assertTrue( nodeCommand.getBefore().isUseFixedReferences() ); assertTrue( nodeCommand.getAfter().isUseFixedReferences() ); }
@Override protected void doReadInternal( NodeRecord record, PageCursor cursor, int recordSize, long headerByte, boolean inUse ) { // Interpret the header byte boolean dense = has( headerByte, DENSE_NODE_BIT ); if ( record.isUseFixedReferences() ) { // read record in a fixed reference format readFixedReferencesRecord( record, cursor, inUse, dense ); record.setUseFixedReferences( true ); } else { // Now read the rest of the data. The adapter will take care of moving the cursor over to the // other unit when we've exhausted the first one. long nextRel = decodeCompressedReference( cursor, headerByte, HAS_RELATIONSHIP_BIT, NULL ); long nextProp = decodeCompressedReference( cursor, headerByte, HAS_PROPERTY_BIT, NULL ); long labelField = decodeCompressedReference( cursor, headerByte, HAS_LABELS_BIT, NULL_LABELS ); record.initialize( inUse, nextProp, dense, nextRel, labelField ); } }
@Override protected void doReadInternal( NodeRecord record, PageCursor cursor, int recordSize, long headerByte, boolean inUse ) { // Interpret the header byte boolean dense = has( headerByte, DENSE_NODE_BIT ); if ( record.isUseFixedReferences() ) { // read record in a fixed reference format readFixedReferencesRecord( record, cursor, inUse, dense ); record.setUseFixedReferences( true ); } else { // Now read the rest of the data. The adapter will take care of moving the cursor over to the // other unit when we've exhausted the first one. long nextRel = decodeCompressedReference( cursor, headerByte, HAS_RELATIONSHIP_BIT, NULL ); long nextProp = decodeCompressedReference( cursor, headerByte, HAS_PROPERTY_BIT, NULL ); long labelField = decodeCompressedReference( cursor, headerByte, HAS_LABELS_BIT, NULL_LABELS ); record.initialize( inUse, nextProp, dense, nextRel, labelField ); } }
@Override protected void doReadInternal( NodeRecord record, PageCursor cursor, int recordSize, long headerByte, boolean inUse ) { // Interpret the header byte boolean dense = has( headerByte, DENSE_NODE_BIT ); if ( record.isUseFixedReferences() ) { // read record in a fixed reference format readFixedReferencesRecord( record, cursor, inUse, dense ); record.setUseFixedReferences( true ); } else { // Now read the rest of the data. The adapter will take care of moving the cursor over to the // other unit when we've exhausted the first one. long nextRel = decodeCompressedReference( cursor, headerByte, HAS_RELATIONSHIP_BIT, NULL ); long nextProp = decodeCompressedReference( cursor, headerByte, HAS_PROPERTY_BIT, NULL ); long labelField = decodeCompressedReference( cursor, headerByte, HAS_LABELS_BIT, NULL_LABELS ); record.initialize( inUse, nextProp, dense, nextRel, labelField ); } }
@Override protected void doReadInternal( NodeRecord record, PageCursor cursor, int recordSize, long headerByte, boolean inUse ) { // Interpret the header byte boolean dense = has( headerByte, DENSE_NODE_BIT ); if ( record.isUseFixedReferences() ) { // read record in a fixed reference format readFixedReferencesRecord( record, cursor, inUse, dense ); record.setUseFixedReferences( true ); } else { // Now read the rest of the data. The adapter will take care of moving the cursor over to the // other unit when we've exhausted the first one. long nextRel = decodeCompressedReference( cursor, headerByte, HAS_RELATIONSHIP_BIT, NULL ); long nextProp = decodeCompressedReference( cursor, headerByte, HAS_PROPERTY_BIT, NULL ); long labelField = decodeCompressedReference( cursor, headerByte, HAS_LABELS_BIT, NULL_LABELS ); record.initialize( inUse, nextProp, dense, nextRel, labelField ); } }
record.setUseFixedReferences( usesFixedReferenceFormat );
record.setUseFixedReferences( usesFixedReferenceFormat );