Class BytesIdMapper

java.lang.Object
org.impulsegraph.api.BytesIdMapper
All Implemented Interfaces:
IdMapper<byte[]>

public class BytesIdMapper extends Object implements IdMapper<byte[]>
High-performance thread-safe IdMapper for binary byte array external keys.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BytesIdMapper(String domainType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all in-memory mappings.
    Obtains the entity/domain name associated with this mapper.
    byte[]
    getExternalKey(long denseId)
    Resolves a local dense node ID back to its external key.
    getId(byte[] key)
    Looks up the dense node ID for a given external key without assigning a new one.
    long
    getOrAssignId(byte[] key)
    Resolves an external key to a dense 64-bit node ID, assigning a new ID if absent.
    void
    registerMapping(byte[] 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.

    Methods inherited from class Object

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

    • BytesIdMapper

      public BytesIdMapper(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<byte[]>
    • getOrAssignId

      public long getOrAssignId(byte[] key)
      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<byte[]>
    • registerMapping

      public void registerMapping(byte[] key, 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<byte[]>
    • getExternalKey

      public byte[] 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<byte[]>
    • getId

      public Long getId(byte[] key)
      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<byte[]>
    • size

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

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