avplatonov commented on a change in pull request #6001: IGNITE-11137: 
IgniteModelStorage improvements for IgniteModel and SQL functionality
URL: https://github.com/apache/ignite/pull/6001#discussion_r253019927
 
 

 ##########
 File path: 
modules/ml/src/main/java/org/apache/ignite/ml/inference/IgniteModelStorageUtil.java
 ##########
 @@ -125,13 +161,30 @@ private static void saveModelDescriptorStorage(String 
name, UUID mdlId) {
         Ignite ignite = Ignition.ignite();
 
         ModelDescriptorStorage descStorage = new 
ModelDescriptorStorageFactory().getModelDescriptorStorage(ignite);
-        descStorage.put(name, new ModelDescriptor(
-            name,
+
+        boolean saved = descStorage.putIfAbsent(name, new ModelDescriptor(
+            mdlId.toString(),
             null,
             new ModelSignature(null, null, null),
             new ModelStorageModelReader(IGNITE_MDL_FOLDER + "/" + mdlId),
             new IgniteModelParser<>()
         ));
+
+        if (!saved)
 
 Review comment:
   What about flag force for put or another method "putIfAbsent"?
   In my opinion such behavior is implicit. OR you should write about exception 
in javadoc

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to