Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ compile 'org.gephi:graphstore:0.8.0'

## Dependencies

GraphStore is built for JRE 17+ and depends on FastUtil and Colt.
GraphStore is built for JRE 17+ and depends on FastUtil.

For a complete list of dependencies, consult the `pom.xml` file.

Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@
<artifactId>fastutil</artifactId>
<version>8.5.16</version>
</dependency>
<dependency>
<groupId>colt</groupId>
<artifactId>colt</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>

<build>
Expand Down
21 changes: 6 additions & 15 deletions src/main/java/org/gephi/graph/impl/ColumnObserverImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/
package org.gephi.graph.impl;

import cern.colt.bitvector.BitVector;
import cern.colt.bitvector.QuickBitVector;
import java.util.BitSet;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectList;
import it.unimi.dsi.fastutil.objects.ObjectLists;
Expand All @@ -40,7 +39,7 @@ public class ColumnObserverImpl implements ColumnObserver {
protected boolean destroyed;
// Config
protected final boolean withDiff;
protected BitVector bitVector;
protected BitSet bitVector;
// Cache
protected ColumnDiffImpl columnDiff;

Expand Down Expand Up @@ -109,7 +108,7 @@ private void refreshDiff() {
boolean node = AttributeUtils.isNodeColumn(column);
columnDiff = node ? new NodeColumnDiffImpl() : new EdgeColumnDiffImpl();

int size = bitVector.size();
int size = bitVector.length();

for (int i = 0; i < size; i++) {
boolean t = bitVector.get(i);
Expand Down Expand Up @@ -179,19 +178,11 @@ public EdgeIterable getTouchedElements() {
private void ensureVectorSize(ElementImpl element) {
int sid = element.getStoreId();
if (bitVector == null) {
bitVector = new BitVector(sid + 1);
} else if (sid >= bitVector.size()) {
int newSize = Math.min(Math
int initialSize = Math.min(Math
.max(sid + 1, (int) (sid * GraphStoreConfiguration.COLUMNDIFF_GROWING_FACTOR)), Integer.MAX_VALUE);
bitVector = growBitVector(bitVector, newSize);
bitVector = new BitSet(initialSize);
}
}

private BitVector growBitVector(BitVector bitVector, int size) {
long[] elements = bitVector.elements();
long[] newElements = QuickBitVector.makeBitVector(size, 1);
System.arraycopy(elements, 0, newElements, 0, elements.length);
return new BitVector(newElements, size);
// BitSet grows automatically when setting bits, no need to manually grow
}

private void readLock() {
Expand Down
Loading