Interface IdMapper<K>

Type Parameters:
K - External identifier type (UUID, String, Long, byte[])
All Known Implementing Classes:
BytesIdMapper, LongIdMapper, StringIdMapper, UuidIdMapper

public interface IdMapper<K>
Bi-directional mapping interface between external domain identifiers (UUID, String, Long, byte[]) and internal dense 64-bit/32-bit node IDs.
  • 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(K key)
    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(K key, 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.
  • Method Details

    • getDomainType

      String getDomainType()
      Obtains the entity/domain name associated with this mapper.
    • getOrAssignId

      long getOrAssignId(K key)
      Resolves an external key to a dense 64-bit node ID, assigning a new ID if absent.
    • registerMapping

      void registerMapping(K key, long denseId)
      Registers a known external key to dense ID mapping (e.g. loaded from binary Section 4 or database).
    • getExternalKey

      K getExternalKey(long denseId)
      Resolves a local dense node ID back to its external key.
    • getId

      Long getId(K key)
      Looks up the dense node ID for a given external key without assigning a new one. Returns null if absent.
    • size

      int size()
      Returns the total count of mapped IDs.
    • clear

      void clear()
      Clears all in-memory mappings.