Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed May 8, 2017
1 parent 0ebb2ee commit 1bffadd
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Expand Up @@ -492,7 +492,7 @@ class IDPQueryGraphSolverTest extends CypherFunSuite with LogicalPlanningTestSup
new IDPSolverConfig { new IDPSolverConfig {
override def solvers(queryGraph: QueryGraph): Seq[(QueryGraph) => IDPSolverStep[PatternRelationship, LogicalPlan, LogicalPlanningContext]] = override def solvers(queryGraph: QueryGraph): Seq[(QueryGraph) => IDPSolverStep[PatternRelationship, LogicalPlan, LogicalPlanningContext]] =
ExpandOnlyWhenPatternIsLong.solvers(queryGraph) ExpandOnlyWhenPatternIsLong.solvers(queryGraph)
override def iterationDurationLimit: Long = 100 override def iterationDurationLimit: Long = 50
}, },
new ConfigurableIDPSolverConfig(maxTableSize = 32, iterationDurationLimit = Long.MaxValue), // table limited new ConfigurableIDPSolverConfig(maxTableSize = 32, iterationDurationLimit = Long.MaxValue), // table limited
new ConfigurableIDPSolverConfig(maxTableSize = Int.MaxValue, iterationDurationLimit = 500), // time limited new ConfigurableIDPSolverConfig(maxTableSize = Int.MaxValue, iterationDurationLimit = 500), // time limited
Expand Down
Expand Up @@ -41,7 +41,7 @@ public abstract class StoreAbstractIteratorRelationshipCursor extends StoreAbstr
super( relationshipRecord, cursors, lockService ); super( relationshipRecord, cursors, lockService );
} }


protected StoreAbstractIteratorRelationshipCursor init( ReadableTransactionState state, protected StoreAbstractIteratorRelationshipCursor internalInitTxState( ReadableTransactionState state,
PrimitiveLongIterator addedRelationshipIterator ) PrimitiveLongIterator addedRelationshipIterator )
{ {
this.state = state; this.state = state;
Expand Down
Expand Up @@ -67,6 +67,7 @@ public final boolean next()


private boolean fetchNext() private boolean fetchNext()
{ {
property = null;
while ( loadNextFromDisk() ) while ( loadNextFromDisk() )
{ {
// Are there more properties to return for this current record we're at? // Are there more properties to return for this current record we're at?
Expand Down Expand Up @@ -95,23 +96,23 @@ else if ( Record.NO_NEXT_PROPERTY.is( recordCursor.get().getNextProp() ) )
// Continue to next record in the chain and try there. // Continue to next record in the chain and try there.
} }


assert property == null;
return (property = nextAdded()) != null; return (property = nextAdded()) != null;
} }


private boolean payloadHasNext() private boolean payloadHasNext()
{ {
boolean next = payload.next(); boolean next = payload.next();
if ( next && state != null ) while ( next && state != null )
{ {
int propertyKeyId = payload.propertyKeyId(); int propertyKeyId = payload.propertyKeyId();
if ( state.isPropertyRemoved( propertyKeyId ) ) if ( !state.isPropertyRemoved( propertyKeyId ) )
{
return false;
}
if ( property == null )
{ {
assert property == null;
property = (DefinedProperty) state.getChangedProperty( propertyKeyId ); property = (DefinedProperty) state.getChangedProperty( propertyKeyId );
return true;
} }
next = payload.next();
} }
return next; return next;
} }
Expand Down
Expand Up @@ -47,7 +47,7 @@ public class StoreIteratorRelationshipCursor extends StoreAbstractIteratorRelati


public StoreIteratorRelationshipCursor init( PrimitiveLongIterator iterator, ReadableTransactionState state ) public StoreIteratorRelationshipCursor init( PrimitiveLongIterator iterator, ReadableTransactionState state )
{ {
super.init( state, addedRelationships( state ) ); internalInitTxState( state, addedRelationships( state ) );
this.iterator = iterator; this.iterator = iterator;
return this; return this;
} }
Expand Down
Expand Up @@ -86,7 +86,7 @@ public StoreNodeRelationshipCursor init( boolean isDense, long firstRelId, long
private StoreNodeRelationshipCursor init( boolean isDense, long firstRelId, long fromNodeId, Direction direction, private StoreNodeRelationshipCursor init( boolean isDense, long firstRelId, long fromNodeId, Direction direction,
IntPredicate allowedTypes, ReadableTransactionState state, PrimitiveLongIterator addedNodeRelationships ) IntPredicate allowedTypes, ReadableTransactionState state, PrimitiveLongIterator addedNodeRelationships )
{ {
super.init( state, addedNodeRelationships ); internalInitTxState( state, addedNodeRelationships );
this.isDense = isDense; this.isDense = isDense;
this.relationshipId = firstRelId; this.relationshipId = firstRelId;
this.fromNodeId = fromNodeId; this.fromNodeId = fromNodeId;
Expand Down
Expand Up @@ -174,7 +174,7 @@ public Cursor<RelationshipItem> acquireNodeRelationshipCursor( boolean isDense,
public Cursor<RelationshipItem> relationshipsGetAllCursor( ReadableTransactionState state ) public Cursor<RelationshipItem> relationshipsGetAllCursor( ReadableTransactionState state )
{ {
neoStores.assertOpen(); neoStores.assertOpen();
return iteratorRelationshipCursor.get().init( state, new AllIdIterator( relationshipStore ) ); return iteratorRelationshipCursor.get().init( new AllIdIterator( relationshipStore ), state );
} }


@Override @Override
Expand Down

0 comments on commit 1bffadd

Please sign in to comment.