Versions Compared

Key

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

...

Code Block
class RackAwareReplicaSelector implements ReplicaSelector {


  Node select(String rackId, PartitionInfo partitionInfo) {
    // if rackId is not null, iterate through the online replicas 
    // if one or more exists, choose a replica randomly from them
    // otherwise return the current leader
  }
}


Protocol Changes

We will extend the Metadata API in order to enable selection of the preferred replica. We use of the "rack.id" configuration to identify the location of the broker, so we will add a similar configuration to the consumer. 

...