Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-20284][CORE] Make {Des,S}erializationStream extend Closeable #17598

Closed

Conversation

superbobry
Copy link
Contributor

What changes were proposed in this pull request?

This PR allows to use SerializationStream and DeserializationStream in try-with-resources.

How was this patch tested?

core unit tests.

This change allows to use these streams in try-with-resources.
@@ -125,7 +125,7 @@ abstract class SerializerInstance {
* A stream for writing serialized objects.
*/
@DeveloperApi
abstract class SerializationStream {
abstract class SerializationStream extends Closeable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the close() method need 'override' then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added that.

@SparkQA
Copy link

SparkQA commented Apr 11, 2017

Test build #3659 has finished for PR 17598 at commit 75ba026.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • abstract class SerializationStream extends Closeable
  • abstract class DeserializationStream extends Closeable

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern would be whether this changes the classes in a way that makes them subtly not compatible at runtime. MiMa doesn't seem to think so though, and it's a developer API, and I also can't think of why it would change compatibility of bytecode (close() method already exists) So I think this is OK.

@srowen
Copy link
Member

srowen commented Apr 13, 2017

Merged to master

@asfgit asfgit closed this in a4293c2 Apr 13, 2017
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
## What changes were proposed in this pull request?

This PR allows to use `SerializationStream` and `DeserializationStream` in try-with-resources.

## How was this patch tested?

`core` unit tests.

Author: Sergei Lebedev <s.lebedev@criteo.com>

Closes apache#17598 from superbobry/compression-stream-closeable.
@Willymontaz Willymontaz deleted the compression-stream-closeable branch April 2, 2019 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants