Versions Compared

Key

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

...

The default of this method will result in no change to the current behavior for other user-defined partitioners. If a user wants to implement a sticky partitioner in their own partitioner class, this method can be overridden.

Attempting to call the partition method in the DefaultPartitioner will throw an error, as this method will be deprecated and no longer return a partition. computePartition has replaced its functionality. 

Code Block
languagejava
/**
 * Indicates calling a deprecated method. The method is no longer supported and does not perform the function
 * it once did. This is a fatal error as this method is not intended to be called and undesired behavior will result.
 */
public class UnsupportedMethodException extends ApiException


Proposed Changes

Change the behavior of the default partitioner in the no explicit partition, key = null case. Choose the “sticky” partition for the given topic. The “sticky” partition is changed when the record accumulator is allocating a new batch for a topic on a given partition.

If the DefaultPartitioner's partition method is called, it will no longer return the partition and instead throw an error.

A new partitioner will be created to allow sticky partitioning on all records, even those that have non-null keys. This will mirror how the RoundRobinPartitioner uses the round robin partitioning strategy for all records, including those with keys.

...