Revision 94eb66593a328dd3fcecc5f5f1772d82843ec14f authored by Jungtaek Lim (HeartSaVioR) on 13 December 2019, 08:12:41 UTC, committed by Wenchen Fan on 13 December 2019, 08:12:41 UTC
### What changes were proposed in this pull request? This patch adds close() method to the DataWriter interface, which will become the place to cleanup the resource. ### Why are the changes needed? The lifecycle of DataWriter instance ends at either commit() or abort(). That makes datasource implementors to feel they can place resource cleanup in both sides, but abort() can be called when commit() fails; so they have to ensure they don't do double-cleanup if cleanup is not idempotent. ### Does this PR introduce any user-facing change? Depends on the definition of user; if they're developers of custom DSv2 source, they have to add close() in their DataWriter implementations. It's OK to just add close() with empty content as they should have already dealt with resource cleanup in commit/abort, but they would love to migrate the resource cleanup logic to close() as it avoids double cleanup. If they're just end users using the provided DSv2 source (regardless of built-in/3rd party), no change. ### How was this patch tested? Existing tests. Closes #26855 from HeartSaVioR/SPARK-30227. Authored-by: Jungtaek Lim (HeartSaVioR) <kabhwan.opensource@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent cb6d2b3
File | Mode | Size |
---|---|---|
mvn | -rwxr-xr-x | 6.7 KB |
sbt | -rwxr-xr-x | 5.3 KB |
sbt-launch-lib.bash | -rwxr-xr-x | 5.0 KB |
spark-build-info | -rwxr-xr-x | 1.5 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...