vinothchandar commented on a change in pull request #3887:
URL: https://github.com/apache/hudi/pull/3887#discussion_r772807071
##########
File path:
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/table/HoodieFlinkTable.java
##########
@@ -51,9 +51,14 @@ protected HoodieFlinkTable(HoodieWriteConfig config,
HoodieEngineContext context
public static <T extends HoodieRecordPayload> HoodieFlinkTable<T>
create(HoodieWriteConfig config, HoodieFlinkEngineContext context) {
HoodieTableMetaClient metaClient =
-
HoodieTableMetaClient.builder().setConf(context.getHadoopConf().get()).setBasePath(config.getBasePath())
-
.setLoadActiveTimelineOnLoad(true).setConsistencyGuardConfig(config.getConsistencyGuardConfig())
- .setLayoutVersion(Option.of(new
TimelineLayoutVersion(config.getTimelineLayoutVersion()))).build();
+ HoodieTableMetaClient.builder()
Review comment:
same.
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/fs/FileSystemRetryConfig.java
##########
@@ -0,0 +1,131 @@
+/*
+ * 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.common.fs;
+
+import org.apache.hudi.common.config.ConfigClassProperty;
+import org.apache.hudi.common.config.ConfigGroups;
+import org.apache.hudi.common.config.ConfigProperty;
+import org.apache.hudi.common.config.HoodieConfig;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * The file system retry relevant config options.
+ */
+@ConfigClassProperty(name = "FileSystem Guard Configurations",
+ groupName = ConfigGroups.Names.WRITE_CLIENT,
+ description = "The filesystem retry related config options, to help
deal with runtime exception like list/get/put/delete performance issues.")
+public class FileSystemRetryConfig extends HoodieConfig {
+
+ public static final ConfigProperty<String> FILESYSTEM_RETRY_ENABLE =
ConfigProperty
+ .key("hoodie.filesystem.action.retry.enable")
Review comment:
can we drop `action` from the property name, given action has a
different meaning inside Hudi? May be `filesystem.operation`?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java
##########
@@ -253,7 +265,16 @@ public TimelineLayoutVersion getTimelineLayoutVersion() {
*/
public HoodieWrapperFileSystem getFs() {
if (fs == null) {
- FileSystem fileSystem = FSUtils.getFs(metaPath, hadoopConf.newCopy());
+ FileSystem fileSystem;
+ if (fileSystemRetryConfig.isFileSystemActionRetryEnable()) {
Review comment:
could we make this a property of the `StorageScheme`?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java
##########
@@ -138,8 +143,15 @@ private HoodieTableMetaClient(Configuration conf, String
basePath, boolean loadA
public HoodieTableMetaClient() {}
public static HoodieTableMetaClient reload(HoodieTableMetaClient
oldMetaClient) {
- return
HoodieTableMetaClient.builder().setConf(oldMetaClient.hadoopConf.get()).setBasePath(oldMetaClient.basePath).setLoadActiveTimelineOnLoad(oldMetaClient.loadActiveTimelineOnLoad)
-
.setConsistencyGuardConfig(oldMetaClient.consistencyGuardConfig).setLayoutVersion(Option.of(oldMetaClient.timelineLayoutVersion)).setPayloadClassName(null).build();
+ return HoodieTableMetaClient.builder()
Review comment:
can you please comment on these reformatted blocks to highlight what has
actually changed
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/AbstractHoodieClient.java
##########
@@ -132,9 +132,14 @@ protected void initWrapperFSMetrics() {
}
protected HoodieTableMetaClient createMetaClient(boolean
loadActiveTimelineOnLoad) {
- return
HoodieTableMetaClient.builder().setConf(hadoopConf).setBasePath(config.getBasePath())
-
.setLoadActiveTimelineOnLoad(loadActiveTimelineOnLoad).setConsistencyGuardConfig(config.getConsistencyGuardConfig())
- .setLayoutVersion(Option.of(new
TimelineLayoutVersion(config.getTimelineLayoutVersion()))).build();
+ return HoodieTableMetaClient.builder()
Review comment:
could we please avoid non-essential style fixes in the PR. Makes it
harder to review.
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/RetryHelper.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.common.util;
+
+import org.apache.hudi.common.fs.HoodieWrapperFileSystem;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+import java.util.Random;
+
+public class RetryHelper<T> {
+ private static final Logger LOG = LogManager.getLogger(RetryHelper.class);
+ private HoodieWrapperFileSystem.CheckedFunction<T> func;
Review comment:
Could we keep this generic? if we cannot avoid referencing any wrapper
file system stuff here, then we need to move this back with the `fs` package?
--
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]