Skip to content
Permalink
Browse files
JIRA-1138
closes #27
  • Loading branch information
Maja Kabiljo committed Mar 30, 2017
1 parent 824b34c commit ba8c6e130e524fc1454b279ab329b03a9877b13e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
@@ -260,6 +260,9 @@ public void setup(Path[] zkPathList)
context
.setStatus("setup: Connected to Zookeeper service " + serverPortList);
this.graphFunctions = determineGraphFunctions(conf, zkManager);
if (this.graphFunctions.isMaster()) {
zkManager.cleanupOnExit();
}
try {
instantiateBspService();
} catch (IOException e) {
@@ -724,6 +724,18 @@ public boolean runsZooKeeper() {
}
}

/**
* Mark files zookeeper creates in hdfs to be deleted on exit.
* To be called on master, since it's the last one who finishes.
*/
public void cleanupOnExit() {
try {
fs.deleteOnExit(baseDirectory);
} catch (IOException e) {
LOG.error("cleanupOnExit: Failed to delete on exit " + baseDirectory);
}
}

/**
* Do necessary cleanup in zookeeper wrapper.
*/

0 comments on commit ba8c6e1

Please sign in to comment.