[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:

    --- 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
    -      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