LuciferYang commented on a change in pull request #33682:
URL: https://github.com/apache/spark/pull/33682#discussion_r686446775
##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -2657,6 +2657,24 @@ private[spark] object Utils extends Logging {
try f.apply(resource) finally resource.close()
}
+ /**
+ * Closes the given Closeable as a null-safe operation while consuming
IOException
+ * by the given consumer.
+ *
+ * @param closeable The resource to close, may be null.
+ * @param consumer Consumes the IOException thrown by Closeable#close().
+ */
+ def closeQuietly(closeable: Closeable, consumer: IOException => Unit =
null): Unit = {
Review comment:
ok
--
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]