Class ComponentId


  • public class ComponentId
    extends java.lang.Object
    A ComponentId consists of two parts: a globally unique context (roughly - the domain where the ComponentId is valid) and an id within the context. Context is often a single coordinator but can be, for example, a distributed transaction coordinator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SIZE  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ComponentId alloc​(java.lang.String label, java.util.UUID coordinatorBase, int index)
      Given a base componentId, create a derived (different) one.
      static ComponentId allocLocal()
      Return a fresh ComponentId (not preserved across JVM runs)
      static ComponentId create​(java.util.UUID coordinatorBase, byte[] bytes)
      Create a ComponentId from the given bytes
      boolean equals​(java.lang.Object obj)  
      java.util.UUID getBaseId()  
      byte[] getBytes()  
      int hashCode()  
      java.lang.String label()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getBytes

        public byte[] getBytes()
      • getBaseId

        public java.util.UUID getBaseId()
      • label

        public java.lang.String label()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • create

        public static ComponentId create​(java.util.UUID coordinatorBase,
                                         byte[] bytes)
        Create a ComponentId from the given bytes
      • alloc

        public static ComponentId alloc​(java.lang.String label,
                                        java.util.UUID coordinatorBase,
                                        int index)
        Given a base componentId, create a derived (different) one. This is deterministically done based on baseComponentId and index. The label is just for display purposes.
      • allocLocal

        public static ComponentId allocLocal()
        Return a fresh ComponentId (not preserved across JVM runs)