bvaradar commented on a change in pull request #1576:
URL: https://github.com/apache/incubator-hudi/pull/1576#discussion_r418199354
##########
File path: hudi-client/src/test/java/org/apache/hudi/table/TestCleaner.java
##########
@@ -128,10 +128,8 @@ private void
insertFirstBigBatchForClientCleanerTest(HoodieWriteConfig cfg, Hood
assertFalse(table.getCompletedCommitsTimeline().empty());
String instantTime =
table.getCompletedCommitsTimeline().getInstants().findFirst().get().getTimestamp();
+ // We no longer write empty cleaner plans when there are not enough
commits present
Review comment:
Yes, this particular check is when inserting first batch of data. There
are other checks present which validates the effect of valid clean operations
##########
File path:
hudi-client/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java
##########
@@ -111,10 +111,15 @@ public CleanPlanner(HoodieTable<T> hoodieTable,
HoodieWriteConfig config) {
* @throws IOException when underlying file-system throws this exception
*/
public List<String> getPartitionPathsToClean(Option<HoodieInstant>
newInstantToRetain) throws IOException {
- if (config.incrementalCleanerModeEnabled() &&
newInstantToRetain.isPresent()
+
+ if (!newInstantToRetain.isPresent() &&
(HoodieCleaningPolicy.KEEP_LATEST_COMMITS == config.getCleanerPolicy())) {
Review comment:
Done
##########
File path:
hudi-client/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java
##########
@@ -111,10 +111,15 @@ public CleanPlanner(HoodieTable<T> hoodieTable,
HoodieWriteConfig config) {
* @throws IOException when underlying file-system throws this exception
*/
public List<String> getPartitionPathsToClean(Option<HoodieInstant>
newInstantToRetain) throws IOException {
- if (config.incrementalCleanerModeEnabled() &&
newInstantToRetain.isPresent()
+
+ if (!newInstantToRetain.isPresent() &&
(HoodieCleaningPolicy.KEEP_LATEST_COMMITS == config.getCleanerPolicy())) {
+ LOG.info("No earliest commit to retain. No need to scan partitions !!");
+ return new ArrayList<>();
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.
For queries about this service, please contact Infrastructure at:
[email protected]