From 2fdd0a06751d2038a17e5ee128a6a255b378762a Mon Sep 17 00:00:00 2001 From: Cheolsoo Park Date: Wed, 12 Dec 2012 13:33:28 -0800 Subject: [PATCH] SQOOP-766: Fix client resources (Jarek Jarcec Cecho via Cheolsoo Park) --- .../apache/sqoop/client/core/Constants.java | 18 ++---------- .../sqoop/client/shell/ShowJobFunction.java | 3 +- .../main/resources/client-resource.properties | 28 ++++++++----------- 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/client/src/main/java/org/apache/sqoop/client/core/Constants.java b/client/src/main/java/org/apache/sqoop/client/core/Constants.java index 72fe91c4..5e14769e 100644 --- a/client/src/main/java/org/apache/sqoop/client/core/Constants.java +++ b/client/src/main/java/org/apache/sqoop/client/core/Constants.java @@ -57,8 +57,6 @@ public class Constants { public static final char OPT_CLIENT_CHAR = 'c'; public static final char OPT_PROTOCOL_CHAR = 'p'; - - // Resource keys for various commands, command options, // functions and descriptions public static final String CMD_CLONE = "clone"; @@ -143,13 +141,10 @@ public class Constants { public static final String RES_PROMPT_FILL_JOB_METADATA = "prompt.fill_job_metadata"; - - - public static final String RES_CLONE_USAGE = "clone.usage"; public static final String RES_CLONE_CONN_SUCCESSFUL = - "clone.conn_successful"; + "clone.conn.successful"; public static final String RES_CLONE_JOB_SUCCESSFUL = "clone.job.successful"; public static final String RES_CLONE_CLONING_CONN = @@ -157,7 +152,6 @@ public class Constants { public static final String RES_CLONE_CLONING_JOB = "clone.cloning_job"; - public static final String RES_CREATE_USAGE = "create.usage"; public static final String RES_CREATE_CONN_SUCCESSFUL = @@ -169,7 +163,6 @@ public class Constants { public static final String RES_CREATE_CREATING_JOB = "create.creating_job"; - public static final String RES_DELETE_USAGE = "delete.usage"; @@ -227,7 +220,6 @@ public class Constants { public static final String RES_SHOW_PROMPT_CONN_INFO = "show.prompt_conn_info"; - public static final String RES_SHOW_PROMPT_DISPLAY_ALL_CONNECTORS = "show.prompt_display_all_connectors"; public static final String RES_SHOW_PROMPT_DISPLAY_CONNECTOR_CID = @@ -287,8 +279,6 @@ public class Constants { public static final String RES_SHOW_PROMPT_VERSION_PROTOCOL = "show.prompt_version_protocol"; - - public static final String RES_SQOOP_SHELL_BANNER = "sqoop.shell_banner"; public static final String RES_SQOOP_PROMPT_SHELL_LOADRC = @@ -296,19 +286,17 @@ public class Constants { public static final String RES_SQOOP_PROMPT_SHELL_LOADEDRC = "sqoop.prompt_shell_loadedrc"; - public static final String RES_SUBMISSION_USAGE = "submission.usage"; - public static final String RES_UPDATE_USAGE = "update.usage"; public static final String RES_UPDATE_UPDATING_CONN = - "update.updating_conn"; + "update.conn"; public static final String RES_UPDATE_CONN_SUCCESSFUL = "update.conn_successful"; public static final String RES_UPDATE_UPDATING_JOB = - "update.updating_job"; + "update.job"; public static final String RES_UPDATE_JOB_SUCCESSFUL = "update.job_successful"; private Constants() { diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java index 259739ae..b0780ef4 100644 --- a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java +++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java @@ -81,8 +81,7 @@ private void showJob(String jid) { JobBean jobBean = readJob(jid); List jobs = jobBean.getJobs(); - String s = MessageFormat.format(Constants - .RES_SHOW_PROMPT_JOBS_TO_SHOW, jobs.size()); + String s = MessageFormat.format(getResource().getString(Constants.RES_SHOW_PROMPT_JOBS_TO_SHOW), jobs.size()); io.out.println(s); for (MJob job : jobs) { diff --git a/client/src/main/resources/client-resource.properties b/client/src/main/resources/client-resource.properties index 1cee61a9..877c986e 100644 --- a/client/src/main/resources/client-resource.properties +++ b/client/src/main/resources/client-resource.properties @@ -51,19 +51,20 @@ connection object prompt.fill_job_metadata = Please fill following values to create new \ job object - - - -## Updating messages -updating.conn = Updating connection with id {0} -updating.job = Updating job with id {0} +# +# Update command +update.conn = Updating connection with id {0} +update.job = Updating job with id {0} +update.usage = Usage: update {0} +update.conn_successful = Connection was successfully updated with status {0} +update.job_successful = Job was successfully updated with status {0} # # Clone command clone.usage = Usage: clone {0} -clone.conn_successful = Connection was successfully created with validation \ +clone.conn.successful = Connection was successfully created with validation \ status {0} and persistent id {1} -clone.job_successful = Job was successfully created with validation \ +clone.job.successful = Job was successfully created with validation \ status {0} and persistent id {1} clone.cloning_conn = Cloning connection with id {0} clone.cloning_job = Cloning job with id {0} @@ -83,7 +84,6 @@ create.creating_job = Creating job for connection with id {0} # Delete command delete.usage = Usage: delete {0} - # # Help command help.usage = [] @@ -120,13 +120,13 @@ show.prompt_display_all_conns = Display all connections show.prompt_display_conn_xid = Display the connection with xid show.conn_usage = Usage: show connection show.prompt_conns_to_show = @|bold {0} connection(s) to show: |@ -show.prompt_conn_info = Connection with id {0} and name: ${1} +show.prompt_conn_info = Connection with id {0} and name: {1} show.prompt_display_all_connectors = Display all connectors show.prompt_display_connector_cid = Display the connector with xid show.connector_usage = Usage: show connector show.prompt_connectors_to_show = @|bold {0} connection(s) to show: |@ -show.prompt_connector_info = Connector with id {0}:\n Name: ${1} \n \ +show.prompt_connector_info = Connector with id {0}:\n Name: {1} \n \ Class: {2}\n Version: {3} show.framework_usage = Usage: show framework @@ -136,7 +136,7 @@ show.prompt_display_all_jobs = Display all jobs show.prompt_display_job_jid = Display jobwith given jid show.job_usage = Usage: show job show.prompt_jobs_to_show = @|bold {0} job(s) to show: |@ -show.prompt_job_info = Job with id {0} and name: ${1} +show.prompt_job_info = Job with id {0} and name: {1} show.prompt_display_all_servers = Display all server information show.prompt_display_server_host = Display server host name @@ -161,7 +161,3 @@ sqoop.prompt_shell_loadrc = Loading resource file {0} sqoop.prompt_shell_loadedrc = Resource file loaded. submission.usage = Usage: submission {0} - -update.usage = Usage: update {0} -update.conn_successful = Connection was successfully updated with status {0} -update.job_successful = Job was successfully updated with status {0}