Skip to content

Commit

Permalink
[FLINK-4829] protect user accumulators against concurrent updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mxm committed Oct 18, 2016
1 parent f46ca39 commit 783dca5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


/**
Expand All @@ -44,7 +45,8 @@ public class AccumulatorRegistry {
new HashMap<Metric, Accumulator<?, ?>>();

/* User-defined Accumulator values stored for the executing task. */
private final Map<String, Accumulator<?, ?>> userAccumulators = new HashMap<>();
private final Map<String, Accumulator<?, ?>> userAccumulators =
new ConcurrentHashMap<>(4);

/* The reporter reference that is handed to the reporting tasks. */
private final ReadWriteReporter reporter;
Expand Down

0 comments on commit 783dca5

Please sign in to comment.