Skip to content

Commit

Permalink
Removes RecordCursors and usages thereof
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Jul 2, 2018
1 parent f1be26e commit 678780a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.neo4j.kernel.impl.store.NeoStores;
import org.neo4j.kernel.impl.store.NodeStore;
import org.neo4j.kernel.impl.store.PropertyStore;
import org.neo4j.kernel.impl.store.RecordCursors;
import org.neo4j.kernel.impl.store.RelationshipGroupStore;
import org.neo4j.kernel.impl.store.RelationshipStore;
import org.neo4j.kernel.impl.store.SchemaStorage;
Expand Down Expand Up @@ -84,7 +83,6 @@ public class RecordStorageReader implements StorageReader

private final Supplier<IndexReaderFactory> indexReaderFactorySupplier;
private final Supplier<LabelScanReader> labelScanReaderSupplier;
private final RecordCursors recordCursors;
private final RecordStorageCommandCreationContext commandCreationContext;

private IndexReaderFactory indexReaderFactory;
Expand Down Expand Up @@ -113,7 +111,6 @@ public class RecordStorageReader implements StorageReader
this.indexReaderFactorySupplier = indexReaderFactory;
this.labelScanReaderSupplier = labelScanReaderSupplier;
this.commandCreationContext = commandCreationContext;
this.recordCursors = new RecordCursors( neoStores );
}

/**
Expand Down Expand Up @@ -379,7 +376,6 @@ public void close()
{
assert !closed;
closeSchemaResources();
recordCursors.close();
commandCreationContext.close();
closed = true;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
import org.neo4j.kernel.impl.store.NodeStore;
import org.neo4j.kernel.impl.store.PropertyKeyTokenStore;
import org.neo4j.kernel.impl.store.PropertyStore;
import org.neo4j.kernel.impl.store.RecordCursors;
import org.neo4j.kernel.impl.store.RecordStore;
import org.neo4j.kernel.impl.store.RelationshipStore;
import org.neo4j.kernel.impl.store.RelationshipTypeTokenStore;
Expand Down Expand Up @@ -236,7 +235,6 @@ public Label apply( long from )
private final LabelTokenStore labelTokenStore;
private final Locks.Client noopLockClient = new NoOpClient();
private final long maxNodeId;
private final RecordCursors cursors;

public BatchInserterImpl( final File storeDir, final FileSystemAbstraction fileSystem,
Map<String, String> stringParams, Iterable<KernelExtensionFactory<?>> kernelExtensions ) throws IOException
Expand Down Expand Up @@ -329,7 +327,6 @@ public BatchInserterImpl( final File storeDir, final FileSystemAbstraction fileS

flushStrategy = new BatchedFlushStrategy( recordAccess, config.get( GraphDatabaseSettings
.batch_inserter_batch_size ) );
cursors = new RecordCursors( neoStores );
storageReader = new RecordStorageReader( neoStores );
}

Expand Down Expand Up @@ -917,7 +914,7 @@ public Map<String,Object> getNodeProperties( long nodeId )
public Iterable<Long> getRelationshipIds( long nodeId )
{
flushStrategy.forceFlush();
return new BatchRelationshipIterable<Long>( storageReader, nodeId, cursors )
return new BatchRelationshipIterable<Long>( storageReader, nodeId )
{
@Override
protected Long nextFrom( long relId, int type, long startNode, long endNode )
Expand All @@ -931,7 +928,7 @@ protected Long nextFrom( long relId, int type, long startNode, long endNode )
public Iterable<BatchRelationship> getRelationships( long nodeId )
{
flushStrategy.forceFlush();
return new BatchRelationshipIterable<BatchRelationship>( storageReader, nodeId, cursors )
return new BatchRelationshipIterable<BatchRelationship>( storageReader, nodeId )
{
@Override
protected BatchRelationship nextFrom( long relId, int type, long startNode, long endNode )
Expand Down Expand Up @@ -996,7 +993,6 @@ public void shutdown()
}
finally
{
cursors.close();
neoStores.close();

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
import org.neo4j.helpers.collection.PrefetchingIterator;
import org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordNodeCursor;
import org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageReader;
import org.neo4j.kernel.impl.store.RecordCursors;
import org.neo4j.storageengine.api.StorageRelationshipTraversalCursor;

abstract class BatchRelationshipIterable<T> implements Iterable<T>
{
private final StorageRelationshipTraversalCursor relationshipCursor;

BatchRelationshipIterable( RecordStorageReader storageReader, long nodeId, RecordCursors cursors )
BatchRelationshipIterable( RecordStorageReader storageReader, long nodeId )
{
relationshipCursor = storageReader.allocateRelationshipTraversalCursor();
RecordNodeCursor nodeCursor = storageReader.allocateNodeCursor();
Expand Down

This file was deleted.

0 comments on commit 678780a

Please sign in to comment.