You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Gilles Gaillard (JIRA)" <ji...@apache.org> on 2010/12/01 19:05:13 UTC
[jira] Created: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
DirectBinaryDecoder not correctly re-initialized with reuse option
------------------------------------------------------------------
Key: AVRO-705
URL: https://issues.apache.org/jira/browse/AVRO-705
Project: Avro
Issue Type: Bug
Components: java
Affects Versions: 1.4.1
Reporter: Gilles Gaillard
Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
The following is a proposition of correction at rev 1041110:
{noformat}
private ByteReader byteReader;
DirectBinaryDecoder(InputStream in) {
super();
init(in);
}
@Override
public void init(InputStream in) {
this.in = in;
byteReader = (in instanceof ByteBufferInputStream)
? new ReuseByteReader((ByteBufferInputStream) in)
: new ByteReader();
}
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
Posted by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thiruvalluvan M. G. updated AVRO-705:
-------------------------------------
Attachment: AVRO-705.patch
Good catch!
Added a test that catches the bug and fixed the bug as well.
> DirectBinaryDecoder not correctly re-initialized with reuse option
> ------------------------------------------------------------------
>
> Key: AVRO-705
> URL: https://issues.apache.org/jira/browse/AVRO-705
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.4.1
> Reporter: Gilles Gaillard
> Assignee: Thiruvalluvan M. G.
> Attachments: AVRO-705.patch
>
>
> Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
> The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
> The following is a proposition of correction at rev 1041110:
> {noformat}
> private ByteReader byteReader;
> DirectBinaryDecoder(InputStream in) {
> super();
> init(in);
> }
> @Override
> public void init(InputStream in) {
> this.in = in;
> byteReader = (in instanceof ByteBufferInputStream)
> ? new ReuseByteReader((ByteBufferInputStream) in)
> : new ByteReader();
> }
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12969529#action_12969529 ]
Doug Cutting commented on AVRO-705:
-----------------------------------
+1 Looks good and passes tests for me.
> DirectBinaryDecoder not correctly re-initialized with reuse option
> ------------------------------------------------------------------
>
> Key: AVRO-705
> URL: https://issues.apache.org/jira/browse/AVRO-705
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.4.1
> Reporter: Gilles Gaillard
> Assignee: Thiruvalluvan M. G.
> Attachments: AVRO-705.patch
>
>
> Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
> The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
> The following is a proposition of correction at rev 1041110:
> {noformat}
> private ByteReader byteReader;
> DirectBinaryDecoder(InputStream in) {
> super();
> init(in);
> }
> @Override
> public void init(InputStream in) {
> this.in = in;
> byteReader = (in instanceof ByteBufferInputStream)
> ? new ReuseByteReader((ByteBufferInputStream) in)
> : new ByteReader();
> }
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
Posted by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thiruvalluvan M. G. updated AVRO-705:
-------------------------------------
Status: Patch Available (was: Open)
> DirectBinaryDecoder not correctly re-initialized with reuse option
> ------------------------------------------------------------------
>
> Key: AVRO-705
> URL: https://issues.apache.org/jira/browse/AVRO-705
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.4.1
> Reporter: Gilles Gaillard
> Assignee: Thiruvalluvan M. G.
> Attachments: AVRO-705.patch
>
>
> Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
> The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
> The following is a proposition of correction at rev 1041110:
> {noformat}
> private ByteReader byteReader;
> DirectBinaryDecoder(InputStream in) {
> super();
> init(in);
> }
> @Override
> public void init(InputStream in) {
> this.in = in;
> byteReader = (in instanceof ByteBufferInputStream)
> ? new ReuseByteReader((ByteBufferInputStream) in)
> : new ByteReader();
> }
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
Posted by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thiruvalluvan M. G. reassigned AVRO-705:
----------------------------------------
Assignee: Thiruvalluvan M. G.
> DirectBinaryDecoder not correctly re-initialized with reuse option
> ------------------------------------------------------------------
>
> Key: AVRO-705
> URL: https://issues.apache.org/jira/browse/AVRO-705
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.4.1
> Reporter: Gilles Gaillard
> Assignee: Thiruvalluvan M. G.
>
> Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
> The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
> The following is a proposition of correction at rev 1041110:
> {noformat}
> private ByteReader byteReader;
> DirectBinaryDecoder(InputStream in) {
> super();
> init(in);
> }
> @Override
> public void init(InputStream in) {
> this.in = in;
> byteReader = (in instanceof ByteBufferInputStream)
> ? new ReuseByteReader((ByteBufferInputStream) in)
> : new ByteReader();
> }
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (AVRO-705) DirectBinaryDecoder not correctly
re-initialized with reuse option
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AVRO-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Doug Cutting updated AVRO-705:
------------------------------
Resolution: Fixed
Fix Version/s: 1.5.0
Hadoop Flags: [Reviewed]
Status: Resolved (was: Patch Available)
I just committed this. Thanks, Gilles & Thiru!
> DirectBinaryDecoder not correctly re-initialized with reuse option
> ------------------------------------------------------------------
>
> Key: AVRO-705
> URL: https://issues.apache.org/jira/browse/AVRO-705
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.4.1
> Reporter: Gilles Gaillard
> Assignee: Thiruvalluvan M. G.
> Fix For: 1.5.0
>
> Attachments: AVRO-705.patch
>
>
> Calling {{DecoderFactory.createBinaryDecoder(InputStream in, BinaryDecoder reuse)}} with {{reuse}} being a non null {{DirectBinaryDecoder}}, this {{DirectBinaryDecoder}} is simply reinitialized by a call to {{DirectBinaryDecoder.init}} which reinitializes the internal {{InputStream}}.
> The problem is that the {{byteReader}} attribute of {{DirectBinaryDecoder}} is not reinitialized and still points to the previously assigned {{ByteBufferInputStream}}
> The following is a proposition of correction at rev 1041110:
> {noformat}
> private ByteReader byteReader;
> DirectBinaryDecoder(InputStream in) {
> super();
> init(in);
> }
> @Override
> public void init(InputStream in) {
> this.in = in;
> byteReader = (in instanceof ByteBufferInputStream)
> ? new ReuseByteReader((ByteBufferInputStream) in)
> : new ByteReader();
> }
> {noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.