@Override
    public int hashCode() {
        if (hash != 0) {
            return hash;
        }
        final int prime = 31;
        int result = 1;
        result = prime * result + topic.hashCode();
        result = prime * result + partition;
        result = prime * result + brokerId;
        this.hash = result;
        return result;
    }
The topic name, partition number and the brokerId of the replica
clients/src/main/java/org/apache/kafka/common/TopicPartitionReplica.java