sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2386: Sqoop2: refactor code in HandlerUtils
Date Wed, 10 Jun 2015 04:04:45 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 bd89d02eb -> 99698deba


SQOOP-2386: Sqoop2: refactor code in HandlerUtils

(Dian Fu via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: 99698deba9f942244fbb416093f77b4b20c09f5e
Parents: bd89d02
Author: Abraham Elmahrek <abe@apache.org>
Authored: Wed Jun 10 07:03:54 2015 +0300
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Wed Jun 10 07:03:54 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/sqoop/handler/HandlerUtils.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/99698deb/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
index 93ff60b..718b9e6 100644
--- a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
+++ b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
@@ -19,6 +19,8 @@ package org.apache.sqoop.handler;
 
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.ConnectorManager;
+import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.repository.Repository;
 import org.apache.sqoop.server.common.ServerError;
 
@@ -29,8 +31,9 @@ public class HandlerUtils {
     // NOTE: jobId is a fallback for older sqoop clients if any, since we want
     // to primarily use unique jobNames
     long jobId;
-    if (repository.findJob(identifier) != null) {
-      jobId = repository.findJob(identifier).getPersistenceId();
+    MJob job = repository.findJob(identifier);
+    if (job != null) {
+      jobId = job.getPersistenceId();
     } else {
       try {
         jobId = Long.valueOf(identifier);
@@ -49,8 +52,9 @@ public class HandlerUtils {
     // NOTE: linkId is a fallback for older sqoop clients if any, since we want
     // to primarily use unique linkNames
     long linkId;
-    if (repository.findLink(identifier) != null) {
-      linkId = repository.findLink(identifier).getPersistenceId();
+    MLink link = repository.findLink(identifier);
+    if (link != null) {
+      linkId = link.getPersistenceId();
     } else {
       try {
         linkId = Long.valueOf(identifier);


Mime
View raw message