[HUDI-714]Add javadoc and comments to hudi write method link (#1409)
* [HUDI-714] Add javadoc and comments to hudi write method link
This commit is contained in:
@@ -225,6 +225,12 @@ public abstract class AbstractHoodieWriteClient<T extends HoodieRecordPayload> e
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HoodieTable and init {@link Timer.Context}.
|
||||
*
|
||||
* @param operationType write operation type
|
||||
* @return HoodieTable
|
||||
*/
|
||||
protected HoodieTable getTableAndInitCtx(WriteOperationType operationType) {
|
||||
HoodieTableMetaClient metaClient = createMetaClient(true);
|
||||
if (operationType == WriteOperationType.DELETE) {
|
||||
|
||||
@@ -49,7 +49,9 @@ public class WorkloadProfile<T extends HoodieRecordPayload> implements Serializa
|
||||
*/
|
||||
private final HashMap<String, WorkloadStat> partitionPathStatMap;
|
||||
|
||||
|
||||
/**
|
||||
* Global workloadStat.
|
||||
*/
|
||||
private final WorkloadStat globalStat;
|
||||
|
||||
public WorkloadProfile(JavaRDD<HoodieRecord<T>> taggedRecords) {
|
||||
@@ -59,13 +61,18 @@ public class WorkloadProfile<T extends HoodieRecordPayload> implements Serializa
|
||||
buildProfile();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method help to build WorkloadProfile.
|
||||
*/
|
||||
private void buildProfile() {
|
||||
|
||||
// group the records by partitionPath + currentLocation combination, count the number of
|
||||
// records in each partition
|
||||
Map<Tuple2<String, Option<HoodieRecordLocation>>, Long> partitionLocationCounts = taggedRecords
|
||||
.mapToPair(record -> new Tuple2<>(
|
||||
new Tuple2<>(record.getPartitionPath(), Option.ofNullable(record.getCurrentLocation())), record))
|
||||
.countByKey();
|
||||
|
||||
// count the number of both inserts and updates in each partition, update the counts to workLoadStats
|
||||
for (Map.Entry<Tuple2<String, Option<HoodieRecordLocation>>, Long> e : partitionLocationCounts.entrySet()) {
|
||||
String partitionPath = e.getKey()._1();
|
||||
Long count = e.getValue();
|
||||
|
||||
Reference in New Issue
Block a user