pengzhiwei2018 commented on a change in pull request #2596:
URL: https://github.com/apache/hudi/pull/2596#discussion_r584539040



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java
##########
@@ -258,4 +260,164 @@ public String getArchivelogFolder() {
   public Properties getProperties() {
     return props;
   }
+
+  public static PropertyBuilder propertyBuilder() {
+    return new PropertyBuilder();
+  }
+
+  public static class PropertyBuilder {
+    private HoodieTableType tableType;
+    private String tableName;
+    private String archiveLogFolder;
+    private String payloadClassName;
+    private Integer timelineLayoutVersion;
+    private String baseFileFormat;
+    private String preCombineField;
+    private String bootstrapIndexClass;
+    private String bootstrapBasePath;
+
+    private PropertyBuilder() {
+
+    }
+
+    public PropertyBuilder setTableType(HoodieTableType tableType) {
+      this.tableType = tableType;
+      return this;
+    }
+
+    public PropertyBuilder setTableType(String tableType) {
+      return setTableType(HoodieTableType.valueOf(tableType));
+    }
+
+    public PropertyBuilder setTableName(String tableName) {
+      this.tableName = tableName;
+      return this;
+    }
+
+    public PropertyBuilder setArchiveLogFolder(String archiveLogFolder) {
+      this.archiveLogFolder = archiveLogFolder;
+      return this;
+    }
+
+    public PropertyBuilder setPayloadClassName(String payloadClassName) {
+      this.payloadClassName = payloadClassName;
+      return this;
+    }
+
+    public PropertyBuilder setPayloadClass(Class<? extends 
HoodieRecordPayload> payloadClass) {
+      return setPayloadClassName(payloadClass.getName());
+    }
+
+    public PropertyBuilder setTimelineLayoutVersion(Integer 
timelineLayoutVersion) {
+      this.timelineLayoutVersion = timelineLayoutVersion;
+      return this;
+    }
+
+    public PropertyBuilder setBaseFileFormat(String baseFileFormat) {
+      this.baseFileFormat = baseFileFormat;
+      return this;
+    }
+
+    public PropertyBuilder setPreCombineField(String preCombineField) {
+      this.preCombineField = preCombineField;
+      return this;
+    }
+
+    public PropertyBuilder setBootstrapIndexClass(String bootstrapIndexClass) {
+      this.bootstrapIndexClass = bootstrapIndexClass;
+      return this;
+    }
+
+    public PropertyBuilder setBootstrapBasePath(String bootstrapBasePath) {
+      this.bootstrapBasePath = bootstrapBasePath;
+      return this;
+    }
+
+    public PropertyBuilder fromMetaClient(HoodieTableMetaClient metaClient) {

Review comment:
       Hi @nsivabalan , I found many test case use an exist MetaClient to init 
the table.e.g. 
[TestHoodieClientOnCopyOnWriteStorage](https://github.com/apache/hudi/pull/2596/files#diff-e6700bb657614fd972f92e1cb7c74b0f95d5164c62e298bb4712bb70db9f8ada).
 So I provide this method to simplify the call.




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

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


Reply via email to