for ( Node node : db.getAllNodes() ) NodeRep nodeRep = new NodeRep( db, node, includeIndexes ); result.nodes.put( node.getId(), nodeRep ); result.highestNodeId = Math.max( node.getId(), result.highestNodeId );
NodeRep( GraphDatabaseService db, Node node, boolean includeIndexes ) { id = node.getId(); properties = new PropertiesRep( node, node.getId() ); long highestRel = 0; for ( Relationship rel : node.getRelationships( Direction.OUTGOING ) ) { outRelationships.put( rel.getId(), new PropertiesRep( rel, rel.getId() ) ); highestRel = Math.max( highestRel, rel.getId() ); } this.highestRelationshipId = highestRel; this.index = includeIndexes ? checkIndex( db ) : null; }
private void nodeDiff( DbRepresentation other, DiffReport diff ) { for ( NodeRep node : nodes.values() ) { NodeRep otherNode = other.nodes.get( node.id ); if ( otherNode == null ) { diff.add( "I have node " + node.id + " which other doesn't" ); continue; } node.compareWith( otherNode, diff ); } for ( Long id : other.nodes.keySet() ) { if ( !nodes.containsKey( id ) ) { diff.add( "Other has node " + id + " which I don't" ); } } }
for ( Node node : db.getAllNodes() ) NodeRep nodeRep = new NodeRep( db, node, includeIndexes ); result.nodes.put( node.getId(), nodeRep ); result.highestNodeId = Math.max( node.getId(), result.highestNodeId );
private void nodeDiff( DbRepresentation other, DiffReport diff ) { for ( NodeRep node : nodes.values() ) { NodeRep otherNode = other.nodes.get( node.id ); if ( otherNode == null ) { diff.add( "I have node " + node.id + " which other doesn't" ); continue; } node.compareWith( otherNode, diff ); } for ( Long id : other.nodes.keySet() ) { if ( !nodes.containsKey( id ) ) { diff.add( "Other has node " + id + " which I don't" ); } } }
NodeRep( GraphDatabaseService db, Node node, boolean includeIndexes ) { id = node.getId(); properties = new PropertiesRep( node, node.getId() ); long highestRel = 0; for ( Relationship rel : node.getRelationships( Direction.OUTGOING ) ) { outRelationships.put( rel.getId(), new PropertiesRep( rel, rel.getId() ) ); highestRel = Math.max( highestRel, rel.getId() ); } this.highestRelationshipId = highestRel; this.index = includeIndexes ? checkIndex( db ) : null; }
void compareWith( NodeRep other, DiffReport diff ) { if ( other.id != id ) { diff.add( "Id differs mine:" + id + ", other:" + other.id ); } properties.compareWith( other.properties, diff ); if ( index != null && other.index != null ) { compareIndex( other, diff ); } compareRelationships( other, diff ); }
void compareWith( NodeRep other, DiffReport diff ) { if ( other.id != id ) { diff.add( "Id differs mine:" + id + ", other:" + other.id ); } properties.compareWith( other.properties, diff ); if ( index != null && other.index != null ) { compareIndex( other, diff ); } compareRelationships( other, diff ); }