Skip to content

[MINOR][SS] Add implementation note on overriding serialize/deserialize in HDFSMetadataLog methods' scaladoc#26732

Closed
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR:MINOR-SS-HDFSMetadataLog-serde-scaladoc
Closed

[MINOR][SS] Add implementation note on overriding serialize/deserialize in HDFSMetadataLog methods' scaladoc#26732
HeartSaVioR wants to merge 2 commits intoapache:masterfrom
HeartSaVioR:MINOR-SS-HDFSMetadataLog-serde-scaladoc

Conversation

@HeartSaVioR
Copy link
Contributor

What changes were proposed in this pull request?

The patch adds scaladoc on HDFSMetadataLog.serialize and HDFSMetadataLog.deserialize for adding implementation note when overriding - HDFSMetadataLog calls serialize and deserialize inside try-finally and caller will do the resource (input stream, output stream) cleanup, so resource cleanup should not be performed in these methods, but there's no note on this (only code comment, not scaladoc) which is easy to be missed.

Why are the changes needed?

Contributors who are unfamiliar with the intention seem to think it as a bug if the resource is not cleaned up in serialize/deserialize of subclass of HDFSMetadataLog, and they couldn't know about the intention without reading the code of HDFSMetadataLog. Adding the note as scaladoc would expand the visibility.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Just a doc change.

@HeartSaVioR
Copy link
Contributor Author

cc. @xy2953396112 as creator of origin PR
cc. @cloud-fan @srowen @dongjoon-hyun @HyukjinKwon as they've reviewed origin PR

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

LGTM

@HyukjinKwon
Copy link
Member

add to whitelist

@SparkQA
Copy link

SparkQA commented Dec 2, 2019

Test build #114704 has finished for PR 26732 at commit 410c666.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

retest this, please

@SparkQA
Copy link

SparkQA commented Dec 2, 2019

Test build #114711 has finished for PR 26732 at commit 410c666.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen srowen closed this in 54edaee Dec 2, 2019
@srowen
Copy link
Member

srowen commented Dec 2, 2019

Merged to master

@dongjoon-hyun
Copy link
Member

+1, Late LGTM.

@HeartSaVioR
Copy link
Contributor Author

Thanks all for reviewing and merging!

@HeartSaVioR HeartSaVioR deleted the MINOR-SS-HDFSMetadataLog-serde-scaladoc branch December 2, 2019 22:42
attilapiros pushed a commit to attilapiros/spark that referenced this pull request Dec 6, 2019
…ze in HDFSMetadataLog methods' scaladoc

### What changes were proposed in this pull request?

The patch adds scaladoc on `HDFSMetadataLog.serialize` and `HDFSMetadataLog.deserialize` for adding implementation note when overriding - HDFSMetadataLog calls `serialize` and `deserialize` inside try-finally and caller will do the resource (input stream, output stream) cleanup, so resource cleanup should not be performed in these methods, but there's no note on this (only code comment, not scaladoc) which is easy to be missed.

### Why are the changes needed?

Contributors who are unfamiliar with the intention seem to think it as a bug if the resource is not cleaned up in serialize/deserialize of subclass of HDFSMetadataLog, and they couldn't know about the intention without reading the code of HDFSMetadataLog. Adding the note as scaladoc would expand the visibility.

### Does this PR introduce any user-facing change?

No

### How was this patch tested?

Just a doc change.

Closes apache#26732 from HeartSaVioR/MINOR-SS-HDFSMetadataLog-serde-scaladoc.

Lead-authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan.opensource@gmail.com>
Co-authored-by: dz <953396112@qq.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
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.

7 participants