Skip to content

Commit

Permalink
Remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaderberg committed Sep 25, 2024
1 parent cacf359 commit ddfb0ba
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 186 deletions.
41 changes: 0 additions & 41 deletions core/src/main/java/org/neo4j/gds/api/ValueTypes.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@
import org.neo4j.gds.api.PropertyState;
import org.neo4j.gds.api.RelationshipProperty;
import org.neo4j.gds.api.RelationshipPropertyStore;
import org.neo4j.gds.api.ValueTypes;
import org.neo4j.gds.api.nodeproperties.ValueType;
import org.neo4j.gds.api.schema.Direction;
import org.neo4j.gds.api.schema.MutableRelationshipSchema;
import org.neo4j.gds.api.schema.MutableRelationshipSchemaEntry;
import org.neo4j.values.storable.NumberType;

import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -157,7 +155,7 @@ private static RelationshipPropertyStore constructRelationshipPropertyStore(
),
propertyMapping.defaultValue().isUserDefined()
? propertyMapping.defaultValue()
: ValueTypes.fromNumberType(NumberType.FLOATING_POINT).fallbackValue(),
: ValueType.DOUBLE.fallbackValue(),
propertyMapping.aggregation()
)
);
Expand Down
140 changes: 0 additions & 140 deletions core/src/main/java/org/neo4j/gds/core/loading/ValueConverter.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
import org.neo4j.gds.collections.hsa.HugeSparseCollections;
import org.neo4j.gds.core.concurrency.Concurrency;
import org.neo4j.gds.core.loading.HighLimitIdMap;
import org.neo4j.gds.core.loading.ValueConverter;
import org.neo4j.gds.mem.MemoryEstimation;
import org.neo4j.gds.mem.MemoryEstimations;
import org.neo4j.gds.values.GdsNoValue;
import org.neo4j.gds.values.GdsValue;
import org.neo4j.values.storable.DoubleArray;
import org.neo4j.values.storable.FloatArray;
import org.neo4j.values.storable.FloatingPointValue;
import org.neo4j.values.storable.IntegralValue;
import org.neo4j.values.storable.LongArray;
import org.neo4j.values.storable.Value;
import org.neo4j.values.storable.Values;

Expand Down Expand Up @@ -115,7 +119,7 @@ public NodePropertyValues build(IdMap idMap) {
// This is synchronized as we want to prevent the creation of multiple InnerNodePropertiesBuilders of which only once survives.
private synchronized void initializeWithType(Value value) {
if (innerBuilder.get() == null) {
var valueType = ValueConverter.valueType(value);
var valueType = valueType(value);
var newBuilder = newInnerBuilder(valueType);
innerBuilder.compareAndSet(null, newBuilder);
}
Expand Down Expand Up @@ -148,4 +152,23 @@ private InnerNodePropertiesBuilder newInnerBuilder(ValueType valueType) {
));
}
}

private ValueType valueType(Value value) {
if (value instanceof IntegralValue) {
return ValueType.LONG;
} else if (value instanceof FloatingPointValue) {
return ValueType.DOUBLE;
} else if (value instanceof LongArray) {
return ValueType.LONG_ARRAY;
} else if (value instanceof DoubleArray) {
return ValueType.DOUBLE_ARRAY;
} else if (value instanceof FloatArray) {
return ValueType.FLOAT_ARRAY;
} else {
throw new UnsupportedOperationException(formatWithLocale(
"Loading of values of type %s is currently not supported",
value.getTypeName()
));
}
}
}

0 comments on commit ddfb0ba

Please sign in to comment.