MINOR: return unmodifiableMap for PartitionStates.partitionStateMap.
Makes the map returned by partitionStateMap unmodifiable to prevent mutation.
Reviewers: Ismael Juma
@@ -89,8 +89,8 @@ public class PartitionStates<S> {
return map.entrySet().stream().map(entry -> new PartitionState<>(entry.getKey(), entry.getValue()));
}
- public LinkedHashMap<TopicPartition, S> partitionStateMap() {
- return map;
+ public Map<TopicPartition, S> partitionStateMap() {
+ return Collections.unmodifiableMap(map);
}
/**
