hudi-agent commented on code in PR #18237:
URL: https://github.com/apache/hudi/pull/18237#discussion_r3282001678
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriterTableVersionSix.java:
##########
@@ -315,7 +316,12 @@ void compactIfNecessary(BaseHoodieWriteClient<?,I,?,O>
writeClient, Option<Strin
@Override
protected void executeClean(BaseHoodieWriteClient writeClient, String
instantTime) {
- writeClient.clean(createCleanTimestamp(instantTime));
+ String cleanInstant = createCleanTimestamp(instantTime);
+ if
(getMetadataMetaClient().getActiveTimeline().getCleanerTimeline().filterCompletedInstants().containsInstant(cleanInstant))
{
+ LOG.info(String.format("Clean with same %s time is already present in
the timeline, hence skipping to clean", cleanInstant));
+ } else {
Review Comment:
🤖 nit: the rest of this file uses SLF4J parameterized logging (e.g. line
290: `LOG.info("Compaction with same {} time ...", compactionInstantTime)`) —
could you use the same style here: `LOG.info("Clean with same {} time is
already present in the timeline, skipping", cleanInstant)`?
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriterTableVersionSix.java:
##########
@@ -341,8 +347,9 @@ private String createRollbackTimestamp(String timestamp) {
return timestamp + getRollbackOperationSuffix();
}
- private String createCleanTimestamp(String timestamp) {
- return timestamp + getCleanOperationSuffix();
+ @VisibleForTesting
+ static String createCleanTimestamp(String timestamp) {
+ return timestamp + "002";
}
Review Comment:
🤖 nit: `"002"` is a magic string here — could you extract it as a `static
final` constant (e.g. `CLEAN_OPERATION_SUFFIX = "002"`) so it's
self-documenting and consistent with the existing `getCleanOperationSuffix()`
instance method?
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]