drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #565: DRILL-4841: Use server event loop for web clients
Date Thu, 06 Oct 2016 22:08:11 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/565#discussion_r82263890
  
    --- Diff: common/src/main/java/org/apache/drill/common/AutoCloseables.java ---
    @@ -87,4 +87,29 @@ public static void close(Iterable<? extends AutoCloseable> ac)
throws Exception
           throw topLevelException;
         }
       }
    +
    +  /**
    +   * close() an {@see java.lang.AutoCloseable} without throwing a (checked)
    +   * {@see java.lang.Exception}. This wraps the close() call with a
    +   * try-catch that will rethrow an Exception wrapped with a
    +   * {@see java.lang.RuntimeException}, providing a way to call close()
    +   * without having to do the try-catch everywhere or propagate the Exception.
    +   *
    +   * @param autoCloseable the AutoCloseable to close; may be null
    +   * @throws RuntimeException if an Exception occurs; the Exception is
    +   *   wrapped by the RuntimeException
    +   */
    +  public static void closeNoChecked(final AutoCloseable autoCloseable) {
    --- End diff --
    
    closeUnchecked ?
    
    But, we are "checking", the "checked" has to do with the Exception type.
    
    Maybe cleanClose( ) for this function. Then, add a "closeSilently" to catch and ignore
close exceptions. (The closeSilently is handy in the case when, say, a file is full, a write
failed, and the close will also fail because it still can't flush pending buffers.) There
are other functions to the to silent close, but might be handy to have them in one place.


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