I have this custom Aggregator written, which aggregation response is a HashMap. I have a problem on client side deserializer fails in the error given below. Any clue what could be wrong?
public class CountFixtureBySportAggregator extends Aggregator<HashMap.Entry<TraderVWFixtureKey, TraderVWFixture>, HashMap<Integer, Integer>> {
private static final long serialVersionUID = 1L;
private final HashMap<Integer, Set<String>> countBySportIdMap;
public CountFixtureBySportAggregator() {countBySportIdMap = new HashMap<>();}
@Override
public void accumulate(HashMap.Entry<TraderVWFixtureKey, TraderVWFixture> input) {
TraderVWFixture inputValue = input.getValue();
Integer sportId = inputValue.getSportId();
Set<String> matchIds = countBySportIdMap.getOrDefault(sportId, new HashSet<>());
if (inputValue.getOutrightId() == null) {
matchIds.add(inputValue.getMatchId());
} else {
matchIds.add(inputValue.getOutrightId());
}
countBySportIdMap.put(sportId, matchIds);
}
@Override
public void combine(Aggregator aggregator) {
CountFixtureBySportAggregator countFixtureBySportAggregator = (CountFixtureBySportAggregator) aggregator;
Map<Integer, Set<String>> sportCountMap = countFixtureBySportAggregator.getCountBySportIdMap();
for (Map.Entry<Integer, Set<String>> entry : sportCountMap.entrySet()) {
Integer key = entry.getKey();
countBySportIdMap.computeIfAbsent(key, integer -> new HashSet<>());
countBySportIdMap.get(key).addAll(entry.getValue());
}
}
@Override
public HashMap<Integer, Integer> aggregate() {
return new HashMap(countBySportIdMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue().size())));
}
public HashMap<Integer, Set<String>> getCountBySportIdMap() { return countBySportIdMap; }
}
Deserialization error on client:
com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable de-serializer for type -322. This exception is likely to be caused by differences in the serialization configuration between members or between clients and members.
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.newHazelcastSerializationException(AbstractSerializationService.java:238)
at com.hazelcast.internal.serialization.impl.AbstractSerializationService.toObject(AbstractSerializationService.java:182)
at com.hazelcast.client.spi.ClientProxy.toObject(ClientProxy.java:102)
at com.hazelcast.client.proxy.ClientMapProxy.aggregate(ClientMapProxy.java:1543)