yuzhaojing commented on code in PR #5681: URL: https://github.com/apache/hudi/pull/5681#discussion_r918561931
########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/table/manager/HoodieTableManagerClient.java: ########## @@ -0,0 +1,191 @@ +/* + * 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.hudi.client.table.manager; + +import org.apache.hudi.common.config.HoodieTableManagerConfig; +import org.apache.hudi.common.table.HoodieTableMetaClient; +import org.apache.hudi.common.table.timeline.HoodieInstant; +import org.apache.hudi.common.util.ClusteringUtils; +import org.apache.hudi.common.util.StringUtils; +import org.apache.hudi.common.util.ValidationUtils; +import org.apache.hudi.exception.HoodieRemoteException; + +import org.apache.http.client.fluent.Request; +import org.apache.http.client.fluent.Response; +import org.apache.http.client.utils.URIBuilder; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * Client which send the table service instants to the table management service. + */ +public class HoodieTableManagerClient { + + private static final String BASE_URL = "/v1/hoodie/serivce"; + + public static final String REGISTER_ENDPOINT = String.format("%s/%s", BASE_URL, "register"); + + public static final String SUBMIT_COMPACTION = String.format("%s/%s", BASE_URL, "compact/submit"); + public static final String REMOVE_COMPACTION = String.format("%s/%s", BASE_URL, "compact/remove"); + + public static final String SUBMIT_CLUSTERING = String.format("%s/%s", BASE_URL, "cluster/submit"); Review Comment: will update. ########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java: ########## @@ -564,9 +569,13 @@ protected void runTableServicesInline(HoodieTable table, HoodieCommitMetadata me // Do an inline clustering if enabled if (config.inlineClusteringEnabled()) { - runAnyPendingClustering(table); metadata.addMetadata(HoodieClusteringConfig.INLINE_CLUSTERING.key(), "true"); - inlineClustering(extraMetadata); + if (delegateToTableManagerService(config, ActionType.replacecommit)) { + scheduleClustering(extraMetadata); + } else { + runAnyPendingClustering(table); + inlineClustering(extraMetadata); Review Comment: will update. ########## hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java: ########## @@ -547,9 +548,13 @@ protected void runTableServicesInline(HoodieTable table, HoodieCommitMetadata me } // Do an inline compaction if enabled if (config.inlineCompactionEnabled()) { - runAnyPendingCompactions(table); metadata.addMetadata(HoodieCompactionConfig.INLINE_COMPACT.key(), "true"); - inlineCompaction(extraMetadata); + if (delegateToTableManagerService(config, ActionType.compaction)) { + scheduleCompaction(extraMetadata); + } else { + runAnyPendingCompactions(table); + inlineCompaction(extraMetadata); + } Review Comment: will update. -- 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]
