drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-2100: Added deleting temporary spill dir...
Date Thu, 21 Apr 2016 13:13:05 GMT
Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/454#discussion_r60576483
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
---
    @@ -223,7 +227,21 @@ public void close() {
             if (mSorter != null) {
               mSorter.clear();
             }
    -
    +        for(Iterator iter = this.currSpillDirs.iterator(); iter.hasNext(); iter.remove())
{
    +            Path path = (Path)iter.next();
    +            try {
    +                if (fs != null && path != null && fs.exists(path)) {
    +                    if (fs.delete(path, true)) {
    +                        fs.cancelDeleteOnExit(path);
    +                    }
    +                }
    +            } catch (IOException e) {
    +                // since this is meant to be used in a batches's cleanup, we don't propagate
the exception
    +                final String message = "Unable to delete spill directory \"" + path +
"\"";
    +                System.err.println(message + '.');
    --- End diff --
    
    I don't think printing to stderr is a good idea, logging a warning should be enough


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