Package io.ray.api.id

Class BaseId

java.lang.Object
io.ray.api.id.BaseId
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActorId, JobId, ObjectId, PlacementGroupId, TaskId, UniqueId

public abstract class BaseId extends Object implements Serializable
See Also:
Serialized Form
  • Constructor Details

    • BaseId

      protected BaseId(byte[] id)
      Create a BaseId instance according to the input byte array.
  • Method Details

    • getBytes

      public byte[] getBytes()
      Get the byte data of this id.
    • toByteBuffer

      public ByteBuffer toByteBuffer()
      Convert the byte data to a ByteBuffer.
    • isNil

      public boolean isNil()
      Returns true if this id is nil.
    • size

      public abstract int size()
      Derived class should implement this function.
      Returns:
      The length of this id in bytes.
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hexString2Bytes

      protected static byte[] hexString2Bytes(String hex)
    • byteBuffer2Bytes

      protected static byte[] byteBuffer2Bytes(ByteBuffer bb)