-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-544] Archived commits command code cleanup #1242
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| import org.apache.hudi.cli.TableHeader; | ||
| import org.apache.hudi.common.fs.FSUtils; | ||
| import org.apache.hudi.common.model.HoodieLogFile; | ||
| import org.apache.hudi.common.table.HoodieTableMetaClient; | ||
| import org.apache.hudi.common.table.log.HoodieLogFormat; | ||
| import org.apache.hudi.common.table.log.HoodieLogFormat.Reader; | ||
| import org.apache.hudi.common.table.log.block.HoodieAvroDataBlock; | ||
|
|
@@ -63,7 +64,7 @@ public String showArchivedCommits( | |
| throws IOException { | ||
| System.out.println("===============> Showing only " + limit + " archived commits <==============="); | ||
| String basePath = HoodieCLI.getTableMetaClient().getBasePath(); | ||
| Path archivePath = new Path(basePath + "/.hoodie/.commits_.archive*"); | ||
| Path archivePath = new Path(HoodieCLI.getTableMetaClient().getArchivePath() + "/.commits_.archive*"); | ||
| if (folder != null && !folder.isEmpty()) { | ||
| archivePath = new Path(basePath + "/.hoodie/" + folder); | ||
| } | ||
|
|
@@ -138,9 +139,11 @@ public String showCommits( | |
| throws IOException { | ||
|
|
||
| System.out.println("===============> Showing only " + limit + " archived commits <==============="); | ||
| String basePath = HoodieCLI.getTableMetaClient().getBasePath(); | ||
| HoodieTableMetaClient metaClient = HoodieCLI.getTableMetaClient(); | ||
| String basePath = metaClient.getBasePath(); | ||
| Path archivePath = new Path(metaClient.getArchivePath() + "/.commits_.archive*"); | ||
| FileStatus[] fsStatuses = | ||
| FSUtils.getFs(basePath, HoodieCLI.conf).globStatus(new Path(basePath + "/.hoodie/.commits_.archive*")); | ||
| FSUtils.getFs(basePath, HoodieCLI.conf).globStatus(archivePath); | ||
|
||
| List<Comparable[]> allCommits = new ArrayList<>(); | ||
| for (FileStatus fs : fsStatuses) { | ||
| // read the archived file | ||
|
|
||
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.
I'm assuming
HoodieCLI.getTableMetaClient().getArchivePath()returns the path with.hoodie?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.
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.
Yes, it read from metadata and include
.hoodie.