From 8ce294662d1ba9f27661b060d6927f1b589dc6a2 Mon Sep 17 00:00:00 2001 From: VigneshSK17 Date: Thu, 2 Jan 2025 13:15:08 -0500 Subject: [PATCH] Fixed compilation issues --- .../apache/gravitino/cli/ErrorMessages.java | 1 - .../gravitino/cli/GravitinoCommandLine.java | 46 ++++--------------- docs/cli.md | 2 +- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java b/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java index ad7c4d5bb33..084b5c34c85 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/ErrorMessages.java @@ -57,7 +57,6 @@ public class ErrorMessages { public static final String UNKNOWN_ROLE = "Unknown role."; public static final String ROLE_EXISTS = "Role already exists."; public static final String TABLE_EXISTS = "Table already exists."; - public static final String UNKNOWN_MODEL = "Unknown model."; public static final String MODEL_EXISTS = "Model already exists."; public static final String INVALID_SET_COMMAND = "Unsupported combination of options either use --name, --user, --group or --property and --value."; diff --git a/clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java b/clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java index ee41aa91531..c23fb8b7cd0 100644 --- a/clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java +++ b/clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java @@ -498,43 +498,6 @@ private void handleTableCommand() { } } - /** - * Handles the command execution for Models based on command type and the command line options. - */ - private void handleModelCommand() { - String url = getUrl(); - String auth = getAuth(); - String userName = line.getOptionValue(GravitinoOptions.LOGIN); - FullName name = new FullName(line); - String metalake = name.getMetalakeName(); - String catalog = name.getCatalogName(); - - Command.setAuthenticationMode(auth, userName); - List missingEntities = Lists.newArrayList(); - if (metalake == null) missingEntities.add(CommandEntities.METALAKE); - if (catalog == null) missingEntities.add(CommandEntities.CATALOG); - - String model = name.getModelName(); - if (model == null) { - missingEntities.add(CommandEntities.MODEL); - } - - if (!missingEntities.isEmpty()) { - System.err.println("Missing required argument(s): " + COMMA_JOINER.join(missingEntities)); - Main.exit(-1); - } - - switch (command) { - case CommandActions.DETAILS: - if (line.hasOption(GravitinoOptions.AUDIT)) { - newModelAudit(url, ignore, metalake, catalog, model).handle(); - } else { - // newModelDetails(url, ignore, metalake, catalog, model).handle() - } - break; - } - } - /** Handles the command execution for Users based on command type and the command line options. */ protected void handleUserCommand() { String url = getUrl(); @@ -1191,6 +1154,9 @@ private void handleFilesetCommand() { } } + /** + * Handles the command execution for Models based on command type and the command line options. + */ private void handleModelCommand() { String url = getUrl(); String auth = getAuth(); @@ -1219,7 +1185,11 @@ private void handleModelCommand() { switch (command) { case CommandActions.DETAILS: - newModelDetails(url, ignore, metalake, catalog, schema, model).handle(); + if (line.hasOption(GravitinoOptions.AUDIT)) { + newModelAudit(url, ignore, metalake, catalog, schema, model).handle(); + } else { + newModelDetails(url, ignore, metalake, catalog, schema, model).handle(); + } break; default: diff --git a/docs/cli.md b/docs/cli.md index 4543dcaa573..0cc7dee4af9 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -23,7 +23,7 @@ alias gcli='java -jar ../../cli/build/libs/gravitino-cli-*-incubating-SNAPSHOT.j Or you use the `gcli.sh` script found in the `clients/cli/bin/` directory to run the CLI. ## Usage - +f The general structure for running commands with the Gravitino CLI is `gcli entity command [options]`. ```bash