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 { ...@@ -108,19 +108,16 @@ public class Uc2PipelineBuilder {
* @return An AggregateOperation used by Hazelcast Jet in a streaming stage which aggregates * @return An AggregateOperation used by Hazelcast Jet in a streaming stage which aggregates
* ActivePowerRecord Objects into Stats Objects. * ActivePowerRecord Objects into Stats Objects.
*/ */
@SuppressWarnings("unchecked") public AggregateOperation1<Entry<String, ActivePowerRecord>,
public AggregateOperation1<Object, StatsAccumulator, Stats> uc2AggregateOperation() { StatsAccumulator, Stats> uc2AggregateOperation() {
// Aggregate Operation to Create a Stats Object from Entry<String,ActivePowerRecord> items using // Aggregate Operation to Create a Stats Object from Entry<String,ActivePowerRecord> items using
// the Statsaccumulator. // the Statsaccumulator.
return AggregateOperation return AggregateOperation
// Creates the accumulator // Creates the accumulator
.withCreate(new StatsAccumulatorSupplier()) .withCreate(new StatsAccumulatorSupplier())
// Defines the accumulation // Defines the accumulation
.andAccumulate((accumulator, item) -> { .<Entry<String, ActivePowerRecord>>andAccumulate((accumulator, item) -> {
final Entry<String, ActivePowerRecord> castedEntry = accumulator.add(item.getValue().getValueInW());
(Entry<String, ActivePowerRecord>) item;
accumulator.add(castedEntry.getValue().getValueInW());
}) })
// Defines the combination of spread out instances // Defines the combination of spread out instances
.andCombine((left, right) -> { .andCombine((left, right) -> {
...@@ -129,9 +126,10 @@ public class Uc2PipelineBuilder { ...@@ -129,9 +126,10 @@ public class Uc2PipelineBuilder {
}) })
// Finishes the aggregation // Finishes the aggregation
.andExportFinish((accumulator) -> { .andExportFinish(
return accumulator.snapshot(); (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