dtarima commented on a change in pull request #33251:
URL: https://github.com/apache/spark/pull/33251#discussion_r667355215
##########
File path:
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/DownloadFile.java
##########
@@ -27,12 +27,10 @@
*/
public interface DownloadFile {
/**
- * Delete the file.
- *
- * @return <code>true</code> if and only if the file or directory is
- * successfully deleted; <code>false</code> otherwise
+ * Creates a new {@link DownloadFileDeleter} for the underlying resources of
+ * the {@link DownloadFile}.
*/
- boolean delete();
+ DownloadFileDeleter deleter();
Review comment:
Right, that's what I tried, but one of the implementations of the Java
interface is in Scala (`EncryptedDownloadFile`).
So it looked something like:
```
def deleter(): java.util.function.Function[java.lang.Void,
java.lang.Boolean] = ...
```
and on the call side:
```
file.deleter().apply(null)
```
It feels like there has to be an easy solution for the interoperability
problem, but nothing comes to mind except to have mirroring Scala interfaces or
implicit, like
```
implicit def convertFunc(
f: java.util.function.Function[java.lang.Void, java.lang.Boolean]): ()
=> Boolean =
() => f.apply(null)
```
BTW, thanks for reviewing!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]