flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request #5737: [FLINK-8721][flip6] Handle archiving failures for ...
Date Wed, 21 Mar 2018 19:39:02 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5737#discussion_r176207009
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/accumulators/StringifiedAccumulatorResult.java
---
    @@ -67,22 +72,29 @@ public String getValue() {
     
     			int i = 0;
     			for (Map.Entry<String, Accumulator<?, ?>> entry : accs.entrySet()) {
    -				StringifiedAccumulatorResult result;
    -				Accumulator<?, ?> accumulator = entry.getValue();
    -				if (accumulator != null) {
    -					Object localValue = accumulator.getLocalValue();
    -					if (localValue != null) {
    -						result = new StringifiedAccumulatorResult(entry.getKey(), accumulator.getClass().getSimpleName(),
localValue.toString());
    -					} else {
    -						result = new StringifiedAccumulatorResult(entry.getKey(), accumulator.getClass().getSimpleName(),
"null");
    -					}
    -				} else {
    -					result = new StringifiedAccumulatorResult(entry.getKey(), "null", "null");
    -				}
    -
    -				results[i++] = result;
    +				results[i++] = stringifyAccumulatorResult(entry.getKey(), entry.getValue());
     			}
     			return results;
     		}
     	}
    +
    +	private static StringifiedAccumulatorResult stringifyAccumulatorResult(String name,
Accumulator<?, ?> accumulator) {
    --- End diff --
    
    `@Nullable` missing for `accumulator`


---

Mime
View raw message