sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From q..@apache.org
Subject sqoop git commit: SQOOP-2121: Sqoop2: Show job should show connection information
Date Tue, 09 Jun 2015 02:39:29 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 3c4ace8b6 -> bd89d02eb


SQOOP-2121: Sqoop2: Show job should show connection information

(Dian Fu via Qian Xu)


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

Branch: refs/heads/sqoop2
Commit: bd89d02eb6a51d50413992594faec348144c0a41
Parents: 3c4ace8
Author: Qian Xu <qxu@apache.org>
Authored: Tue Jun 9 10:38:20 2015 +0800
Committer: Qian Xu <qxu@apache.org>
Committed: Tue Jun 9 10:38:20 2015 +0800

----------------------------------------------------------------------
 .../org/apache/sqoop/shell/ShowJobFunction.java | 33 +++++++++++++++++---
 1 file changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/bd89d02e/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
index fab99db..33c30bf 100644
--- a/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
@@ -20,7 +20,9 @@ package org.apache.sqoop.shell;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.sqoop.common.Direction;
+import org.apache.sqoop.model.MConnector;
 import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.shell.core.Constants;
 import org.apache.sqoop.shell.utils.TableDisplayer;
 import org.apache.sqoop.validation.Status;
@@ -86,10 +88,33 @@ public class ShowJobFunction extends SqoopFunction {
     for(MJob job : jobs) {
       ids.add(String.valueOf(job.getPersistenceId()));
       names.add(job.getName());
-      fromConnectors.add(String.valueOf(
-          job.getFromConnectorId()));
-      toConnectors.add(String.valueOf(
-          job.getToConnectorId()));
+
+      // From link and connnector
+      String fromLinkName = "";
+      MLink fromLink = client.getLink(job.getFromLinkId());
+      if (fromLink != null) {
+        fromLinkName = fromLink.getName();
+      }
+      String fromConnectorName = "";
+      MConnector fromConnector = client.getConnector(job.getFromConnectorId());
+      if (fromConnector != null) {
+        fromConnectorName = fromConnector.getUniqueName();
+      }
+      fromConnectors.add(fromLinkName + " (" + fromConnectorName + ")");
+
+      // To link and connector
+      String toLinkName = "";
+      MLink toLink = client.getLink(job.getToLinkId());
+      if (toLink != null) {
+        toLinkName = toLink.getName();
+      }
+      String toConnnectorName = "";
+      MConnector toConnector = client.getConnector(job.getToConnectorId());
+      if (toConnector != null) {
+        toConnnectorName = toConnector.getUniqueName();
+      }
+      toConnectors.add(toLinkName + " (" + toConnnectorName + ")");
+
       availabilities.add(String.valueOf(job.getEnabled()));
     }
 


Mime
View raw message