manojpec commented on a change in pull request #4352: URL: https://github.com/apache/hudi/pull/4352#discussion_r793423011
########## File path: hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/metadata/FlinkHoodieBackedTableMetadataWriter.java ########## @@ -150,18 +152,30 @@ protected void commit(HoodieData<HoodieRecord> hoodieDataRecords, String partiti /** * Tag each record with the location in the given partition. - * + * <p> * The record is tagged with respective file slice's location based on its record key. */ - private List<HoodieRecord> prepRecords(List<HoodieRecord> records, String partitionName, int numFileGroups) { - List<FileSlice> fileSlices = HoodieTableMetadataUtil.getPartitionLatestFileSlices(metadataMetaClient, partitionName); - ValidationUtils.checkArgument(fileSlices.size() == numFileGroups, String.format("Invalid number of file groups: found=%d, required=%d", fileSlices.size(), numFileGroups)); - - return records.stream().map(r -> { - FileSlice slice = fileSlices.get(HoodieTableMetadataUtil.mapRecordKeyToFileGroupIndex(r.getRecordKey(), numFileGroups)); - final String instantTime = slice.isEmpty() ? "I" : "U"; - r.setCurrentLocation(new HoodieRecordLocation(instantTime, slice.getFileId())); - return r; - }).collect(Collectors.toList()); + private List<HoodieRecord> prepRecords(Map<MetadataPartitionType, HoodieData<HoodieRecord>> partitionRecordsMap) { Review comment: Refactored this method to the base class now. -- 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-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org