You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2017/12/22 20:57:06 UTC
[GitHub] keith-turner closed pull request #986: Closed file system which is not eventually closed.
keith-turner closed pull request #986: Closed file system which is not eventually closed.
URL: https://github.com/apache/fluo/pull/986
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/modules/command/src/main/java/org/apache/fluo/command/FluoGetJars.java b/modules/command/src/main/java/org/apache/fluo/command/FluoGetJars.java
index d4f8c7b8..2ac32fe1 100644
--- a/modules/command/src/main/java/org/apache/fluo/command/FluoGetJars.java
+++ b/modules/command/src/main/java/org/apache/fluo/command/FluoGetJars.java
@@ -65,12 +65,14 @@ public static void main(String[] args) {
try {
if (config.getObserverJarsUrl().startsWith("hdfs://")) {
- FileSystem fs = FileSystem.get(new URI(config.getDfsRoot()), new Configuration());
- File downloadPathFile = new File(opts.getDownloadPath());
- if (downloadPathFile.exists()) {
- FileUtils.deleteDirectory(downloadPathFile);
+ try (FileSystem fs = FileSystem.get(new URI(config.getDfsRoot()), new Configuration())) {
+ File downloadPathFile = new File(opts.getDownloadPath());
+ if (downloadPathFile.exists()) {
+ FileUtils.deleteDirectory(downloadPathFile);
+ }
+ fs.copyToLocalFile(new Path(config.getObserverJarsUrl()),
+ new Path(opts.getDownloadPath()));
}
- fs.copyToLocalFile(new Path(config.getObserverJarsUrl()), new Path(opts.getDownloadPath()));
} else {
log.error("Unsupported url prefix for {}={}", FluoConfiguration.OBSERVER_JARS_URL_PROP,
config.getObserverJarsUrl());
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services