xuyang1706 commented on a change in pull request #9184: [FLINK-13339][ml] Add 
an implementation of pipeline's api
URL: https://github.com/apache/flink/pull/9184#discussion_r326133608
 
 

 ##########
 File path: 
flink-ml-parent/flink-ml-lib/src/main/java/org/apache/flink/ml/common/MLSession.java
 ##########
 @@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.flink.ml.common;
+
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.Table;
+import org.apache.flink.table.api.TableEnvironment;
+import org.apache.flink.table.api.java.BatchTableEnvironment;
+import org.apache.flink.table.api.java.StreamTableEnvironment;
+import org.apache.flink.table.api.java.internal.StreamTableEnvironmentImpl;
+import org.apache.flink.types.Row;
+
+/**
+ * MLSession hold the execution environment and others session shared variable.
+ *
+ * <P>In machine learning, we find that a single execution context is 
convenient for the user
+ * and thus we created the concept of machine learning session to hold the 
execution environment.
+ * For this reason, the batch tables using in machine learning should be 
created by the unique
+ * {@link BatchTableEnvironment}, and the stream tables using in machine 
learning should be created
+ * by the unique {@link StreamTableEnvironment}
+ */
+public class MLSession {
+       private static ExecutionEnvironment env;
+       private static StreamExecutionEnvironment streamEnv;
+       private static BatchTableEnvironment batchTableEnv;
+       private static StreamTableEnvironment streamTableEnv;
+
+       /**
+        * Factory to create {@link ExecutionEnvironment}.
 
 Review comment:
   thx, changed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to