Skip to content

Commit

Permalink
Fixed a jmx unregister bug in hdfs fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinmay Soman committed Dec 6, 2012
1 parent e6b24c6 commit 0f2f85e
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -177,7 +177,15 @@ public FileSystem run() throws Exception {
} catch(InterruptedException e) {
logger.error(e.getMessage());
return null;
} catch(Exception e) {
logger.error("Got an exception while getting the filesystem object: ");
logger.error("Exception class : " + e.getClass());
e.printStackTrace();
for(StackTraceElement et: e.getStackTrace()) {
logger.error(et.toString());
}
}

} else {
fs = path.getFileSystem(config);
}
Expand All @@ -192,7 +200,9 @@ public FileSystem run() throws Exception {
+ " already exists");
}

logger.info("Starting fetch for : " + sourceFileUrl);
boolean result = fetch(fs, path, destination, stats);
logger.info("Completed fetch : " + sourceFileUrl);

// Close the filesystem
fs.close();
Expand All @@ -206,7 +216,8 @@ public FileSystem run() throws Exception {
if(this.globalThrottleLimit != null) {
this.globalThrottleLimit.decrementNumJobs();
}
JmxUtils.unregisterMbean(jmxName);
if(jmxName != null)
JmxUtils.unregisterMbean(jmxName);
}
}

Expand Down

0 comments on commit 0f2f85e

Please sign in to comment.