Class TaskId

  • All Implemented Interfaces:
    java.lang.Comparable<TaskId>

    public class TaskId
    extends java.lang.Object
    implements java.lang.Comparable<TaskId>
    The task ID representation composed as topic group ID plus the assigned partition ID.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int partition
      The ID of the partition.
      int topicGroupId
      The ID of the topic group.
    • Constructor Summary

      Constructors 
      Constructor Description
      TaskId​(int topicGroupId, int partition)  
    • Field Detail

      • topicGroupId

        public final int topicGroupId
        The ID of the topic group.
      • partition

        public final int partition
        The ID of the partition.
    • Constructor Detail

      • TaskId

        public TaskId​(int topicGroupId,
                      int partition)
    • Method Detail

      • toString

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

        public void writeTo​(java.io.DataOutputStream out)
                     throws java.io.IOException
        Throws:
        java.io.IOException - if cannot write to output stream
      • readFrom

        public static TaskId readFrom​(java.io.DataInputStream in)
                               throws java.io.IOException
        Throws:
        java.io.IOException - if cannot read from input stream
      • writeTo

        public void writeTo​(java.nio.ByteBuffer buf)
      • readFrom

        public static TaskId readFrom​(java.nio.ByteBuffer buf)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public int compareTo​(TaskId other)
        Specified by:
        compareTo in interface java.lang.Comparable<TaskId>