You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by rmetzger <gi...@git.apache.org> on 2015/02/18 13:29:41 UTC
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
GitHub user rmetzger opened a pull request:
https://github.com/apache/flink/pull/415
[FLINK-1555] Add serializer hierarchy debug util
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rmetzger/flink flink1555
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/415.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #415
----
commit 9e640e520c3120bea32798daf42ee64b10dd8655
Author: Robert Metzger <rm...@apache.org>
Date: 2015-02-18T10:39:24Z
[FLINK-1555] Add serializer hierarchy debug util
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on the pull request:
https://github.com/apache/flink/pull/415#issuecomment-76709759
I suggest putting this code into a Util, not inside the GenericTypeInfo. Also, CompositeType has a method getFields() that gives you the names of all fields. To be fair, I added this very recently. :smile:
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/415#discussion_r25165611
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java ---
@@ -132,7 +133,31 @@ public CompositeType(Class<T> typeClass) {
}
return getNewComparator(config);
}
-
+
+ // --------------------------------------------------------------------------------------------
+
+ /**
+ * Debugging utility to understand the hierarchy of serializers created by the Java API.
+ */
+ public static <T> String getSerializerTree(TypeInformation<T> ti) {
+ return getSerializerTree(ti, 0);
+ }
+
+ private static <T> String getSerializerTree(TypeInformation<T> ti, int indent) {
+ String ret = "";
+ if(ti instanceof CompositeType) {
+ ret += ti.toString()+"\n";
--- End diff --
I agree.
I'll also update the PR to list the field types of GenericTypes as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/flink/pull/415
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/415#discussion_r25085047
--- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeType.java ---
@@ -132,7 +133,31 @@ public CompositeType(Class<T> typeClass) {
}
return getNewComparator(config);
}
-
+
+ // --------------------------------------------------------------------------------------------
+
+ /**
+ * Debugging utility to understand the hierarchy of serializers created by the Java API.
+ */
+ public static <T> String getSerializerTree(TypeInformation<T> ti) {
+ return getSerializerTree(ti, 0);
+ }
+
+ private static <T> String getSerializerTree(TypeInformation<T> ti, int indent) {
+ String ret = "";
+ if(ti instanceof CompositeType) {
+ ret += ti.toString()+"\n";
--- End diff --
Should the ```toString``` method not already print the whole tree? Thus, the information would be redundant.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request: [FLINK-1555] Add serializer hierarchy debug ut...
Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on the pull request:
https://github.com/apache/flink/pull/415#issuecomment-75753097
I've updated the PR to also print out the fields of GenericTypes.
I'm thinking to merge this in the next 24 hours.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---