Skip to content

Commit

Permalink
MINOR: Prevent java.lang.UnsupportedOperationException in MockAdminCl…
Browse files Browse the repository at this point in the history
…ient (apache#14955)

Reviewers: Divij Vaidya <[email protected]>, Sagar Rao <[email protected]>
  • Loading branch information
jamespfaulkner authored Jan 4, 2024
1 parent c703ce2 commit 29108b6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,13 @@ synchronized public DescribeLogDirsResult describeLogDirs(Collection<Integer> br
for (Node node : nodes) {
Map<String, LogDirDescription> logDirDescriptionMap = unwrappedResults.get(node.id());
LogDirDescription logDirDescription = logDirDescriptionMap.getOrDefault(partitionLogDirs.get(0), new LogDirDescription(null, new HashMap<>()));
logDirDescription.replicaInfos().put(new TopicPartition(topicName, topicPartitionInfo.partition()), new ReplicaInfo(0, 0, false));
Map<TopicPartition, ReplicaInfo> topicPartitionReplicaInfoMap = new HashMap<>(logDirDescription.replicaInfos());
topicPartitionReplicaInfoMap.put(new TopicPartition(topicName, topicPartitionInfo.partition()), new ReplicaInfo(0, 0, false));
logDirDescriptionMap.put(partitionLogDirs.get(0), new LogDirDescription(
logDirDescription.error(),
topicPartitionReplicaInfoMap,
logDirDescription.totalBytes().orElse(DescribeLogDirsResponse.UNKNOWN_VOLUME_BYTES),
logDirDescription.usableBytes().orElse(DescribeLogDirsResponse.UNKNOWN_VOLUME_BYTES)));
}
}
}
Expand Down

0 comments on commit 29108b6

Please sign in to comment.