Fanoid commented on code in PR #210:
URL: https://github.com/apache/flink-ml/pull/210#discussion_r1128853646


##########
flink-ml-lib/src/main/java/org/apache/flink/ml/common/gbt/operators/CalcLocalSplitsOperator.java:
##########
@@ -0,0 +1,129 @@
+/*
+ * 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.gbt.operators;
+
+import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
+import org.apache.flink.iteration.IterationListener;
+import org.apache.flink.iteration.datacache.nonkeyed.ListStateWithCache;
+import org.apache.flink.iteration.operator.OperatorStateUtils;
+import org.apache.flink.ml.common.gbt.defs.Histogram;
+import org.apache.flink.ml.common.gbt.defs.LearningNode;
+import org.apache.flink.ml.common.gbt.defs.Splits;
+import org.apache.flink.ml.common.sharedstorage.SharedStorageContext;
+import org.apache.flink.ml.common.sharedstorage.SharedStorageStreamOperator;
+import org.apache.flink.runtime.state.StateInitializationContext;
+import org.apache.flink.runtime.state.StateSnapshotContext;
+import org.apache.flink.streaming.api.operators.AbstractStreamOperator;
+import org.apache.flink.streaming.api.operators.OneInputStreamOperator;
+import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
+import org.apache.flink.util.Collector;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+
+/** Calculates local splits for assigned (nodeId, featureId) pairs. */
+public class CalcLocalSplitsOperator extends AbstractStreamOperator<Splits>
+        implements OneInputStreamOperator<Histogram, Splits>,
+                IterationListener<Splits>,
+                SharedStorageStreamOperator {
+
+    private static final String SPLIT_FINDER_STATE_NAME = "split_finder";
+    private final String sharedStorageAccessorID;
+    // States of local data.
+    private transient ListStateWithCache<SplitFinder> splitFinderState;
+    private transient SplitFinder splitFinder;
+    private transient SharedStorageContext sharedStorageContext;
+
+    public CalcLocalSplitsOperator() {
+        sharedStorageAccessorID = getClass().getSimpleName() + "-" + 
UUID.randomUUID();

Review Comment:
   Actually, I've tried `StreamOperator#getOperatorID` before.  
   
   Since the Operator ID cannot be obtained before execution, we are unable to 
specify the owner map of share data items when building graph. Without the 
owner map, it is difficult to control access in runtime.
   



-- 
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

Reply via email to