yihua commented on code in PR #13670:
URL: https://github.com/apache/hudi/pull/13670#discussion_r2250397229


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/buffer/RecordsBasedFileGroupRecordBufferLoader.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.table.read.buffer;
+
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.engine.HoodieReaderContext;
+import org.apache.hudi.common.table.HoodieTableMetaClient;
+import org.apache.hudi.common.table.PartialUpdateMode;
+import org.apache.hudi.common.table.read.BaseFileUpdateCallback;
+import org.apache.hudi.common.table.read.BufferedRecord;
+import org.apache.hudi.common.table.read.HoodieReadStats;
+import org.apache.hudi.common.table.read.InputSplit;
+import org.apache.hudi.common.table.read.ReaderParameters;
+import org.apache.hudi.common.table.read.UpdateProcessor;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.storage.HoodieStorage;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Records based {@link FileGroupRecordBuffer} which takes in a map of records 
to be merged with a base file of interest.
+ * This will be used in write paths for COW merge cases.
+ * @param <T> Engine native presentation of the record.
+ */
+public class RecordsBasedFileGroupRecordBufferLoader<T> implements 
FileGroupRecordBufferLoader<T> {
+
+  private final Iterator<Map.Entry<Serializable, BufferedRecord<T>>> 
toBeMergedRecords;
+
+  private 
RecordsBasedFileGroupRecordBufferLoader(Iterator<Map.Entry<Serializable, 
BufferedRecord<T>>> toBeMergedRecords) {
+    super();
+    this.toBeMergedRecords = toBeMergedRecords;
+  }
+
+  static <T> RecordsBasedFileGroupRecordBufferLoader<T> 
getInstance(Iterator<Map.Entry<Serializable, BufferedRecord<T>>> 
toBeMergedRecords) {
+    return new RecordsBasedFileGroupRecordBufferLoader<>(toBeMergedRecords);
+  }
+
+  @Override
+  public Option<Pair<HoodieFileGroupRecordBuffer<T>, List<String>>> 
getRecordBuffer(HoodieReaderContext<T> readerContext,
+                                                                            
HoodieStorage storage,

Review Comment:
   It's fixed now.  The indentation was off as you can see the lines above.



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