Skip to content
Snippets Groups Projects
Commit 2860ae73 authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Remove SupressWarring by add correct Type uc2 hzj

parent 06d2816d
No related branches found
No related tags found
1 merge request!208Add benchmark implementations for Hazelcast Jet
Pipeline #6981 passed
......@@ -108,19 +108,16 @@ public class Uc2PipelineBuilder {
* @return An AggregateOperation used by Hazelcast Jet in a streaming stage which aggregates
* ActivePowerRecord Objects into Stats Objects.
*/
@SuppressWarnings("unchecked")
public AggregateOperation1<Object, StatsAccumulator, Stats> uc2AggregateOperation() {
public AggregateOperation1<Entry<String, ActivePowerRecord>,
StatsAccumulator, Stats> uc2AggregateOperation() {
// Aggregate Operation to Create a Stats Object from Entry<String,ActivePowerRecord> items using
// the Statsaccumulator.
return AggregateOperation
// Creates the accumulator
.withCreate(new StatsAccumulatorSupplier())
// Defines the accumulation
.andAccumulate((accumulator, item) -> {
final Entry<String, ActivePowerRecord> castedEntry =
(Entry<String, ActivePowerRecord>) item;
accumulator.add(castedEntry.getValue().getValueInW());
.<Entry<String, ActivePowerRecord>>andAccumulate((accumulator, item) -> {
accumulator.add(item.getValue().getValueInW());
})
// Defines the combination of spread out instances
.andCombine((left, right) -> {
......@@ -129,9 +126,10 @@ public class Uc2PipelineBuilder {
})
// Finishes the aggregation
.andExportFinish((accumulator) -> {
return accumulator.snapshot();
});
.andExportFinish(
(accumulator) -> {
return accumulator.snapshot();
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment