sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-811: Client shell variable substitution for recent commands
Date Sun, 06 Jan 2013 18:23:12 GMT
Updated Branches:
  refs/heads/sqoop2 53688b54b -> 2016dedce


SQOOP-811: Client shell variable substitution for recent commands

(Vasanth kumar RJ 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/2016dedc
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/2016dedc
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/2016dedc

Branch: refs/heads/sqoop2
Commit: 2016dedce6658ebdf6468593053ed9c7ec8134db
Parents: 53688b5
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sun Jan 6 10:20:22 2013 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sun Jan 6 10:20:22 2013 -0800

----------------------------------------------------------------------
 .../apache/sqoop/client/shell/CloneCommand.java    |    2 +-
 .../apache/sqoop/client/shell/CreateCommand.java   |    2 +-
 .../apache/sqoop/client/shell/DeleteCommand.java   |    2 +-
 .../org/apache/sqoop/client/shell/SetCommand.java  |    3 +-
 .../org/apache/sqoop/client/shell/ShowCommand.java |    2 +-
 .../apache/sqoop/client/shell/SqoopCommand.java    |   16 +++++++++++++++
 .../sqoop/client/shell/SubmissionCommand.java      |    2 +-
 .../apache/sqoop/client/shell/UpdateCommand.java   |    2 +-
 8 files changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
index 827d168..a127d61 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
@@ -42,7 +42,7 @@ public class CloneCommand extends SqoopCommand {
       Constants.PRE_CLONE, Constants.SUF_INFO);
   }
 
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_CLONE_USAGE), getUsage());
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
index ad4d8fd..6cd2ff5 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
@@ -41,7 +41,7 @@ public class CreateCommand extends SqoopCommand {
       Constants.PRE_CREATE, Constants.SUF_INFO);
   }
 
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_CREATE_USAGE), getUsage());
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
index 5ab6495..38b2fda 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
@@ -42,7 +42,7 @@ public class DeleteCommand extends SqoopCommand {
 
   @Override
   @SuppressWarnings("unchecked")
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_DELETE_USAGE), getUsage());
     if (args.size() == 0) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
index fb6e8c8..6c17e25 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
@@ -40,7 +40,7 @@ public class SetCommand extends SqoopCommand
 
   @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg =  MessageFormat.format(getResource().getString(Constants
         .RES_SET_USAGE), getUsage());
 
@@ -49,7 +49,6 @@ public class SetCommand extends SqoopCommand
       io.out.println();
       return null;
     }
-    resolveVariables(args);
     String func = (String)args.get(0);
     if (func.equals(Constants.FN_SERVER)) {
       if (serverFunction == null) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
index efbb8f2..a043aa3 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
@@ -47,7 +47,7 @@ public class ShowCommand extends SqoopCommand
 
   @SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_SHOW_USAGE), getUsage());
     if (args.size() == 0) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
index d818353..df9350f 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
@@ -126,6 +126,22 @@ public abstract class SqoopCommand extends ComplexCommandSupport
     return help;
   }
 
+  /**
+   * Override execute method
+   */
+  @Override
+  public Object execute(List args) {
+    resolveVariables(args);
+    return executeCommand(args);
+  }
+
+  /**
+   * Abstract executeCommand
+   * @param args list
+   * @return Object
+   */
+  public abstract Object executeCommand(List args);
+
   @SuppressWarnings({ "rawtypes", "unchecked" })
   protected void resolveVariables(List arg) {
     List temp = new ArrayList();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/SubmissionCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SubmissionCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/SubmissionCommand.java
index 2e1fb03..af4231d 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SubmissionCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/SubmissionCommand.java
@@ -43,7 +43,7 @@ public class SubmissionCommand  extends SqoopCommand {
       Constants.PRE_SUBMISSION, Constants.SUF_INFO);
   }
 
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_SUBMISSION_USAGE), getUsage());
     if (args.size() == 0) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/2016dedc/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java b/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
index d73b40e..fcf8862 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
+++ b/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
@@ -40,7 +40,7 @@ public class UpdateCommand extends SqoopCommand {
       Constants.PRE_UPDATE, Constants.SUF_INFO);
   }
 
-  public Object execute(List args) {
+  public Object executeCommand(List args) {
     String usageMsg = MessageFormat.format(getResource().getString(Constants
         .RES_UPDATE_USAGE), getUsage());
     if (args.size() == 0) {


Mime
View raw message