Skip to content

Commit 8b5aa30

Browse files
committed
Replace usage of growing BitSet with paged BitSet
1 parent daa4135 commit 8b5aa30

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

core/src/main/java/org/neo4j/gds/core/loading/MultiLabelInformation.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.neo4j.gds.NodeLabel;
2626
import org.neo4j.gds.api.BatchNodeIterable;
2727
import org.neo4j.gds.api.IdMap;
28-
import org.neo4j.gds.core.utils.paged.HugeAtomicGrowingBitSet;
28+
import org.neo4j.gds.core.utils.paged.HugeAtomicPagedBitSet;
2929

3030
import java.util.ArrayList;
3131
import java.util.Collection;
@@ -155,12 +155,12 @@ public PrimitiveIterator.OfLong nodeIterator(Collection<NodeLabel> labels, long
155155

156156
public static final class Builder implements LabelInformation.Builder {
157157
private final long expectedCapacity;
158-
private final Map<NodeLabel, HugeAtomicGrowingBitSet> labelInformation;
158+
private final Map<NodeLabel, HugeAtomicPagedBitSet> labelInformation;
159159
private final List<NodeLabel> starNodeLabelMappings;
160160

161161
private Builder(
162162
long expectedCapacity,
163-
Map<NodeLabel, HugeAtomicGrowingBitSet> labelInformation,
163+
Map<NodeLabel, HugeAtomicPagedBitSet> labelInformation,
164164
List<NodeLabel> starNodeLabelMappings
165165
) {
166166
this.expectedCapacity = expectedCapacity;
@@ -180,7 +180,7 @@ static Builder of(
180180

181181
var nodeLabelBitSetMap = prepareLabelMap(
182182
labelTokenNodeLabelMapping,
183-
() -> HugeAtomicGrowingBitSet.create(expectedCapacity)
183+
() -> HugeAtomicPagedBitSet.create(expectedCapacity)
184184
);
185185

186186
return new Builder(expectedCapacity, nodeLabelBitSetMap, starNodeLabelMappings);
@@ -207,7 +207,7 @@ public void addNodeIdToLabel(NodeLabel nodeLabel, long nodeId) {
207207
labelInformation
208208
.computeIfAbsent(
209209
nodeLabel,
210-
(ignored) -> HugeAtomicGrowingBitSet.create(expectedCapacity)
210+
(ignored) -> HugeAtomicPagedBitSet.create(expectedCapacity)
211211
).set(nodeId);
212212
}
213213

core/src/main/java/org/neo4j/gds/core/loading/construction/NodesBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.neo4j.gds.core.loading.nodeproperties.NodePropertiesFromStoreBuilder;
3838
import org.neo4j.gds.core.utils.RawValues;
3939
import org.neo4j.gds.core.utils.paged.HugeAtomicBitSet;
40-
import org.neo4j.gds.core.utils.paged.HugeAtomicGrowingBitSet;
40+
import org.neo4j.gds.core.utils.paged.HugeAtomicPagedBitSet;
4141
import org.neo4j.gds.utils.AutoCloseableThreadLocal;
4242
import org.neo4j.values.storable.Value;
4343

@@ -142,7 +142,7 @@ private static LongPredicate seenNodesPredicate(
142142
) {
143143
if (deduplicateIds) {
144144
if (maxOriginalId == UNKNOWN_MAX_ID) {
145-
var seenIds = HugeAtomicGrowingBitSet.create(0);
145+
var seenIds = HugeAtomicPagedBitSet.create(0);
146146
return seenIds::getAndSet;
147147
} else {
148148
var seenIds = HugeAtomicBitSet.create(maxOriginalId + 1);

core/src/test/java/org/neo4j/gds/core/utils/paged/HugeAtomicBitSetTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public void clear(long index) {
320320
};
321321
},
322322
(size) -> {
323-
var habs = HugeAtomicGrowingBitSet.create(size);
323+
var habs = HugeAtomicPagedBitSet.create(size);
324324
return new CommonHabsOps() {
325325
@Override
326326
public boolean get(long index) {

0 commit comments

Comments
 (0)