public static FilesystemStatisticsAggregator computeFilesystemStatisticsForHost(Map<String, FilesystemStatisticsAggregator> filesystemStatistics) { FilesystemStatisticsAggregator result = new FilesystemStatisticsAggregator(); for (Map.Entry<String, FilesystemStatisticsAggregator> entry : filesystemStatistics.entrySet()) { result.add(entry.getValue()); } return result; }
public static FilesystemStatisticsAggregator computeFilesystemStatisticsForRing(Map<Host, Map<String, FilesystemStatisticsAggregator>> filesystemStatistics) { FilesystemStatisticsAggregator result = new FilesystemStatisticsAggregator(); Set<String> hostAndFilesystemRootsAdded = new HashSet<String>(); for (Map.Entry<Host, Map<String, FilesystemStatisticsAggregator>> entry1 : filesystemStatistics.entrySet()) { for (Map.Entry<String, FilesystemStatisticsAggregator> entry2 : entry1.getValue().entrySet()) { String hostAndFilesystemRoot = entry1.getKey().getAddress().getHostName() + entry2.getKey(); if (!hostAndFilesystemRootsAdded.contains(hostAndFilesystemRoot)) { hostAndFilesystemRootsAdded.add(hostAndFilesystemRoot); result.add(entry2.getValue()); } } } return result; }
public static FilesystemStatisticsAggregator computeFilesystemStatisticsForRingGroup( Map<Ring, Map<Host, Map<String, FilesystemStatisticsAggregator>>> filesystemStatistics) { FilesystemStatisticsAggregator result = new FilesystemStatisticsAggregator(); for (Map.Entry<Ring, Map<Host, Map<String, FilesystemStatisticsAggregator>>> entry1 : filesystemStatistics.entrySet()) { for (Map.Entry<Host, Map<String, FilesystemStatisticsAggregator>> entry2 : entry1.getValue().entrySet()) { Set<String> hostAndFilesystemRootsAdded = new HashSet<String>(); for (Map.Entry<String, FilesystemStatisticsAggregator> entry3 : entry2.getValue().entrySet()) { String hostAndFilesystemRoot = entry2.getKey().getAddress().getHostName() + entry3.getKey(); if (!hostAndFilesystemRootsAdded.contains(hostAndFilesystemRoot)) { hostAndFilesystemRootsAdded.add(hostAndFilesystemRoot); result.add(entry3.getValue()); } } } } return result; }