Skip to content

Commit

Permalink
Remove StoreScanner dependency from Buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
s1ck committed Nov 20, 2023
1 parent 5791f18 commit 412067c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
*/
package org.neo4j.gds.core.loading;

import org.apache.commons.lang3.NotImplementedException;
import org.immutables.builder.Builder;
import org.neo4j.gds.compat.PropertyReference;

import java.util.Optional;

public class NodesBatchBuffer extends RecordsBatchBuffer<NodeReference> {
public class NodesBatchBuffer extends RecordsBatchBuffer {

private final boolean hasLabelInformation;

Expand Down Expand Up @@ -58,11 +57,6 @@ private NodesBatchBuffer(
this.labelTokens = new NodeLabelTokenSet[capacity];
}

@Override
public boolean offer(final NodeReference record) {
throw new NotImplementedException();
}

public void add(long nodeId, PropertyReference propertyReference, NodeLabelTokenSet labelTokens) {
int len = length++;
buffer[len] = nodeId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
package org.neo4j.gds.core.loading;

public abstract class RecordsBatchBuffer<Reference> implements StoreScanner.RecordConsumer<Reference> {
public abstract class RecordsBatchBuffer {

public static final int DEFAULT_BUFFER_SIZE = 100_000;

Expand All @@ -42,7 +42,6 @@ public boolean isFull() {
return length >= buffer.length;
}

@Override
public void reset() {
this.length = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
*/
package org.neo4j.gds.core.loading;

import org.apache.commons.lang3.NotImplementedException;
import org.immutables.builder.Builder;
import org.neo4j.gds.compat.PropertyReference;


public final class RelationshipsBatchBuffer extends RecordsBatchBuffer<RelationshipReference> {
public final class RelationshipsBatchBuffer extends RecordsBatchBuffer {

// For relationships, the buffer is divided into 2-long blocks
// for each relationship: source, target. Relationship and
Expand Down Expand Up @@ -55,11 +54,6 @@ private RelationshipsBatchBuffer(int capacity) {
histogram = RadixSort.newHistogram(capacity);
}

@Override
public boolean offer(final RelationshipReference record) {
throw new NotImplementedException();
}

public void add(long sourceId, long targetId) {
int position = this.length;
long[] buffer = this.buffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@
package org.neo4j.gds.core.loading;

import org.immutables.value.Value;
import org.jetbrains.annotations.NotNull;
import org.neo4j.gds.PropertyMapping;
import org.neo4j.gds.RelationshipProjection;
import org.neo4j.gds.RelationshipType;
import org.neo4j.gds.annotation.ValueClass;
import org.neo4j.gds.api.PartialIdMap;
import org.neo4j.gds.api.compress.AdjacencyCompressor;
import org.neo4j.gds.api.compress.AdjacencyCompressorFactory;
import org.neo4j.gds.api.compress.AdjacencyListsWithProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.neo4j.gds.core.loading.RelationshipReference;
import org.neo4j.gds.core.loading.StoreScanner;

public final class BufferedCompositeRelationshipConsumer extends RecordsBatchBuffer<RelationshipReference> implements StoreScanner.RecordConsumer<RelationshipReference> {
public final class BufferedCompositeRelationshipConsumer extends RecordsBatchBuffer implements StoreScanner.RecordConsumer<RelationshipReference> {

private final BufferedRelationshipConsumer[] buffers;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.neo4j.gds.core.huge.DirectIdMap;
import org.neo4j.gds.core.loading.RecordsBatchBuffer;
import org.neo4j.gds.core.loading.RelationshipReference;
import org.neo4j.gds.core.loading.StoreScanner;

import java.util.stream.IntStream;

Expand Down

0 comments on commit 412067c

Please sign in to comment.