Package org.neo4j.gds.core.loading
Class ArrayIdMap
- java.lang.Object
-
- org.neo4j.gds.api.LabeledIdMap
-
- org.neo4j.gds.core.loading.ArrayIdMap
-
- All Implemented Interfaces:
BatchNodeIterable,IdMap,NodeIterator,PartialIdMap
public class ArrayIdMap extends LabeledIdMap
This is basically a long to int mapper. It sorts the id's in ascending order so its guaranteed that there is no ID greater then nextGraphId / capacity
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.BatchNodeIterable
BatchNodeIterable.BitSetIdIterator, BatchNodeIterable.IdIterable, BatchNodeIterable.IdIterator
-
Nested classes/interfaces inherited from interface org.neo4j.gds.api.IdMap
IdMap.NodeLabelConsumer
-
-
Field Summary
-
Fields inherited from class org.neo4j.gds.api.LabeledIdMap
labelInformation
-
Fields inherited from interface org.neo4j.gds.api.IdMap
NOT_FOUND, START_NODE_ID
-
-
Constructor Summary
Constructors Constructor Description ArrayIdMap(HugeLongArray graphIds, org.neo4j.gds.collections.HugeSparseLongArray nodeToGraphIds, LabelInformation labelInformation, long nodeCount, long highestNeoId)initialize the map with pre-built sub arrays
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(long originalNodeId)Returns true iff the neo4jNodeId is mapped, otherwise false.longhighestNeoId()static org.neo4j.gds.core.utils.mem.MemoryEstimationmemoryEstimation()IdMaprootIdMap()Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.java.util.OptionalLongrootNodeCount()Number of mapped node ids in the root mapping.longtoMappedNodeId(long originalNodeId)Maps an original node id to a mapped node id.longtoOriginalNodeId(long mappedNodeId)Map mapped nodeId back to neo4j nodeIdlongtoRootNodeId(long mappedNodeId)Maps a filtered mapped node id to its root mapped node id.java.util.Optional<org.neo4j.gds.core.loading.ArrayIdMap.FilteredArrayIdMap>withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)-
Methods inherited from class org.neo4j.gds.api.LabeledIdMap
availableNodeLabels, batchIterables, forEachNode, forEachNodeLabel, hasLabel, nodeCount, nodeIterator, nodeIterator, nodeLabels
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.neo4j.gds.api.IdMap
safeToMappedNodeId
-
-
-
-
Constructor Detail
-
ArrayIdMap
public ArrayIdMap(HugeLongArray graphIds, org.neo4j.gds.collections.HugeSparseLongArray nodeToGraphIds, LabelInformation labelInformation, long nodeCount, long highestNeoId)
initialize the map with pre-built sub arrays
-
-
Method Detail
-
memoryEstimation
public static org.neo4j.gds.core.utils.mem.MemoryEstimation memoryEstimation()
-
toMappedNodeId
public long toMappedNodeId(long originalNodeId)
Description copied from interface:PartialIdMapMaps an original node id to a mapped node id. In case of nested id maps, the mapped node id is always in the space of the innermost mapping.- Parameters:
originalNodeId- must be smaller or equal to the id returned byIdMap.highestNeoId()
-
toOriginalNodeId
public long toOriginalNodeId(long mappedNodeId)
Description copied from interface:IdMapMap mapped nodeId back to neo4j nodeId
-
toRootNodeId
public long toRootNodeId(long mappedNodeId)
Description copied from interface:IdMapMaps a filtered mapped node id to its root mapped node id. This is necessary for nested (filtered) id mappings. If this mapping is a nested mapping, this method returns the root mapped node id of the parent mapping. For the root mapping this method returns the given node id.
-
rootIdMap
public IdMap rootIdMap()
Description copied from interface:IdMapReturns the original node mapping if the current node mapping is filtered, otherwise it returns itself.
-
contains
public boolean contains(long originalNodeId)
Description copied from interface:IdMapReturns true iff the neo4jNodeId is mapped, otherwise false.
-
rootNodeCount
public java.util.OptionalLong rootNodeCount()
Description copied from interface:PartialIdMapNumber of mapped node ids in the root mapping. This is necessary for nested (filtered) id mappings.
-
highestNeoId
public long highestNeoId()
-
withFilteredLabels
public java.util.Optional<org.neo4j.gds.core.loading.ArrayIdMap.FilteredArrayIdMap> withFilteredLabels(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels, int concurrency)
-
-