Skip to content

Commit

Permalink
Some code clarifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusmelke committed Dec 4, 2017
1 parent f37b84f commit a543c4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Expand Up @@ -265,6 +265,8 @@ void relationship( RelationshipRecord record, long reference, PageCursor pageCur
@Override
void property( PropertyRecord record, long reference, PageCursor pageCursor )
{
//We need to load forcefully here since otherwise we can have inconsistent reads
//for properties across blocks, see org.neo4j.graphdb.ConsistentPropertyReadsIT
properties.loadRecordByCursor( reference, record, RecordLoad.FORCE, pageCursor );
}

Expand Down
Expand Up @@ -76,6 +76,7 @@ void single( long reference, Read read )
pageCursor = read.nodePage( reference );
}
this.next = reference;
//This marks the cursor as a "single cursor"
this.highMark = NO_ID;
this.read = read;
this.labelCursor = read.labelCursor();
Expand Down Expand Up @@ -229,14 +230,15 @@ else if ( hasChanges && txs.nodeIsDeletedInThisTx( next ) )
}
if ( next > highMark )
{
if ( highMark == NO_ID )
if ( isSingle() )
{
//we are using single
//we are a "single cursor"
next = NO_ID;
return inUse();
}
else
{
//we are a "scan cursor"
//Check if there is a new high mark
highMark = read.nodeHighMark();
if ( next > highMark )
Expand Down Expand Up @@ -288,4 +290,9 @@ private void reset()
next = NO_ID;
setId( NO_ID );
}

private boolean isSingle()
{
return highMark == NO_ID;
}
}
Expand Up @@ -465,6 +465,8 @@ private static ByteBuffer readDynamic( AbstractDynamicStore store, long referenc
DynamicRecord record = store.newRecord();
do
{
//We need to load forcefully here since otherwise we can have inconsistent reads
//for properties across blocks, see org.neo4j.graphdb.ConsistentPropertyReadsIT
store.getRecordByCursor( reference, record, RecordLoad.FORCE, page );
reference = record.getNextBlock();
byte[] data = record.getData();
Expand Down

0 comments on commit a543c4b

Please sign in to comment.