sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-1430: Sqoop2: From/To: Change shell to take "from" and "to"
Date Wed, 13 Aug 2014 22:16:44 GMT
Repository: sqoop
Updated Branches:
  refs/heads/SQOOP-1367 bbe35ea36 -> 28d765cd4


SQOOP-1430: Sqoop2: From/To: Change shell to take "from" and "to"

(Abraham Elmahrek via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/28d765cd
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/28d765cd
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/28d765cd

Branch: refs/heads/SQOOP-1367
Commit: 28d765cd4bec4ae2373a815e4e6f5e094d55c5e0
Parents: bbe35ea
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed Aug 13 15:16:13 2014 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed Aug 13 15:16:13 2014 -0700

----------------------------------------------------------------------
 .../org/apache/sqoop/shell/CreateJobFunction.java   | 16 ++++++++--------
 .../sqoop/shell/DeleteConnectionFunction.java       |  2 +-
 .../apache/sqoop/shell/ShowConnectionFunction.java  |  8 ++++----
 .../java/org/apache/sqoop/shell/core/Constants.java | 14 ++++++--------
 .../org/apache/sqoop/shell/utils/FormDisplayer.java |  4 ++--
 shell/src/main/resources/shell-resource.properties  |  5 ++---
 6 files changed, 23 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
index de246cb..4ddcc12 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
@@ -44,13 +44,13 @@ public class CreateJobFunction extends  SqoopFunction {
   public CreateJobFunction() {
     this.addOption(OptionBuilder
       .withDescription(resourceString(Constants.RES_PROMPT_CONN_ID))
-      .withLongOpt(Constants.OPT_FXID)
+      .withLongOpt(Constants.OPT_FROM)
       .hasArg()
       .create(Constants.OPT_FXID_CHAR)
     );
     this.addOption(OptionBuilder
       .withDescription(resourceString(Constants.RES_PROMPT_CONN_ID))
-      .withLongOpt(Constants.OPT_TXID)
+      .withLongOpt(Constants.OPT_TO)
       .hasArg()
       .create(Constants.OPT_TXID_CHAR)
     );
@@ -58,12 +58,12 @@ public class CreateJobFunction extends  SqoopFunction {
 
   @Override
   public boolean validateArgs(CommandLine line) {
-    if (!line.hasOption(Constants.OPT_FXID)) {
-      printlnResource(Constants.RES_ARGS_FXID_MISSING);
+    if (!line.hasOption(Constants.OPT_FROM)) {
+      printlnResource(Constants.RES_ARGS_FROM_MISSING);
       return false;
     }
-    if (!line.hasOption(Constants.OPT_TXID)) {
-      printlnResource(Constants.RES_ARGS_TXID_MISSING);
+    if (!line.hasOption(Constants.OPT_TO)) {
+      printlnResource(Constants.RES_ARGS_TO_MISSING);
       return false;
     }
     return true;
@@ -72,8 +72,8 @@ public class CreateJobFunction extends  SqoopFunction {
   @Override
   @SuppressWarnings("unchecked")
   public Object executeFunction(CommandLine line, boolean isInteractive) throws IOException
{
-    return createJob(getLong(line, Constants.OPT_FXID),
-                     getLong(line, Constants.OPT_TXID),
+    return createJob(getLong(line, Constants.OPT_FROM),
+                     getLong(line, Constants.OPT_TO),
                      line.getArgList(),
                      isInteractive);
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
index c345ada..12f0083 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
@@ -40,7 +40,7 @@ public class DeleteConnectionFunction extends SqoopFunction {
 
   @Override
   public boolean validateArgs(CommandLine line) {
-    if (!line.hasOption(Constants.OPT_FXID)) {
+    if (!line.hasOption(Constants.OPT_FROM)) {
       printlnResource(Constants.RES_ARGS_XID_MISSING);
       return false;
     }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
index 3e8cc0a..b6cf403 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
@@ -42,9 +42,9 @@ public class ShowConnectionFunction extends SqoopFunction {
         .withDescription(resourceString(Constants.RES_SHOW_PROMPT_DISPLAY_ALL_CONNS))
         .withLongOpt(Constants.OPT_ALL)
         .create(Constants.OPT_ALL_CHAR));
-    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_FXID)
+    this.addOption(OptionBuilder.hasArg().withArgName(Constants.OPT_FROM)
         .withDescription(resourceString(Constants.RES_SHOW_PROMPT_DISPLAY_CONN_XID))
-        .withLongOpt(Constants.OPT_FXID)
+        .withLongOpt(Constants.OPT_FROM)
         .create(Constants.OPT_XID_CHAR));
   }
 
@@ -52,8 +52,8 @@ public class ShowConnectionFunction extends SqoopFunction {
   public Object executeFunction(CommandLine line, boolean isInteractive) {
     if (line.hasOption(Constants.OPT_ALL)) {
       showConnections();
-    } else if (line.hasOption(Constants.OPT_FXID)) {
-      showConnection(getLong(line, Constants.OPT_FXID));
+    } else if (line.hasOption(Constants.OPT_FROM)) {
+      showConnection(getLong(line, Constants.OPT_FROM));
     } else {
       showSummary();
     }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java b/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
index 3ea56a4..efabc46 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
@@ -35,12 +35,11 @@ public class Constants {
   // Options
 
   public static final String OPT_XID = "xid";
-  public static final String OPT_FXID = "fxid";
-  public static final String OPT_TXID = "txid";
+  public static final String OPT_FROM = "from";
+  public static final String OPT_TO = "to";
   public static final String OPT_ALL = "all";
   public static final String OPT_JID = "jid";
   public static final String OPT_CID = "cid";
-  public static final String OPT_TYPE = "type";
   public static final String OPT_NAME = "name";
   public static final String OPT_VALUE = "value";
   public static final String OPT_VERBOSE = "verbose";
@@ -61,7 +60,6 @@ public class Constants {
   public static final char OPT_ALL_CHAR = 'a';
   public static final char OPT_JID_CHAR = 'j';
   public static final char OPT_CID_CHAR = 'c';
-  public static final char OPT_TYPE_CHAR = 't';
   public static final char OPT_NAME_CHAR = 'n';
   public static final char OPT_VALUE_CHAR = 'v';
   public static final char OPT_HOST_CHAR = 'h';
@@ -134,10 +132,10 @@ public class Constants {
 
   public static final String RES_ARGS_XID_MISSING =
       "args.xid_missing";
-  public static final String RES_ARGS_FXID_MISSING =
-      "args.fxid_missing";
-  public static final String RES_ARGS_TXID_MISSING =
-      "args.txid_missing";
+  public static final String RES_ARGS_FROM_MISSING =
+      "args.from_missing";
+  public static final String RES_ARGS_TO_MISSING =
+      "args.to_missing";
   public static final String RES_ARGS_JID_MISSING =
       "args.jid_missing";
   public static final String RES_ARGS_CID_MISSING =

http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java b/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
index 44196e6..1e15eb5 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
@@ -71,12 +71,12 @@ public final class FormDisplayer {
     // @TODO(Abe): Validate From/To output is correct.
     displayFormsMetadata(
         connector.getJobForms(ConnectorType.FROM).getForms(),
-        resourceString(Constants.RES_FORMDISPLAYER_JOB),
+        ConnectorType.FROM.toString() + " " + resourceString(Constants.RES_FORMDISPLAYER_JOB),
         bundle);
 
     displayFormsMetadata(
         connector.getJobForms(ConnectorType.TO).getForms(),
-        resourceString(Constants.RES_FORMDISPLAYER_JOB),
+        ConnectorType.TO.toString() + " " + resourceString(Constants.RES_FORMDISPLAYER_JOB),
         bundle);
   }
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/28d765cd/shell/src/main/resources/shell-resource.properties
----------------------------------------------------------------------
diff --git a/shell/src/main/resources/shell-resource.properties b/shell/src/main/resources/shell-resource.properties
index 7fa5671..73a19e8 100644
--- a/shell/src/main/resources/shell-resource.properties
+++ b/shell/src/main/resources/shell-resource.properties
@@ -33,8 +33,8 @@ shared.unknown.function = The specified function "{0}" is not recognized.
 
 # Argument related
 args.xid_missing = Required argument --xid is missing.
-args.fxid_missing = Required argument --fxid is missing.
-args.txid_missing = Required argument --txid is missing.
+args.from_missing = Required argument --from is missing.
+args.to_missing = Required argument --to is missing.
 args.jid_missing = Required argument --jid is missing.
 args.cid_missing = Required argument --cid is missing.
 args.name_missing = Required argument --name is missing.
@@ -200,7 +200,6 @@ table.header.date = Last Update Date
 table.header.enabled = Enabled
 
 #Form displayer resources
-formdisplayer.supported_job_types = Supported job types
 formdisplayer.connection = Connection
 formdisplayer.job = Job
 formdisplayer.form = form


Mime
View raw message