val map1 = map0.foldLeft(TreeMap[String,List[ResourceEntry]]()){ case (map,(_,r1)) =>
map.get(r1.resourceType) match {
case None => map + ((r1.resourceType,List(r1)))
- case Some(rl) => (map - r1.resourceType) + ((r1.resourceName,r1::rl))
+ case Some(rl) => (map - r1.resourceType) + ((r1.resourceType,r1::rl))
}
}
map1.foldLeft(List[ServiceEntry]()){ case (ret,(serviceName,resList)) =>
//Console.err.println("After rounding timeslot: " + t)
val ret = w match {
case None =>
+ val allMissing = addMissingServices(Nil,resourceTypes)
new BillEntry(counter.getAndIncrement.toString,
userID,"processing",
"0.0",
"0.0",
t.from.getTime.toString,t.to.getTime.toString,
- Nil)
+ allMissing)
case Some(w) =>
val wjson = AvroHelpers.jsonStringOfSpecificRecord(w)
Console.err.println("Working user state: %s".format(wjson))