Class UuidIdMapper

java.lang.Object
org.impulsegraph.api.UuidIdMapper
All Implemented Interfaces:
IdMapper<UUID>

public class UuidIdMapper extends Object implements IdMapper<UUID>
High-performance thread-safe IdMapper for 128-bit UUID external keys.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UuidIdMapper(String domainType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all in-memory mappings.
    Obtains the entity/domain name associated with this mapper.
    getExternalKey(long denseId)
    Resolves a local dense node ID back to its external key.
    getId(UUID uuid)
    Looks up the dense node ID for a given external key without assigning a new one.
    long
    Resolves an external key to a dense 64-bit node ID, assigning a new ID if absent.
    void
    registerMapping(UUID uuid, long denseId)
    Registers a known external key to dense ID mapping (e.g. loaded from binary Section 4 or database).
    int
    Returns the total count of mapped IDs.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UuidIdMapper

      public UuidIdMapper(String domainType)
  • Method Details

    • getDomainType

      public String getDomainType()
      Description copied from interface: IdMapper
      Obtains the entity/domain name associated with this mapper.
      Specified by:
      getDomainType in interface IdMapper<UUID>
    • getOrAssignId

      public long getOrAssignId(UUID uuid)
      Description copied from interface: IdMapper
      Resolves an external key to a dense 64-bit node ID, assigning a new ID if absent.
      Specified by:
      getOrAssignId in interface IdMapper<UUID>
    • registerMapping

      public void registerMapping(UUID uuid, long denseId)
      Description copied from interface: IdMapper
      Registers a known external key to dense ID mapping (e.g. loaded from binary Section 4 or database).
      Specified by:
      registerMapping in interface IdMapper<UUID>
    • getExternalKey

      public UUID getExternalKey(long denseId)
      Description copied from interface: IdMapper
      Resolves a local dense node ID back to its external key.
      Specified by:
      getExternalKey in interface IdMapper<UUID>
    • getId

      public Long getId(UUID uuid)
      Description copied from interface: IdMapper
      Looks up the dense node ID for a given external key without assigning a new one. Returns null if absent.
      Specified by:
      getId in interface IdMapper<UUID>
    • size

      public int size()
      Description copied from interface: IdMapper
      Returns the total count of mapped IDs.
      Specified by:
      size in interface IdMapper<UUID>
    • clear

      public void clear()
      Description copied from interface: IdMapper
      Clears all in-memory mappings.
      Specified by:
      clear in interface IdMapper<UUID>