activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuconic <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request: [ARTEMIS-444] Extend AIOSequentialF...
Date Mon, 21 Mar 2016 15:30:33 GMT
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/425#discussion_r56841836
  
    --- Diff: artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/aio/AIOSequentialFileFactory.java
---
    @@ -114,6 +116,36 @@ public static boolean isSupported() {
           return LibaioContext.isLoaded();
        }
     
    +   public static boolean isSupported(File journalPath) {
    +      if (!isSupported()) {
    +         return false;
    +      }
    +
    +      File aioTestFile = new File(journalPath, AIO_TEST_FILE);
    +      try {
    +         int fd = LibaioContext.open(aioTestFile.getAbsolutePath(), true);
    +         LibaioContext.close(fd);
    +         aioTestFile.delete();
    +      }
    +      catch (Exception e) {
    +         // try to handle the file using plain Java
    +         // return false if and only if we can create/remove the file using
    +         // plain Java but not using AIO
    +         try {
    +            if (!aioTestFile.exists()) {
    +               if (!aioTestFile.createNewFile()) return true;
    --- End diff --
    
    Isn't that a bit convoluted?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message