You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "jonvex (via GitHub)" <gi...@apache.org> on 2024/06/13 17:05:57 UTC

[PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

jonvex opened a new pull request, #11448:
URL: https://github.com/apache/hudi/pull/11448

   ### Change Logs
   
   Number of constructor params is getting too long for the fg reader. Use builder style instead.
   
   ### Impact
   
   Easier to keep track of params for fg reader 
   
   ### Risk level (write none, low medium or high below)
   
   low
   
   ### Documentation Update
   
   N/A
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #11448:
URL: https://github.com/apache/hudi/pull/11448#discussion_r1638694040


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -256,6 +257,137 @@ public static RecordMergeMode getRecordMergeMode(Properties props) {
     return RecordMergeMode.valueOf(mergeMode);
   }
 
+  public static Builder builder() {
+    return new Builder<>();
+  }
+
+  public static class Builder<T> {
+
+    HoodieReaderContext<T> readerContext;
+    HoodieStorage storage;
+    String tablePath;
+    String latestCommitTime;
+    FileSlice fileSlice;
+    Schema dataSchema;
+    Schema requestedSchema;
+    Option<InternalSchema> internalSchemaOpt;
+    HoodieTableMetaClient hoodieTableMetaClient;
+    TypedProperties props;
+    HoodieTableConfig tableConfig;
+    long start;
+    long length;
+    boolean shouldUseRecordPosition = false;
+    long maxMemorySizeInBytes;
+    String spillableMapBasePath;
+    ExternalSpillableMap.DiskMapType diskMapType;
+    boolean isBitCaskDiskMapCompressionEnabled;
+
+    public Builder<T> withReaderContext(HoodieReaderContext<T> readerContext) {
+      this.readerContext = readerContext;
+      return this;
+    }
+
+    public Builder<T> withHoodieStorage(HoodieStorage storage) {
+      this.storage = storage;
+      return this;
+    }
+
+    public Builder<T> withTablePath(String tablePath) {
+      this.tablePath = tablePath;
+      return this;
+    }
+
+    public Builder<T> withLatestCommitTime(String latestCommitTime) {
+      this.latestCommitTime = latestCommitTime;
+      return this;
+    }
+
+    public Builder<T> withFileSlice(FileSlice fileSlice) {
+      this.fileSlice = fileSlice;
+      return this;
+    }
+
+    public Builder<T> withDataSchema(Schema dataSchema) {
+      this.dataSchema = dataSchema;
+      return this;
+    }
+
+    public Builder<T> withRequestedSchema(Schema requestedSchema) {
+      this.requestedSchema = requestedSchema;
+      return this;
+    }
+
+    public Builder<T> withInternalSchemaOpt(Option<InternalSchema> internalSchemaOpt) {
+      this.internalSchemaOpt = internalSchemaOpt;
+      return this;
+    }
+
+    public Builder<T> withMetaClient(HoodieTableMetaClient hoodieTableMetaClient) {
+      this.hoodieTableMetaClient = hoodieTableMetaClient;
+      return this;
+    }
+
+    public Builder<T> withTypedProperties(TypedProperties props) {
+      this.props = props;
+      return this;
+    }
+
+    public Builder<T> withTableConfig(HoodieTableConfig tableConfig) {
+      this.tableConfig = tableConfig;
+      return this;
+    }
+
+    public Builder<T> withStart(long start) {
+      this.start = start;
+      return this;
+    }
+
+    public Builder<T> withLength(long length) {
+      this.length = length;
+      return this;
+    }
+
+    public Builder<T> withUseRecordPosition(boolean shouldUseRecordPosition) {
+      this.shouldUseRecordPosition = shouldUseRecordPosition;
+      return this;
+    }
+
+    public Builder<T> withMaxMemorySizeInBytes(long maxMemorySizeInBytes) {
+      this.maxMemorySizeInBytes = maxMemorySizeInBytes;
+      return this;
+    }
+
+    public Builder<T> withSpillableMapBasePath(String spillableMapBasePath) {

Review Comment:
   Could you simplify the number of configs in the builder assuming that the user can use the file group reader API without having deep knowledge on Hudi?



-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #11448:
URL: https://github.com/apache/hudi/pull/11448#discussion_r1638668531


##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/TestHoodieFileGroupReaderBase.java:
##########
@@ -280,25 +279,24 @@ private void validateOutputFromFileGroupReader(StorageConfiguration<?> storageCo
       props.setProperty(PARTITION_FIELDS.key(), metaClient.getTableConfig().getString(PARTITION_FIELDS));
     }
     assertEquals(containsBaseFile, fileSlice.getBaseFile().isPresent());
-    HoodieFileGroupReader<T> fileGroupReader = new HoodieFileGroupReader<>(
-        getHoodieReaderContext(tablePath, avroSchema, storageConf),
-        metaClient.getStorage(),
-        tablePath,
-        metaClient.getActiveTimeline().lastInstant().get().getTimestamp(),
-        fileSlice,
-        avroSchema,
-        avroSchema,
-        Option.empty(),
-        metaClient,
-        props,
-        metaClient.getTableConfig(),
-        0,
-        fileSlice.getTotalFileSize(),
-        false,
-        1024 * 1024 * 1000,
-        metaClient.getTempFolderPath(),
-        ExternalSpillableMap.DiskMapType.ROCKS_DB,
-        false);
+    HoodieFileGroupReader<T> fileGroupReader = HoodieFileGroupReader.builder()
+        .withReaderContext(getHoodieReaderContext(tablePath, avroSchema, storageConf))
+        .withHoodieStorage(metaClient.getStorage())
+        .withTablePath(tablePath)
+        .withLatestCommitTime(metaClient.getActiveTimeline().lastInstant().get().getTimestamp())
+        .withFileSlice(fileSlice)
+        .withDataSchema(avroSchema)
+        .withRequestedSchema(avroSchema)
+        .withMetaClient(metaClient)
+        .withTypedProperties(props)
+        .withTableConfig(metaClient.getTableConfig())
+        .withStart(0)
+        .withLength(fileSlice.getTotalFileSize())
+        .withMaxMemorySizeInBytes(1024 * 1024 * 1000)

Review Comment:
   Also, consider making the size configurable instead of hard coded value. Can do it in a followup pr.



##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/TestHoodieFileGroupReaderBase.java:
##########
@@ -280,25 +279,24 @@ private void validateOutputFromFileGroupReader(StorageConfiguration<?> storageCo
       props.setProperty(PARTITION_FIELDS.key(), metaClient.getTableConfig().getString(PARTITION_FIELDS));
     }
     assertEquals(containsBaseFile, fileSlice.getBaseFile().isPresent());
-    HoodieFileGroupReader<T> fileGroupReader = new HoodieFileGroupReader<>(
-        getHoodieReaderContext(tablePath, avroSchema, storageConf),
-        metaClient.getStorage(),
-        tablePath,
-        metaClient.getActiveTimeline().lastInstant().get().getTimestamp(),
-        fileSlice,
-        avroSchema,
-        avroSchema,
-        Option.empty(),
-        metaClient,
-        props,
-        metaClient.getTableConfig(),
-        0,
-        fileSlice.getTotalFileSize(),
-        false,
-        1024 * 1024 * 1000,
-        metaClient.getTempFolderPath(),
-        ExternalSpillableMap.DiskMapType.ROCKS_DB,
-        false);
+    HoodieFileGroupReader<T> fileGroupReader = HoodieFileGroupReader.builder()
+        .withReaderContext(getHoodieReaderContext(tablePath, avroSchema, storageConf))
+        .withHoodieStorage(metaClient.getStorage())
+        .withTablePath(tablePath)
+        .withLatestCommitTime(metaClient.getActiveTimeline().lastInstant().get().getTimestamp())
+        .withFileSlice(fileSlice)
+        .withDataSchema(avroSchema)
+        .withRequestedSchema(avroSchema)
+        .withMetaClient(metaClient)
+        .withTypedProperties(props)
+        .withTableConfig(metaClient.getTableConfig())
+        .withStart(0)
+        .withLength(fileSlice.getTotalFileSize())
+        .withMaxMemorySizeInBytes(1024 * 1024 * 1000)

Review Comment:
   While we're at refactoring, can we also declare this size as constant at some common place.



-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166757804

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382",
       "triggerID" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7a032b2d72443ead03c3fb39af22552db360a2ba Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166575297

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382",
       "triggerID" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c2caef97e9e3a94097905179e57ab98e4fe8935 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380) 
   * 7a032b2d72443ead03c3fb39af22552db360a2ba Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166447956

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c2caef97e9e3a94097905179e57ab98e4fe8935 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on code in PR #11448:
URL: https://github.com/apache/hudi/pull/11448#discussion_r1638753499


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -256,6 +257,137 @@ public static RecordMergeMode getRecordMergeMode(Properties props) {
     return RecordMergeMode.valueOf(mergeMode);
   }
 
+  public static Builder builder() {
+    return new Builder<>();
+  }
+
+  public static class Builder<T> {
+
+    HoodieReaderContext<T> readerContext;
+    HoodieStorage storage;
+    String tablePath;
+    String latestCommitTime;
+    FileSlice fileSlice;
+    Schema dataSchema;
+    Schema requestedSchema;
+    Option<InternalSchema> internalSchemaOpt;
+    HoodieTableMetaClient hoodieTableMetaClient;
+    TypedProperties props;
+    HoodieTableConfig tableConfig;
+    long start;
+    long length;
+    boolean shouldUseRecordPosition = false;
+    long maxMemorySizeInBytes;
+    String spillableMapBasePath;
+    ExternalSpillableMap.DiskMapType diskMapType;
+    boolean isBitCaskDiskMapCompressionEnabled;

Review Comment:
   wow. too many args. 



##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -256,6 +257,137 @@ public static RecordMergeMode getRecordMergeMode(Properties props) {
     return RecordMergeMode.valueOf(mergeMode);
   }
 
+  public static Builder builder() {
+    return new Builder<>();
+  }
+
+  public static class Builder<T> {
+
+    HoodieReaderContext<T> readerContext;

Review Comment:
   private ?



-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "jonvex (via GitHub)" <gi...@apache.org>.
jonvex commented on code in PR #11448:
URL: https://github.com/apache/hudi/pull/11448#discussion_r1638841328


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -256,6 +257,137 @@ public static RecordMergeMode getRecordMergeMode(Properties props) {
     return RecordMergeMode.valueOf(mergeMode);
   }
 
+  public static Builder builder() {
+    return new Builder<>();
+  }
+
+  public static class Builder<T> {
+
+    HoodieReaderContext<T> readerContext;
+    HoodieStorage storage;
+    String tablePath;
+    String latestCommitTime;
+    FileSlice fileSlice;
+    Schema dataSchema;
+    Schema requestedSchema;
+    Option<InternalSchema> internalSchemaOpt;
+    HoodieTableMetaClient hoodieTableMetaClient;
+    TypedProperties props;
+    HoodieTableConfig tableConfig;
+    long start;
+    long length;
+    boolean shouldUseRecordPosition = false;
+    long maxMemorySizeInBytes;
+    String spillableMapBasePath;
+    ExternalSpillableMap.DiskMapType diskMapType;
+    boolean isBitCaskDiskMapCompressionEnabled;

Review Comment:
   https://github.com/apache/hudi/pull/11449
   https://github.com/apache/hudi/pull/11453
   https://github.com/apache/hudi/pull/11455
   followup prs to remove arguments



-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166545502

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c2caef97e9e3a94097905179e57ab98e4fe8935 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380) 
   * 7a032b2d72443ead03c3fb39af22552db360a2ba UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "jonvex (via GitHub)" <gi...@apache.org>.
jonvex closed pull request #11448: [HUDI-7386] Add Builder to FileGroup Reader
URL: https://github.com/apache/hudi/pull/11448


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "KnightChess (via GitHub)" <gi...@apache.org>.
KnightChess commented on code in PR #11448:
URL: https://github.com/apache/hudi/pull/11448#discussion_r1639092577


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieFileGroupReader.java:
##########
@@ -256,6 +257,137 @@ public static RecordMergeMode getRecordMergeMode(Properties props) {
     return RecordMergeMode.valueOf(mergeMode);
   }
 
+  public static Builder builder() {
+    return new Builder<>();
+  }
+
+  public static class Builder<T> {
+
+    HoodieReaderContext<T> readerContext;
+    HoodieStorage storage;
+    String tablePath;
+    String latestCommitTime;
+    FileSlice fileSlice;
+    Schema dataSchema;
+    Schema requestedSchema;
+    Option<InternalSchema> internalSchemaOpt;
+    HoodieTableMetaClient hoodieTableMetaClient;
+    TypedProperties props;
+    HoodieTableConfig tableConfig;
+    long start;
+    long length;
+    boolean shouldUseRecordPosition = false;
+    long maxMemorySizeInBytes;
+    String spillableMapBasePath;
+    ExternalSpillableMap.DiskMapType diskMapType;
+    boolean isBitCaskDiskMapCompressionEnabled;
+
+    public Builder<T> withReaderContext(HoodieReaderContext<T> readerContext) {
+      this.readerContext = readerContext;
+      return this;
+    }
+
+    public Builder<T> withHoodieStorage(HoodieStorage storage) {
+      this.storage = storage;
+      return this;
+    }
+
+    public Builder<T> withTablePath(String tablePath) {
+      this.tablePath = tablePath;
+      return this;
+    }
+
+    public Builder<T> withLatestCommitTime(String latestCommitTime) {
+      this.latestCommitTime = latestCommitTime;
+      return this;
+    }
+
+    public Builder<T> withFileSlice(FileSlice fileSlice) {
+      this.fileSlice = fileSlice;
+      return this;
+    }
+
+    public Builder<T> withDataSchema(Schema dataSchema) {
+      this.dataSchema = dataSchema;
+      return this;
+    }
+
+    public Builder<T> withRequestedSchema(Schema requestedSchema) {
+      this.requestedSchema = requestedSchema;
+      return this;
+    }
+
+    public Builder<T> withInternalSchemaOpt(Option<InternalSchema> internalSchemaOpt) {
+      this.internalSchemaOpt = internalSchemaOpt;
+      return this;
+    }
+
+    public Builder<T> withMetaClient(HoodieTableMetaClient hoodieTableMetaClient) {
+      this.hoodieTableMetaClient = hoodieTableMetaClient;
+      return this;
+    }
+
+    public Builder<T> withTypedProperties(TypedProperties props) {
+      this.props = props;
+      return this;
+    }
+
+    public Builder<T> withTableConfig(HoodieTableConfig tableConfig) {
+      this.tableConfig = tableConfig;
+      return this;
+    }
+
+    public Builder<T> withStart(long start) {
+      this.start = start;
+      return this;
+    }
+
+    public Builder<T> withLength(long length) {
+      this.length = length;
+      return this;
+    }
+
+    public Builder<T> withUseRecordPosition(boolean shouldUseRecordPosition) {
+      this.shouldUseRecordPosition = shouldUseRecordPosition;
+      return this;
+    }
+
+    public Builder<T> withMaxMemorySizeInBytes(long maxMemorySizeInBytes) {
+      this.maxMemorySizeInBytes = maxMemorySizeInBytes;
+      return this;
+    }
+
+    public Builder<T> withSpillableMapBasePath(String spillableMapBasePath) {
+      this.spillableMapBasePath = spillableMapBasePath;
+      return this;
+    }
+
+    public Builder<T> withDiskMapType(ExternalSpillableMap.DiskMapType diskMapType) {
+      this.diskMapType = diskMapType;
+      return this;
+    }
+
+    public Builder<T> withBitCaskDiskMapCompressionEnabled(boolean isBitCaskDiskMapCompressionEnabled) {
+      this.isBitCaskDiskMapCompressionEnabled = isBitCaskDiskMapCompressionEnabled;
+      return this;
+    }
+
+    public HoodieFileGroupReader<T> build() {
+      ValidationUtils.checkArgument(readerContext != null);
+      ValidationUtils.checkArgument(fileSlice != null);
+      ValidationUtils.checkArgument(dataSchema != null);
+      ValidationUtils.checkArgument(requestedSchema != null);
+      if (internalSchemaOpt == null) {

Review Comment:
   other like `shouldUseRecordPosition`, `maxMemorySizeInBytes`,`spillableMapBasePath`... may be can give default value



-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166465238

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c2caef97e9e3a94097905179e57ab98e4fe8935 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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


Re: [PR] [HUDI-7386] Add Builder to FileGroup Reader [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11448:
URL: https://github.com/apache/hudi/pull/11448#issuecomment-2166558515

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380",
       "triggerID" : "9c2caef97e9e3a94097905179e57ab98e4fe8935",
       "triggerType" : "PUSH"
     }, {
       "hash" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382",
       "triggerID" : "7a032b2d72443ead03c3fb39af22552db360a2ba",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c2caef97e9e3a94097905179e57ab98e4fe8935 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24380) 
   * 7a032b2d72443ead03c3fb39af22552db360a2ba Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24382) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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-unsubscribe@hudi.apache.org

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