wombatu-kun commented on code in PR #11152:
URL: https://github.com/apache/hudi/pull/11152#discussion_r1625200070
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/utils/HoodieWriterClientTestHarness.java:
##########
@@ -165,71 +247,1183 @@ public HoodieWriteConfig.Builder
getConfigBuilder(String schemaStr, HoodieIndex.
return builder;
}
- public void assertPartitionMetadataForRecords(String basePath,
List<HoodieRecord> inputRecords,
- HoodieStorage storage) throws
IOException {
- Set<String> partitionPathSet = inputRecords.stream()
- .map(HoodieRecord::getPartitionPath)
- .collect(Collectors.toSet());
- assertPartitionMetadata(basePath,
partitionPathSet.stream().toArray(String[]::new), storage);
+ // Functional Interfaces for passing lambda and Hoodie Write API contexts
+
+ @FunctionalInterface
+ public interface Function2<R, T1, T2> {
+
+ R apply(T1 v1, T2 v2) throws IOException;
+ }
+
+ @FunctionalInterface
+ public interface Function3<R, T1, T2, T3> {
+
+ R apply(T1 v1, T2 v2, T3 v3) throws IOException;
+ }
+
+ /* Auxiliary methods for testing CopyOnWriteStorage with Spark and Java
clients
+ to avoid code duplication in TestHoodieClientOnCopyOnWriteStorage and
TestHoodieJavaClientOnCopyOnWriteStorage */
+
+ protected List<WriteStatus> writeAndVerifyBatch(BaseHoodieWriteClient
client, List<HoodieRecord> inserts, String commitTime, boolean
populateMetaFields, boolean autoCommitOff) throws IOException {
+ // override in subclasses if needed
+ return Collections.emptyList();
Review Comment:
Ok, made it abstract, moved it's implementations from
TestHoodieJavaClientOnCopyOnWriteStorage to HoodieJavaClientTestHarness, and
from TestHoodieClientOnCopyOnWriteStorage to HoodieSparkClientTestHarness.
--
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]