Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overall, topic IDs provide a safer way for brokers to replicate topics without any chance of incorrectly interacting with stale topics with the same name. By preventing such scenarios, we can simplify a number of other interactions such as topic deletes which are currently more complicated and problematic than necessary.

Public Interfaces

TopicDescription

Minor changes to the TopicDescription interface will be made to allow clients to access the topic ID of topics found in metadata responses.

...

/**
* A unique identifier for the topic.
*/
public UUID topicId()

UUID

A new UUID class will be exposed under /org/apache/kafka/clients/admin/

/*
 * This class defines an immutable universally unique identifier (UUID). It represents a 128-bit value.
 * More specifically, the random UUIDs in this class are variant 2 (Leach-Salz) version 4 UUIDs.
 * This definition is very similar to java.util.UUID. One notable difference is that the toString() method prints
 * using the base64 string encoding.
 */
public class UUID {
  /**
   * A UUID where all bits are zero. It represents a null or empty UUID.
   */
  public static final UUID ZERO_UUID

  /**
   * Returns the most significant bits of the UUID's 128 bit value.
   */
  public long getMostSignificantBits()

  /**
   * Returns the least significant bits of the UUID's 128 bit value.
   */
  public long getLeastSignificantBits()

  /**
   * Returns true iff obj is another UUID with the same value.
   */
  public boolean equals(Object obj)

  /**
   * Returns a base64 string encoding of the UUID.
   */
  public String toString()   
}

Additionally, it may be dangerous to use older versions of Kafka tools with new broker versions when using their --zookeeper flags. Use of older tools in this way is not supported today.

...