majin1102 commented on code in PR #3486:
URL: https://github.com/apache/amoro/pull/3486#discussion_r2084030080


##########
amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableRuntime.java:
##########
@@ -0,0 +1,150 @@
+/*
+ * 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.amoro.server.table;
+
+import org.apache.amoro.Action;
+import org.apache.amoro.ManagedTableRuntime;
+import org.apache.amoro.ServerTableIdentifier;
+import org.apache.amoro.config.TableConfiguration;
+import org.apache.amoro.process.AmoroProcess;
+import org.apache.amoro.process.ProcessFactory;
+import org.apache.amoro.process.TableProcessState;
+import org.apache.amoro.server.metrics.MetricRegistry;
+import org.apache.amoro.server.optimizing.OptimizingProcess;
+import org.apache.amoro.server.persistence.StatedPersistentBase;
+import org.apache.amoro.server.persistence.TableRuntimeMeta;
+import org.apache.amoro.shade.guava32.com.google.common.base.Preconditions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
+
+public class DefaultTableRuntime extends StatedPersistentBase implements 
ManagedTableRuntime {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(DefaultTableRuntime.class);
+
+  private final Lock processLock = new ReentrantLock();
+  private final ServerTableIdentifier tableIdentifier;
+  private final DefaultOptimizingState optimizingState;
+  private final Map<Action, ProcessFactory<? extends TableProcessState>> 
processFactoryMap =

Review Comment:
   We could use ConcurrentMap, but processLock is still inevitable.
   Use a ConcurrentMap under a lock seems a little dummy to me.
   
   We could use different locks for each actions. I prefer raising another PR 
for this improvement



-- 
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: commits-unsubscr...@amoro.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to