You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by zentol <gi...@git.apache.org> on 2016/02/17 11:57:00 UTC

[GitHub] flink pull request: [FLINK-3332] TupleSerializer.getLength() can r...

GitHub user zentol opened a pull request:

    https://github.com/apache/flink/pull/1654

    [FLINK-3332] TupleSerializer.getLength() can return fixed-length size

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zentol/flink 3321_tupleserializer_length

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1654.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 #1654
    
----
commit 2a5510899099a59f06ee6c5a2550f8313b04d775
Author: zentol <s....@web.de>
Date:   2016-02-16T11:23:41Z

    [FLINK-3332] TupleSerializer.getLength() can return fixed-length size

----


---
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-3332] TupleSerializer.getLength() can r...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1654#discussion_r53162193
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java ---
    @@ -56,7 +58,19 @@ public boolean isImmutableType() {
     
     	@Override
     	public int getLength() {
    -		return -1;
    +		if (length == -2) {
    +			int sum = 0;
    +			for (TypeSerializer<Object> serializer : fieldSerializers) {
    +				if (serializer.getLength() != -1) {
    --- End diff --
    
    good idea, done.


---
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-3331] TupleSerializer.getLength() can r...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1654#issuecomment-187262614
  
    Looks good, +1 to merge this


---
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-3331] TupleSerializer.getLength() can r...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/1654


---
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-3331] TupleSerializer.getLength() can r...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the pull request:

    https://github.com/apache/flink/pull/1654#issuecomment-193726981
  
    Merging this.


---
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-3332] TupleSerializer.getLength() can r...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1654#discussion_r53161226
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializerBase.java ---
    @@ -56,7 +58,19 @@ public boolean isImmutableType() {
     
     	@Override
     	public int getLength() {
    -		return -1;
    +		if (length == -2) {
    +			int sum = 0;
    +			for (TypeSerializer<Object> serializer : fieldSerializers) {
    +				if (serializer.getLength() != -1) {
    --- End diff --
    
    How about making this check `serializer.getLength() > 0`? That way, we catch cases of "misbehaved" subclasses.


---
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-3332] TupleSerializer.getLength() can r...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1654#issuecomment-185199249
  
    Aside from a minor comment, this looks good.


---
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.
---