Class HugeIdMap

  • All Implemented Interfaces:
    BatchNodeIterable, IdMap, NodeIterator, PartialIdMap

    public class HugeIdMap
    extends java.lang.Object
    implements IdMap
    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
    • Constructor Detail

      • HugeIdMap

        public HugeIdMap​(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 nodeId)
        Description copied from interface: PartialIdMap
        Map original nodeId to inner nodeId
        Specified by:
        toMappedNodeId in interface PartialIdMap
        Parameters:
        nodeId - must be smaller or equal to the id returned by IdMap.highestNeoId()
      • toOriginalNodeId

        public long toOriginalNodeId​(long nodeId)
        Description copied from interface: IdMap
        Map inner nodeId back to original nodeId
        Specified by:
        toOriginalNodeId in interface IdMap
      • toRootNodeId

        public long toRootNodeId​(long nodeId)
        Description copied from interface: IdMap
        Maps an internal id to its root internal node id. This is necessary for nested (filtered) id mappings. If this mapping is a nested mapping, this method returns the root node id of the parent mapping. For the root mapping this method returns the given node id.
        Specified by:
        toRootNodeId in interface IdMap
      • rootIdMap

        public IdMap rootIdMap()
        Description copied from interface: IdMap
        Returns the original node mapping if the current node mapping is filtered, otherwise it returns itself.
        Specified by:
        rootIdMap in interface IdMap
      • contains

        public boolean contains​(long nodeId)
        Description copied from interface: IdMap
        Returns true iff the nodeId is mapped, otherwise false.
        Specified by:
        contains in interface IdMap
      • nodeCount

        public long nodeCount()
        Description copied from interface: IdMap
        Number of mapped nodeIds.
        Specified by:
        nodeCount in interface IdMap
      • rootNodeCount

        public java.util.OptionalLong rootNodeCount()
        Description copied from interface: PartialIdMap
        Number of mapped node ids in the root mapping. This is necessary for nested (filtered) id mappings.
        Specified by:
        rootNodeCount in interface PartialIdMap
      • highestNeoId

        public long highestNeoId()
        Specified by:
        highestNeoId in interface IdMap
      • forEachNode

        public void forEachNode​(java.util.function.LongPredicate consumer)
        Description copied from interface: NodeIterator
        Iterate over each nodeId
        Specified by:
        forEachNode in interface NodeIterator
      • availableNodeLabels

        public java.util.Set<org.neo4j.gds.NodeLabel> availableNodeLabels()
        Specified by:
        availableNodeLabels in interface IdMap
      • nodeLabels

        public java.util.List<org.neo4j.gds.NodeLabel> nodeLabels​(long nodeId)
        Specified by:
        nodeLabels in interface IdMap
      • hasLabel

        public boolean hasLabel​(long nodeId,
                                org.neo4j.gds.NodeLabel label)
        Specified by:
        hasLabel in interface IdMap
      • withFilteredLabels

        public HugeIdMap withFilteredLabels​(java.util.Collection<org.neo4j.gds.NodeLabel> nodeLabels,
                                            int concurrency)
        Specified by:
        withFilteredLabels in interface IdMap