nsivabalan commented on code in PR #7076:
URL: https://github.com/apache/hudi/pull/7076#discussion_r1009644201


##########
hudi-cli/src/main/java/org/apache/hudi/cli/commands/ArchivedCommitsCommand.java:
##########
@@ -52,6 +67,35 @@
  */
 @ShellComponent
 public class ArchivedCommitsCommand {
+  private static final Logger LOG = 
LogManager.getLogger(ArchivedCommitsCommand.class);
+  private JavaSparkContext jsc;
+  @ShellMethod(key = "trigger archival", value = "trigger archival")
+  public void triggerArchival(
+      @ShellOption(value = {"--minCommits"},
+        help = "Minimum number of instants to retain in the active timeline. 
See hoodie.keep.min.commits",
+        defaultValue = "20") int minCommits,
+      @ShellOption(value = {"--maxCommits"},
+          help = "Maximum number of instants to retain in the active timeline. 
See hoodie.keep.max.commits",
+          defaultValue = "30") int maxCommits,
+      @ShellOption(value = {"--commitsRetained"}, help = "Number of commits to 
retain, without cleaning",
+          defaultValue = "10") int retained) {
+
+    initJavaSparkContext();
+    HoodieWriteConfig config = 
HoodieWriteConfig.newBuilder().withPath(HoodieCLI.basePath)
+        
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(minCommits,maxCommits).build())
+        
.withCleanConfig(HoodieCleanConfig.newBuilder().retainCommits(retained).build())
+        .withEmbeddedTimelineServerEnabled(false)
+        
.withMetadataConfig(HoodieMetadataConfig.newBuilder().enable(false).build())

Review Comment:
   actually, lets take enableMetadata as an argument as well. 



-- 
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]

Reply via email to