[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[GitHub] activemq-artemis pull request #2454: ARTEMIS-2196 Avoid creating RandomAcces...
Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/2454#discussion_r240290721
--- Diff: artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/AbstractSequentialFile.java ---
@@ -91,7 +92,10 @@ public final void delete() throws IOException, InterruptedException, ActiveMQExc
close();
}
- if (file.exists() && !file.delete()) {
+ try {
+ Files.deleteIfExists(file.toPath());
--- End diff --
It is helpful in difference cases:
- NFS/GlusterFS volumes because it avoids 2 rount-trip across network
- local storage: is atomic with other file system operations and much cheaper re native (eg malloc) allocations on JNI side
---