IGNITE-7375: Right cleanup after training.

this closes #3478


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

Branch: refs/heads/ignite-7485-2
Commit: 50213a0aede8eaa383a0af558d2cb14ce563aeb1
Parents: a1922d7
Author: Artem Malykh <amal...@gridgain.com>
Authored: Tue Feb 6 20:40:47 2018 +0300
Committer: Yury Babak <yba...@gridgain.com>
Committed: Tue Feb 6 20:40:47 2018 +0300

----------------------------------------------------------------------
 .../ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/50213a0a/modules/ml/src/main/java/org/apache/ignite/ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java
----------------------------------------------------------------------
diff --git 
a/modules/ml/src/main/java/org/apache/ignite/ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java
 
b/modules/ml/src/main/java/org/apache/ignite/ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java
index 8e97d87..333afcc 100644
--- 
a/modules/ml/src/main/java/org/apache/ignite/ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java
+++ 
b/modules/ml/src/main/java/org/apache/ignite/ml/nn/trainers/distributed/MLPGroupUpdateTrainer.java
@@ -22,7 +22,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import java.util.UUID;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.Ignition;
@@ -324,7 +326,9 @@ public class MLPGroupUpdateTrainer<U extends Serializable> 
extends
 
     /** {@inheritDoc} */
     @Override protected void cleanup(MLPGroupUpdateTrainerLocalContext locCtx) 
{
-
+        
MLPGroupUpdateTrainerDataCache.getOrCreate(ignite).remove(locCtx.trainingUUID());
+        Set<GroupTrainerCacheKey<Void>> toRmv = 
MLPCache.allKeys(locCtx.parallelTrainingsCnt(), 
locCtx.trainingUUID()).collect(Collectors.toSet());
+        MLPCache.getOrCreate(ignite).removeAll(toRmv);
     }
 
     /**

Reply via email to