@Override public boolean nodeExists( long id ) { return nodeStore.isInUse( id ); }
@Override public boolean nodeExists( long nodeId ) { flushStrategy.forceFlush(); return nodeStore.isInUse( nodeId ); }
@Override public void createNode( long id, Map<String, Object> properties, Label... labels ) { IdValidator.assertValidId( IdType.NODE, id, maxNodeId ); if ( nodeStore.isInUse( id ) ) { throw new IllegalArgumentException( "id=" + id + " already in use" ); } long highId = nodeStore.getHighId(); if ( highId <= id ) { nodeStore.setHighestPossibleIdInUse( id ); } internalCreateNode( id, properties, labels ); }
@Test public void shouldTellNodeInUse() throws Exception { // Given EphemeralFileSystemAbstraction fs = efs.get(); NodeStore store = newNodeStore( fs ); long exists = store.nextId(); store.updateRecord( new NodeRecord( exists, false, 10, 20, true ) ); long deleted = store.nextId(); store.updateRecord( new NodeRecord( deleted, false, 10, 20, true ) ); store.updateRecord( new NodeRecord( deleted, false, 10, 20, false ) ); // When & then assertTrue( store.isInUse( exists ) ); assertFalse( store.isInUse( deleted ) ); assertFalse( store.isInUse( nodeStore.recordFormat.getMaxId() ) ); }
assertEquals( expectedToBeInUse, neoStores.getNodeStore().isInUse( entity.node.getId() ) );
@Override public boolean nodeExists( long id ) { return nodeStore.isInUse( id ); }
@Override public boolean nodeExists( long nodeId ) { flushStrategy.forceFlush(); return nodeStore.isInUse( nodeId ); }
@Override public void createNode( long id, Map<String, Object> properties, Label... labels ) { IdValidator.assertValidId( IdType.NODE, id, maxNodeId ); if ( nodeStore.isInUse( id ) ) { throw new IllegalArgumentException( "id=" + id + " already in use" ); } long highId = nodeStore.getHighId(); if ( highId <= id ) { nodeStore.setHighestPossibleIdInUse( id ); } internalCreateNode( id, properties, labels ); }