giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject git commit: updated refs/heads/trunk to ba8c6e1
Date Thu, 30 Mar 2017 20:23:14 GMT
Repository: giraph
Updated Branches:
  refs/heads/trunk 824b34cac -> ba8c6e130


JIRA-1138

closes #27


Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/ba8c6e13
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/ba8c6e13
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/ba8c6e13

Branch: refs/heads/trunk
Commit: ba8c6e130e524fc1454b279ab329b03a9877b13e
Parents: 824b34c
Author: Maja Kabiljo <majakabiljo@fb.com>
Authored: Thu Mar 30 13:23:00 2017 -0700
Committer: Maja Kabiljo <majakabiljo@fb.com>
Committed: Thu Mar 30 13:23:00 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/giraph/graph/GraphTaskManager.java  |  3 +++
 .../java/org/apache/giraph/zk/ZooKeeperManager.java     | 12 ++++++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/giraph/blob/ba8c6e13/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
index ca7226f..ac787cc 100644
--- a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
+++ b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
@@ -260,6 +260,9 @@ end[PURE_YARN]*/
     context
         .setStatus("setup: Connected to Zookeeper service " + serverPortList);
     this.graphFunctions = determineGraphFunctions(conf, zkManager);
+    if (this.graphFunctions.isMaster()) {
+      zkManager.cleanupOnExit();
+    }
     try {
       instantiateBspService();
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/giraph/blob/ba8c6e13/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java b/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
index b843882..c398140 100644
--- a/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
+++ b/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
@@ -725,6 +725,18 @@ public class ZooKeeperManager {
   }
 
   /**
+   * 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.
    */
   public void cleanup() {


Mime
View raw message