-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HUDI-9249]Support displaying InsertIntoHoodieTableCommand metrics in Spark Web UI #13068
base: master
Are you sure you want to change the base?
Conversation
@hudi-bot run azure |
@hudi-bot run azure |
1ac0bae
to
f42ddb2
Compare
} | ||
|
||
public abstract boolean commit(String instantTime, O writeStatuses, Option<Map<String, String>> extraMetadata, | ||
public abstract CommitStatus commit(String instantTime, O writeStatuses, Option<Map<String, String>> extraMetadata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CommitStatus
can be eliminated if we just return an option of HoodieCommitMetadata
?, empty means a failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of 'EmptyCommit', there is no HoodieCommitMetadata
produced, but need return true
hudi/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java
Lines 222 to 229 in 93b4da3
public boolean commitStats(String instantTime, List<HoodieWriteStat> stats, | |
Option<Map<String, String>> extraMetadata, | |
String commitActionType, Map<String, List<String>> partitionToReplaceFileIds, | |
Option<BiConsumer<HoodieTableMetaClient, HoodieCommitMetadata>> extraPreCommitFunc) { | |
// Skip the empty commit if not allowed | |
if (!config.allowEmptyCommit() && stats.isEmpty()) { | |
return true; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this case, we can return null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this case, we can return null?
Many callers need to verify success or failure, return null for EmptyCommit
case and return option for other cases will change simple boolean check to commitMetadataOpt == null || commitMetadataOpt.ifPresent
, This is a bit weird,I Idon't think it is a good way。
Lines 588 to 594 in 93b4da3
boolean success = writeClient.commit(instant, writeResults, Option.of(checkpointCommitMetadata), | |
tableState.commitAction, partitionToReplacedFileIds); | |
if (success) { | |
reset(); | |
this.ckpMetadata.commitInstant(instant); | |
LOG.info("Commit instant [{}] success!", instant); | |
} else { |
Lines 1002 to 1011 in 93b4da3
val commitSuccess = | |
client.commit(tableInstantInfo.instantTime, writeResult.getWriteStatuses, | |
common.util.Option.of(new java.util.HashMap[String, String](metaMap.asJava)), | |
tableInstantInfo.commitActionType, | |
writeResult.getPartitionToReplaceFileIds, | |
common.util.Option.ofNullable(extraPreCommitFn.orNull)) | |
if (commitSuccess) { | |
log.info("Commit " + tableInstantInfo.instantTime + " successful!") | |
} |
@danny0405 PTAL |
@danny0405 PTAL |
not sure how the metrics work here because the commit has been finished, does it still make sense to show them on the UI ? can we just read the commit metadata from timeline for these metircs instead of touching the core API now ? |
Reading commit metadata through the call command can indeed retrieve these metrics, However, displaying the corresponding commit metrics directly on the Spark UI can simplify the troubleshooting process to some extent, eliminating the need for additional query actions. Additionally, the data displayed in the Spark UI comes from the spark event log, and the Spark UI of long-past run instances can be restored through the event log, with these commit metrics being displayed accordingly. In contrast, querying commit matedata from a long time ago via the API can be relatively cumbersome. |
Change Logs
Support displaying InsertIntoHoodieTableCommand metrics in Spark Web UI
implement steps
BaseHoodieWriteClient.commit
fromboolean
toCommitStatus
(contains a boolean statussuccess
and aHoodieCommitMetadata
)InsertIntoHoodieTableCommand
fromHoodieCommitMetadata
Before

After

Impact
Change the return type of
BaseHoodieWriteClient.commit
fromboolean
toCommitStatus
(contains a boolean statussuccess
and aHoodieCommitMetadata
)Risk level (write none, low medium or high below)
low
Documentation Update
None
Contributor's checklist