JiayaoS commented on code in PR #22345:
URL: https://github.com/apache/kafka/pull/22345#discussion_r4649033101
##########
storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:
##########
@@ -449,17 +449,19 @@ public RemoteStorageManager storageManager() {
return remoteStorageManagerPlugin.get();
}
- private Stream<TopicPartitionLog> filterPartitions(Set<TopicPartitionLog>
partitions) {
+ private Map<TopicIdPartition, Boolean>
buildRemoteLogPartitions(Set<TopicPartitionLog> partitions) {
// We are not specifically checking for internal topics etc here as
`log.remoteLogEnabled()` already handles that.
- return partitions.stream().filter(partition ->
partition.unifiedLog().isPresent() &&
partition.unifiedLog().get().remoteLogEnabled());
- }
-
- private void cacheTopicPartitionIds(TopicIdPartition topicIdPartition) {
- Uuid previousTopicId =
topicIdByPartitionMap.put(topicIdPartition.topicPartition(),
topicIdPartition.topicId());
- if (previousTopicId != null &&
!previousTopicId.equals(topicIdPartition.topicId())) {
- LOGGER.info("Previous cached topic id {} for {} does not match
updated topic id {}",
- previousTopicId, topicIdPartition.topicPartition(),
topicIdPartition.topicId());
+ Map<TopicIdPartition, Boolean> remoteLogPartitions = new HashMap<>();
+ for (TopicPartitionLog partition : partitions) {
+ Optional<UnifiedLog> unifiedLog = partition.unifiedLog();
Review Comment:
> We already have a `unifiedLog` here, so could we reuse the topic id inside
it?
Thanks,Modified.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]