You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by aljoscha <gi...@git.apache.org> on 2016/04/14 16:11:08 UTC

[GitHub] flink pull request: [FLINK-3760] Fix StateDescriptor.readObject

GitHub user aljoscha opened a pull request:

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

    [FLINK-3760] Fix StateDescriptor.readObject

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [x] General
      - The pull request references the related JIRA issue
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message
    
    - [x] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    


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

    $ git pull https://github.com/aljoscha/flink state-descriptor-fix

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

    https://github.com/apache/flink/pull/1888.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 #1888
    
----
commit db0a97629a8f3f760bb031bf1e0734c7ec5e81b2
Author: Aljoscha Krettek <al...@gmail.com>
Date:   2016-04-14T14:10:06Z

    [FLINK-3760] Fix StateDescriptor.readObject

----


---
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-3760] Fix StateDescriptor.readObject

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

    https://github.com/apache/flink/pull/1888#issuecomment-210022530
  
    Thanks for having a look! I'll merge it...


---
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-3760] Fix StateDescriptor.readObject

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

    https://github.com/apache/flink/pull/1888#issuecomment-210024347
  
    Manually merged


---
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-3760] Fix StateDescriptor.readObject

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

    https://github.com/apache/flink/pull/1888#discussion_r59726012
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java ---
    @@ -284,8 +284,14 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot
     		boolean hasDefaultValue = in.readBoolean();
     		if (hasDefaultValue) {
     			int size = in.readInt();
    +
     			byte[] buffer = new byte[size];
    -			int bytesRead = in.read(buffer);
    +
    +			int bytesRead = 0;
    +
    +			while (bytesRead < size) {
    +				bytesRead += in.read(buffer, bytesRead, size - bytesRead);
    --- End diff --
    
    is there a reason we're not simply using readFully(buffer) ?


---
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-3760] Fix StateDescriptor.readObject

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

    https://github.com/apache/flink/pull/1888#issuecomment-210016840
  
    +1


---
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-3760] Fix StateDescriptor.readObject

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

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


---
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-3760] Fix StateDescriptor.readObject

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

    https://github.com/apache/flink/pull/1888#discussion_r59726934
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java ---
    @@ -284,8 +284,14 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNot
     		boolean hasDefaultValue = in.readBoolean();
     		if (hasDefaultValue) {
     			int size = in.readInt();
    +
     			byte[] buffer = new byte[size];
    -			int bytesRead = in.read(buffer);
    +
    +			int bytesRead = 0;
    +
    +			while (bytesRead < size) {
    +				bytesRead += in.read(buffer, bytesRead, size - bytesRead);
    --- End diff --
    
    That is true, changing.


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