prashantwason commented on code in PR #8758:
URL: https://github.com/apache/hudi/pull/8758#discussion_r1229037267
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -883,44 +977,58 @@ public void close() throws Exception {
/**
* Commit the {@code HoodieRecord}s to Metadata Table as a new delta-commit.
*
- * @param instantTime - Action instant time for this commit
- * @param partitionRecordsMap - Map of partition name to its records to
commit
- * @param canTriggerTableService true if table services can be scheduled and
executed. false otherwise.
+ * @param instantTime - Action instant time for this commit
+ * @param partitionRecordsMap - Map of partition type to its records to
commit
*/
- protected abstract void commit(
- String instantTime, Map<MetadataPartitionType, HoodieData<HoodieRecord>>
partitionRecordsMap,
- boolean canTriggerTableService);
+ protected abstract void commit(String instantTime,
Map<MetadataPartitionType, HoodieData<HoodieRecord>> partitionRecordsMap);
+
+ /**
+ * Commit the {@code HoodieRecord}s to Metadata Table as a new delta-commit
using bulk commit (if supported).
+ * <p>
+ * This is used to optimize the initial commit to the MDT partition which
may contains a large number of
+ * records and hence is more suited to bulkInsert for write performance.
+ *
+ * @param instantTime - Action instant time for this commit
+ * @param partitionType - The MDT partition to which records are to be
committed
+ * @param records - records to be bulk inserted
+ * @param fileGroupCount - The maximum number of file groups to which the
records will be written.
+ */
+ protected void bulkCommit(
+ String instantTime, MetadataPartitionType partitionType,
HoodieData<HoodieRecord> records,
+ int fileGroupCount) {
+ Map<MetadataPartitionType, HoodieData<HoodieRecord>> partitionRecordsMap =
new HashMap<>();
+ partitionRecordsMap.put(partitionType, records);
+ commit(instantTime, partitionRecordsMap);
Review Comment:
Done
--
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]