weibozhao commented on a change in pull request #60:
URL: https://github.com/apache/flink-ml/pull/60#discussion_r810861246



##########
File path: 
flink-ml-core/src/main/java/org/apache/flink/ml/util/ReadWriteUtils.java
##########
@@ -431,8 +426,37 @@ public static void updateExistingParams(Stage<?> stage, 
Map<Param<?>, Object> pa
      */
     public static <T> DataStream<T> loadModelData(
             StreamExecutionEnvironment env, String path, SimpleStreamFormat<T> 
modelDecoder) {
+        String[] fileNames = new File(path).list();
+        org.apache.flink.core.fs.Path modelPath = null;
+        for (String fileName : fileNames) {
+            if (new File(path + "/" + fileName).isDirectory()) {
+                modelPath = new org.apache.flink.core.fs.Path(path + "/" + 
fileName);
+            }
+        }
+        Source<T, ?, ?> source = 
FileSource.forRecordStreamFormat(modelDecoder, modelPath).build();
+        return env.fromSource(source, WatermarkStrategy.noWatermarks(), 
"modelData");
+    }
+
+    /**
+     * Loads the model data from the given path which has more than one model.

Review comment:
       OK, I will update the doc. This function can get a model data with 
special model version from the path which has more than one model version.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to