beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-2249) AvroIO does not handle partial reads
Date Wed, 10 May 2017 17:19:04 GMT

    [ https://issues.apache.org/jira/browse/BEAM-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16005054#comment-16005054
] 

ASF GitHub Bot commented on BEAM-2249:
--------------------------------------

GitHub user dhalperi opened a pull request:

    https://github.com/apache/beam/pull/3050

    [BEAM-2249] Correctly handle partial reads in AvroSource

    R: @lukecwik 
    
    These were the only uses of `InputStream#read(byte[])` or `InputStream#read(byte[], int,
int)` that were clearly not handled correctly. All other uses:
    
    * ZipInputStream: https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/CompressedSource.java#L206
    * AvroSource: https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/io/AvroSource.java#L787
    * ExposedByteArrayInputStream https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ExposedByteArrayInputStream.java#L41
    * Twice in StreamUtils: https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StreamUtils.java#L48
    
    I believe these last are correct as they first assert bytes are available.

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

    $ git pull https://github.com/dhalperi/beam io-read-fully

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

    https://github.com/apache/beam/pull/3050.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 #3050
    
----
commit da314112d262007266aece731bd3914cbe22b258
Author: Dan Halperin <dhalperi@google.com>
Date:   2017-05-10T17:11:53Z

    [BEAM-2249] Correctly handle partial reads in AvroSource

----


> AvroIO does not handle partial reads
> ------------------------------------
>
>                 Key: BEAM-2249
>                 URL: https://issues.apache.org/jira/browse/BEAM-2249
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Daniel Halperin
>            Assignee: Daniel Halperin
>             Fix For: 2.0.0
>
>
> Reported by a user using HDFS with AvroIO, they are hitting an exception here: https://github.com/apache/beam/blob/4abb9cbc1db220af3663ddbacbbe26d7d443e621/sdks/java/core/src/main/java/org/apache/beam/sdk/io/AvroSource.java#L669
> Looks like this is because we are assuming the read will always return the right number
of bytes. We should be using {{IOUtils.readFully}} instead.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message