[GitHub] activemq-artemis pull request #2454: ARTEMIS-2196 Avoid creating RandomAcces...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2454: ARTEMIS-2196 Avoid creating RandomAcces...

asfgit
GitHub user franz1981 opened a pull request:

    https://github.com/apache/activemq-artemis/pull/2454

    ARTEMIS-2196 Avoid creating RandomAccessFile when FileChannel is needed

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/franz1981/activemq-artemis ARTEMIS-2196

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/2454.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2454
   
----
commit f418c52c62033461d54cd9252aa51284368e21e4
Author: Francesco Nigro <nigro.fra@...>
Date:   2018-12-07T15:52:02Z

    ARTEMIS-2196 Avoid creating RandomAccessFile when FileChannel is needed

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2454: ARTEMIS-2196 Avoid creating RandomAcces...

asfgit
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


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] activemq-artemis pull request #2454: ARTEMIS-2196 Avoid creating RandomAcces...

asfgit
In reply to this post by asfgit
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/2454


---