hddong commented on a change in pull request #1110: [HUDI-416] improve hint
information for cli
URL: https://github.com/apache/incubator-hudi/pull/1110#discussion_r360746190
##########
File path:
hudi-cli/src/main/java/org/apache/hudi/cli/commands/CompactionCommand.java
##########
@@ -71,10 +72,12 @@
private static final String TMP_DIR = "/tmp/";
- @CliAvailabilityIndicator({"compactions show all", "compaction show",
"compaction run", "compaction schedule"})
- public boolean isAvailable() {
- return (HoodieCLI.tableMetadata != null)
- && (HoodieCLI.tableMetadata.getTableType() ==
HoodieTableType.MERGE_ON_READ);
+ private HoodieTableMetaClient checkAndGetMetaClient() {
+ HoodieTableMetaClient client = HoodieCLI.getTableMetaClient();
+ if (client.getTableType() != HoodieTableType.MERGE_ON_READ) {
+ throw new InvalidTableTypeException("Compactions can only be run for
table type : MERGE_ON_READ");
Review comment:
> How about using `HoodieException` here and avoid creating new
InvalidTableTypeException class since it is only used here currently?
Yes, changed to HoodieException and I will delete InvalidTableTypeException.
----------------------------------------------------------------
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]
With regards,
Apache Git Services