You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jk...@apache.org on 2015/09/22 19:19:13 UTC

spark git commit: [SPARK-9962] [ML] Decision Tree training: prevNodeIdsForInstances.unpersist() at end of training

Repository: spark
Updated Branches:
  refs/heads/master 870b8a2ed -> f4a3c4e34


[SPARK-9962] [ML] Decision Tree training: prevNodeIdsForInstances.unpersist() at end of training

NodeIdCache: prevNodeIdsForInstances.unpersist() needs to be called at end of training.

Author: Holden Karau <ho...@pigscanfly.ca>

Closes #8541 from holdenk/SPARK-9962-decission-tree-training-prevNodeIdsForiNstances-unpersist-at-end-of-training.


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

Branch: refs/heads/master
Commit: f4a3c4e34ce93bcaf29c0a35573932880a8b792b
Parents: 870b8a2
Author: Holden Karau <ho...@pigscanfly.ca>
Authored: Tue Sep 22 10:19:08 2015 -0700
Committer: Joseph K. Bradley <jo...@databricks.com>
Committed: Tue Sep 22 10:19:08 2015 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala    | 8 ++++----
 .../scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/f4a3c4e3/mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala b/mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala
index 488e8e4..c5ad8df 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/tree/impl/NodeIdCache.scala
@@ -164,10 +164,10 @@ private[spark] class NodeIdCache(
         }
       }
     }
-  }
-  if (prevNodeIdsForInstances != null) {
-    // Unpersist the previous one if one exists.
-    prevNodeIdsForInstances.unpersist()
+    if (prevNodeIdsForInstances != null) {
+      // Unpersist the previous one if one exists.
+      prevNodeIdsForInstances.unpersist()
+    }
   }
 }
 

http://git-wip-us.apache.org/repos/asf/spark/blob/f4a3c4e3/mllib/src/main/scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala b/mllib/src/main/scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala
index 8f9eb24..0abed54 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/tree/impl/NodeIdCache.scala
@@ -166,6 +166,10 @@ private[spark] class NodeIdCache(
         fs.delete(new Path(old.getCheckpointFile.get), true)
       }
     }
+    if (prevNodeIdsForInstances != null) {
+      // Unpersist the previous one if one exists.
+      prevNodeIdsForInstances.unpersist()
+    }
   }
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org