use of org.apache.beam.sdk.nexmark.model.SellerPrice in project beam by apache.
the class Query6Model method relevantResults.
@Override
protected Iterable<TimestampedValue<SellerPrice>> relevantResults(Iterable<TimestampedValue<SellerPrice>> results) {
// Find the last (in processing time) reported average price for each seller.
Map<Long, TimestampedValue<SellerPrice>> finalAverages = new TreeMap<>();
for (TimestampedValue<SellerPrice> obj : results) {
Assert.assertTrue("have SellerPrice", obj.getValue() instanceof SellerPrice);
SellerPrice sellerPrice = (SellerPrice) obj.getValue();
finalAverages.put(sellerPrice.seller, TimestampedValue.of(sellerPrice, obj.getTimestamp()));
}
return finalAverages.values();
}
Aggregations