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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to