/** * Returns the a stringified version of the user-defined accumulators. * @return an Array containing the StringifiedAccumulatorResult objects */ @Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
/** * Returns the a stringified version of the user-defined accumulators. * @return an Array containing the StringifiedAccumulatorResult objects */ @Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, Accumulator<?, ?>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
/** * Gets a serialized accumulator map. * @return The accumulator map with serialized accumulator values. */ @Override public Map<String, SerializedValue<OptionalFailure<Object>>> getAccumulatorsSerialized() { return aggregateUserAccumulators() .entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, entry -> serializeAccumulator(entry.getKey(), entry.getValue()))); }
/** * Gets the accumulator results. */ public Map<String, Object> getAccumulators() throws IOException { Map<String, Accumulator<?, ?>> accumulatorMap = aggregateUserAccumulators(); Map<String, Object> result = new HashMap<>(); for (Map.Entry<String, Accumulator<?, ?>> entry : accumulatorMap.entrySet()) { result.put(entry.getKey(), entry.getValue().getLocalValue()); } return result; }
/** * Returns the a stringified version of the user-defined accumulators. * @return an Array containing the StringifiedAccumulatorResult objects */ @Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
/** * Returns the a stringified version of the user-defined accumulators. * @return an Array containing the StringifiedAccumulatorResult objects */ @Override public StringifiedAccumulatorResult[] getAccumulatorResultsStringified() { Map<String, OptionalFailure<Accumulator<?, ?>>> accumulatorMap = aggregateUserAccumulators(); return StringifiedAccumulatorResult.stringifyAccumulatorResults(accumulatorMap); }
/** * Gets a serialized accumulator map. * @return The accumulator map with serialized accumulator values. */ @Override public Map<String, SerializedValue<OptionalFailure<Object>>> getAccumulatorsSerialized() { return aggregateUserAccumulators() .entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, entry -> serializeAccumulator(entry.getKey(), entry.getValue()))); }
/** * Gets a serialized accumulator map. * @return The accumulator map with serialized accumulator values. */ @Override public Map<String, SerializedValue<OptionalFailure<Object>>> getAccumulatorsSerialized() { return aggregateUserAccumulators() .entrySet() .stream() .collect(Collectors.toMap( Map.Entry::getKey, entry -> serializeAccumulator(entry.getKey(), entry.getValue()))); }
/** * Gets a serialized accumulator map. * @return The accumulator map with serialized accumulator values. * @throws IOException */ @Override public Map<String, SerializedValue<Object>> getAccumulatorsSerialized() throws IOException { Map<String, Accumulator<?, ?>> accumulatorMap = aggregateUserAccumulators(); Map<String, SerializedValue<Object>> result = new HashMap<>(); for (Map.Entry<String, Accumulator<?, ?>> entry : accumulatorMap.entrySet()) { result.put(entry.getKey(), new SerializedValue<Object>(entry.getValue().getLocalValue())); } return result; }