mansonliwh commented on code in PR #3437: URL: https://github.com/apache/amoro/pull/3437#discussion_r1957758837
########## amoro-ams/src/main/java/org/apache/amoro/server/resource/DefaultOptimizerManager.java: ########## @@ -0,0 +1,132 @@ +/* + * 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.resource; + +import org.apache.amoro.config.Configurations; +import org.apache.amoro.resource.Resource; +import org.apache.amoro.resource.ResourceGroup; +import org.apache.amoro.server.persistence.PersistentBase; +import org.apache.amoro.server.persistence.mapper.OptimizerMapper; +import org.apache.amoro.server.persistence.mapper.ResourceMapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * DefaultOptimizingService is implementing the OptimizerManager Thrift service, which manages the + * optimizing tasks for tables. It includes methods for authenticating optimizers, polling tasks + * from the optimizing queue, acknowledging tasks,and completing tasks. The code uses several data + * structures, including maps for optimizing queues ,task runtimes, and authenticated optimizers. + * + * <p>The code also includes a TimerTask for detecting and removing expired optimizers and + * suspending tasks. + */ +public class DefaultOptimizerManager extends PersistentBase implements OptimizerManager { + + private static final Logger LOG = LoggerFactory.getLogger(DefaultOptimizerManager.class); Review Comment: Thanks for the notes, changes made. ########## amoro-ams/src/main/java/org/apache/amoro/server/AmoroServiceContainer.java: ########## @@ -99,6 +99,7 @@ public class AmoroServiceContainer { private DataSource dataSource; private CatalogManager catalogManager; private TableManager tableManager; + private OptimizerManager optimizerManager; Review Comment: Thanks for the notes, changes made. -- 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]
