flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject flink git commit: [FLINK-3485][core] implement toString for SerializedListAccumulator
Date Fri, 26 Feb 2016 09:24:25 GMT
Repository: flink
Updated Branches:
  refs/heads/master 930a266db -> db6fda6a6


[FLINK-3485][core] implement toString for SerializedListAccumulator

The change improves the display of SerializedListAccumulators in the web
interface by displaying the number of elements contained in the
accumulator instead of the hash code of the object.

This closes #1717.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/db6fda6a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/db6fda6a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/db6fda6a

Branch: refs/heads/master
Commit: db6fda6a655a7e019cbfca0f917338843a72e3ff
Parents: 930a266
Author: Maximilian Michels <mxm@apache.org>
Authored: Thu Feb 25 10:20:42 2016 +0100
Committer: Maximilian Michels <mxm@apache.org>
Committed: Fri Feb 26 10:22:35 2016 +0100

----------------------------------------------------------------------
 .../common/accumulators/SerializedListAccumulator.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/db6fda6a/flink-core/src/main/java/org/apache/flink/api/common/accumulators/SerializedListAccumulator.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/accumulators/SerializedListAccumulator.java
b/flink-core/src/main/java/org/apache/flink/api/common/accumulators/SerializedListAccumulator.java
index a88ea39..c81f9b0 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/accumulators/SerializedListAccumulator.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/accumulators/SerializedListAccumulator.java
@@ -42,14 +42,14 @@ public class SerializedListAccumulator<T> implements Accumulator<T,
ArrayList<by
 
 	private static final long serialVersionUID = 1L;
 
-	private ArrayList<byte[]> localValue = new ArrayList<byte[]>();
-	
+	private ArrayList<byte[]> localValue = new ArrayList<>();
+
 
 	@Override
 	public void add(T value) {
 		throw new UnsupportedOperationException();
 	}
-	
+
 	public void add(T value, TypeSerializer<T> serializer) throws IOException {
 		try {
 			ByteArrayOutputStream outStream = new ByteArrayOutputStream();
@@ -97,4 +97,9 @@ public class SerializedListAccumulator<T> implements Accumulator<T,
ArrayList<by
 		}
 		return result;
 	}
+
+	@Override
+	public String toString() {
+		return "SerializedListAccumulator: " + localValue.size() + " elements";
+	}
 }


Mime
View raw message