guoweiM commented on a change in pull request #11: URL: https://github.com/apache/flink-ml/pull/11#discussion_r738894860
########## File path: flink-ml-iteration/src/main/java/org/apache/flink/iteration/compile/DraftExecutionEnvironment.java ########## @@ -0,0 +1,228 @@ +/* + * 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.iteration.compile; + +import org.apache.flink.annotation.VisibleForTesting; +import org.apache.flink.api.common.ExecutionConfig; +import org.apache.flink.api.common.JobExecutionResult; +import org.apache.flink.api.common.typeinfo.TypeInformation; +import org.apache.flink.api.dag.Transformation; +import org.apache.flink.core.execution.DefaultExecutorServiceLoader; +import org.apache.flink.iteration.compile.translator.BroadcastStateTransformationTranslator; +import org.apache.flink.iteration.compile.translator.KeyedBroadcastStateTransformationTranslator; +import org.apache.flink.iteration.compile.translator.MultipleInputTransformationTranslator; +import org.apache.flink.iteration.compile.translator.OneInputTransformationTranslator; +import org.apache.flink.iteration.compile.translator.PartitionTransformationTranslator; +import org.apache.flink.iteration.compile.translator.ReduceTransformationTranslator; +import org.apache.flink.iteration.compile.translator.SideOutputTransformationTranslator; +import org.apache.flink.iteration.compile.translator.TwoInputTransformationTranslator; +import org.apache.flink.iteration.compile.translator.UnionTransformationTranslator; +import org.apache.flink.iteration.operator.OperatorWrapper; +import org.apache.flink.iteration.utils.ReflectionUtils; +import org.apache.flink.streaming.api.datastream.DataStream; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction; +import org.apache.flink.streaming.api.graph.StreamGraph; +import org.apache.flink.streaming.api.transformations.BroadcastStateTransformation; +import org.apache.flink.streaming.api.transformations.KeyedBroadcastStateTransformation; +import org.apache.flink.streaming.api.transformations.KeyedMultipleInputTransformation; +import org.apache.flink.streaming.api.transformations.MultipleInputTransformation; +import org.apache.flink.streaming.api.transformations.OneInputTransformation; +import org.apache.flink.streaming.api.transformations.PartitionTransformation; +import org.apache.flink.streaming.api.transformations.ReduceTransformation; +import org.apache.flink.streaming.api.transformations.SideOutputTransformation; +import org.apache.flink.streaming.api.transformations.TwoInputTransformation; +import org.apache.flink.streaming.api.transformations.UnionTransformation; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import static org.apache.flink.util.Preconditions.checkState; + +/** + * A specialized stream execution environment that allows users to first construct a subgraph and + * later copy the transformations into the actual environment. During the copying it could apply + * some kinds of {@link OperatorWrapper} to change the operators in each transformation. + */ +public class DraftExecutionEnvironment extends StreamExecutionEnvironment { + + @SuppressWarnings("rawtypes") + private static final Map<Class<? extends Transformation>, DraftTransformationTranslator> + translators = new HashMap<>(); + + static { Review comment: Maybe you could just add a hot fix to the java doc. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org