zhuzhurk commented on a change in pull request #16498:
URL: https://github.com/apache/flink/pull/16498#discussion_r671088677
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/blob/AbstractBlobCache.java
##########
@@ -249,6 +278,28 @@ public void close() throws IOException {
}
}
+ /**
+ * Delete the blob file with the given key.
+ *
+ * @param jobId ID of the job this blob belongs to (or <tt>null</tt> if
job-unrelated)
+ * @param blobKey The key of the desired BLOB.
+ * @return file successfully deleted or not.
+ */
+ public boolean deleteFileUnsafely(@Nullable JobID jobId, BlobKey blobKey) {
+ final File localFile =
+ new File(
+ BlobUtils.getStorageLocationPath(
+ storageDir.getAbsolutePath(), jobId, blobKey));
+ if (!localFile.delete() && localFile.exists()) {
+ log.warn(
+ "Failed to delete locally cached BLOB {} at {}",
+ blobKey,
+ localFile.getAbsolutePath());
+ return false;
Review comment:
Why do we have a return value but add no handling for it?
--
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]