You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Devajyoti Sarkar (JIRA)" <ji...@apache.org> on 2011/01/19 07:01:44 UTC

[jira] Created: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
------------------------------------------------------------------------------------------------

                 Key: AVRO-738
                 URL: https://issues.apache.org/jira/browse/AVRO-738
             Project: Avro
          Issue Type: Bug
          Components: java
    Affects Versions: 1.4.1
            Reporter: Devajyoti Sarkar


This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting resolved AVRO-738.
-------------------------------

       Resolution: Duplicate
    Fix Version/s:     (was: 1.5.1)

This was made obsolete by AVRO-753.  Resolving.

> BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
> ------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-738
>                 URL: https://issues.apache.org/jira/browse/AVRO-738
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Devajyoti Sarkar
>            Priority: Critical
>
> This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

Posted by "Scott Carey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Carey updated AVRO-738:
-----------------------------

         Priority: Critical  (was: Major)
    Fix Version/s: 1.5.0

This looks like a relatively crirical bug.

BinaryEncoder is not clearing out its byteWriter state when initialized with a new output stream.

In general it seems like there are several performance enhancements to be had as well -- access to the outputStream is too fine-grained.

As a work-around use the 

{code}
  public void writeBytes(byte[] bytes, int start, int len) throws IOException
{code}

signature instead of

{code}
  public void writeBytes(ByteBuffer bytes) throws IOException
{code}

That should avoid this bug.

> BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
> ------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-738
>                 URL: https://issues.apache.org/jira/browse/AVRO-738
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Devajyoti Sarkar
>            Priority: Critical
>             Fix For: 1.5.0
>
>
> This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-738:
------------------------------

    Fix Version/s:     (was: 1.5.0)
                   1.5.1

> BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
> ------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-738
>                 URL: https://issues.apache.org/jira/browse/AVRO-738
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Devajyoti Sarkar
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (AVRO-738) BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter

Posted by "Scott Carey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997636#comment-12997636 ] 

Scott Carey commented on AVRO-738:
----------------------------------

After AVRO-753, this will be closed since there won't be an init() method and the replacement via EncoderFactory.binaryEncoder() will not have this problem.

> BinaryEncoder's init() function does not reset the OutputStream of the embedded SimpleByteWriter
> ------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-738
>                 URL: https://issues.apache.org/jira/browse/AVRO-738
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.4.1
>            Reporter: Devajyoti Sarkar
>            Priority: Critical
>             Fix For: 1.5.1
>
>
> This is a problem if one is trying to reuse the BinaryEncoder by passing a new OutputStream with the init() method. While the encoder will write all the fields to the new OutputStream, fields that are of type "bytes" do not get written. This effectively means that one needs to create a new BinaryEncoder each time if one is serializing record with a "bytes" field in it.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira