@Test public void shouldReturnNoUsageWhenThereIsNoRawData() { List<org.openstack.atlas.service.domain.pojos.HostUsageRecord> hostUsageRecords = HostUsageProcessor.processRawHostUsageData(new ArrayList<HostUsage>()); Assert.assertTrue(hostUsageRecords.isEmpty()); }
public static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage) { List<HostUsageRecord> hostUsageRecords = new ArrayList<HostUsageRecord>(); if (rawHostUsage == null) return hostUsageRecords; Map<Integer, Map<Calendar, List<HostUsage>>> dailyHostUsageMap = convertRawUsageToMap(rawHostUsage); for (Integer hostId : dailyHostUsageMap.keySet()) { HostUsageRecord hostUsageRecord = new HostUsageRecord(); hostUsageRecord.setHostId(hostId); hostUsageRecord.setHostUsages(processDailyHostUsageMap(dailyHostUsageMap.get(hostId))); hostUsageRecords.add(hostUsageRecord); } return hostUsageRecords; }
HostUsageProcessor { public static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage) { List<HostUsageRecord> hostUsageRecords = new ArrayList<HostUsageRecord>(); if (rawHostUsage == null) return hostUsageRecords; Map<Integer, Map<Calendar, List<HostUsage>>> dailyHostUsageMap = convertRawUsageToMap(rawHostUsage); for (Integer hostId : dailyHostUsageMap.keySet()) { HostUsageRecord hostUsageRecord = new HostUsageRecord(); hostUsageRecord.setHostId(hostId); hostUsageRecord.setHostUsages(processDailyHostUsageMap(dailyHostUsageMap.get(hostId))); hostUsageRecords.add(hostUsageRecord); } return hostUsageRecords; } }
HostUsageProcessor { public static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage) { List<HostUsageRecord> hostUsageRecords = new ArrayList<HostUsageRecord>(); if (rawHostUsage == null) return hostUsageRecords; Map<Integer, Map<Calendar, List<HostUsage>>> dailyHostUsageMap = convertRawUsageToMap(rawHostUsage); for (Integer hostId : dailyHostUsageMap.keySet()) { HostUsageRecord hostUsageRecord = new HostUsageRecord(); hostUsageRecord.setHostId(hostId); hostUsageRecord.setHostUsages(processDailyHostUsageMap(dailyHostUsageMap.get(hostId))); hostUsageRecords.add(hostUsageRecord); } return hostUsageRecords; }  }
HostUsageProcessor { public static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage) { List<HostUsageRecord> hostUsageRecords = new ArrayList<HostUsageRecord>(); if (rawHostUsage == null) return hostUsageRecords; Map<Integer, Map<Calendar, List<HostUsage>>> dailyHostUsageMap = convertRawUsageToMap(rawHostUsage); for (Integer hostId : dailyHostUsageMap.keySet()) { HostUsageRecord hostUsageRecord = new HostUsageRecord(); hostUsageRecord.setHostId(hostId); hostUsageRecord.setHostUsages(processDailyHostUsageMap(dailyHostUsageMap.get(hostId))); hostUsageRecords.add(hostUsageRecord); } return hostUsageRecords; }  static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage); }
HostUsageProcessor { public static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage) { List<HostUsageRecord> hostUsageRecords = new ArrayList<HostUsageRecord>(); if (rawHostUsage == null) return hostUsageRecords; Map<Integer, Map<Calendar, List<HostUsage>>> dailyHostUsageMap = convertRawUsageToMap(rawHostUsage); for (Integer hostId : dailyHostUsageMap.keySet()) { HostUsageRecord hostUsageRecord = new HostUsageRecord(); hostUsageRecord.setHostId(hostId); hostUsageRecord.setHostUsages(processDailyHostUsageMap(dailyHostUsageMap.get(hostId))); hostUsageRecords.add(hostUsageRecord); } return hostUsageRecords; }  static List<HostUsageRecord> processRawHostUsageData(List<HostUsage> rawHostUsage); static final long ZEUS_RESET_THRESHOLD_BYTES; }