sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject sqoop git commit: SQOOP-2768: Sqoop2: Remove the notion of LinksBeans (Jarek Jarcec Cecho via Colin Ma)
Date Thu, 14 Jan 2016 05:34:33 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 11d3973b9 -> 7b158d51e


SQOOP-2768: Sqoop2: Remove the notion of LinksBeans
 (Jarek Jarcec Cecho via Colin Ma)


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

Branch: refs/heads/sqoop2
Commit: 7b158d51ee7e3063402c04b6be20eb999b058dbc
Parents: 11d3973
Author: Colin Ma <colin@apache.org>
Authored: Thu Jan 14 14:24:47 2016 +0800
Committer: Colin Ma <colin@apache.org>
Committed: Thu Jan 14 14:24:47 2016 +0800

----------------------------------------------------------------------
 .../client/request/LinkResourceRequest.java     |  3 +-
 .../java/org/apache/sqoop/json/LinkBean.java    | 29 +++---
 .../java/org/apache/sqoop/json/LinksBean.java   | 61 ------------
 .../org/apache/sqoop/json/TestLinkBean.java     | 68 +++++++++++++-
 .../org/apache/sqoop/json/TestLinksBean.java    | 98 --------------------
 .../sqoop/handler/LinkRequestHandler.java       | 17 +---
 .../tools/RepositoryDumpLoadToolTest.java       |  4 +-
 .../sqoop/tools/tool/RepositoryDumpTool.java    |  4 +-
 .../sqoop/tools/tool/RepositoryLoadTool.java    |  4 +-
 9 files changed, 88 insertions(+), 200 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
b/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
index 2b19dac..bf674df 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/LinkResourceRequest.java
@@ -20,7 +20,6 @@ package org.apache.sqoop.client.request;
 import org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticatedURL;
 import org.apache.sqoop.json.JSONUtils;
 import org.apache.sqoop.json.LinkBean;
-import org.apache.sqoop.json.LinksBean;
 import org.apache.sqoop.json.ValidationResultBean;
 import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.utils.UrlSafeUtils;
@@ -54,7 +53,7 @@ public class LinkResourceRequest extends ResourceRequest {
     }
     JSONObject jsonObject = JSONUtils.parse(response);
     // defaults to all
-    LinkBean bean = new LinksBean();
+    LinkBean bean = new LinkBean();
     if (linkArg != null) {
       bean = new LinkBean();
     }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/common/src/main/java/org/apache/sqoop/json/LinkBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/LinkBean.java b/common/src/main/java/org/apache/sqoop/json/LinkBean.java
index 8ce8b2b..57a37e5 100644
--- a/common/src/main/java/org/apache/sqoop/json/LinkBean.java
+++ b/common/src/main/java/org/apache/sqoop/json/LinkBean.java
@@ -49,7 +49,7 @@ public class LinkBean implements JsonBean {
 
   static final String CONNECTOR_NAME = "connector-name";
   static final String LINK_CONFIG_VALUES = "link-config-values";
-  static final String LINK = "link";
+  static final String LINKS = "links";
 
 
   // Required
@@ -62,10 +62,9 @@ public class LinkBean implements JsonBean {
   // For "extract"
   public LinkBean(MLink link) {
     this();
-    this.links = new ArrayList<MLink>();
+    this.links = new ArrayList<>();
     this.links.add(link);
   }
-
   public LinkBean(List<MLink> links) {
     this();
     this.links = links;
@@ -73,7 +72,7 @@ public class LinkBean implements JsonBean {
 
   // For "restore"
   public LinkBean() {
-    linkConfigBundles = new HashMap<String, ResourceBundle>();
+    linkConfigBundles = new HashMap<>();
   }
 
   public void addConnectorConfigBundle(String connectorName, ResourceBundle connectorConfigBundle)
{
@@ -95,9 +94,16 @@ public class LinkBean implements JsonBean {
   @SuppressWarnings("unchecked")
   @Override
   public JSONObject extract(boolean skipSensitive) {
-    JSONObject link = new JSONObject();
-    link.put(LINK, extractLink(skipSensitive, links.get(0)));
-    return link;
+    JSONArray linkArray = extractLinks(skipSensitive);
+    JSONObject links = new JSONObject();
+    links.put(LINKS, linkArray);
+    return links;
+  }
+
+  @Override
+  public void restore(JSONObject jsonObject) {
+    JSONArray array = JSONUtils.getJSONArray(jsonObject, LINKS);
+    restoreLinks(array);
   }
 
   @SuppressWarnings("unchecked")
@@ -125,15 +131,8 @@ public class LinkBean implements JsonBean {
     return linkJsonObject;
   }
 
-  @Override
-  public void restore(JSONObject jsonObject) {
-    links = new ArrayList<MLink>();
-    JSONObject obj = JSONUtils.getJSONObject(jsonObject, LINK);
-    links.add(restoreLink(obj));
-  }
-
   protected void restoreLinks(JSONArray array) {
-    links = new ArrayList<MLink>();
+    links = new ArrayList<>();
     for (Object obj : array) {
       links.add(restoreLink(obj));
     }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/common/src/main/java/org/apache/sqoop/json/LinksBean.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/LinksBean.java b/common/src/main/java/org/apache/sqoop/json/LinksBean.java
deleted file mode 100644
index 87e873d..0000000
--- a/common/src/main/java/org/apache/sqoop/json/LinksBean.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.json;
-
-import java.util.List;
-
-import org.apache.sqoop.classification.InterfaceAudience;
-import org.apache.sqoop.classification.InterfaceStability;
-import org.apache.sqoop.model.MLink;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-
-@InterfaceAudience.Private
-@InterfaceStability.Unstable
-public class LinksBean extends LinkBean {
-
-  static final String LINKS = "links";
-
-  public LinksBean(MLink link) {
-    super(link);
-  }
-
-  public LinksBean(List<MLink> links) {
-    super(links);
-  }
-
-  // For "restore"
-  public LinksBean() {
-
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public JSONObject extract(boolean skipSensitive) {
-    JSONArray linkArray = extractLinks(skipSensitive);
-    JSONObject links = new JSONObject();
-    links.put(LINKS, linkArray);
-    return links;
-  }
-
-  @Override
-  public void restore(JSONObject jsonObject) {
-    JSONArray array = JSONUtils.getJSONArray(jsonObject, LINKS);
-    super.restoreLinks(array);
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/common/src/test/java/org/apache/sqoop/json/TestLinkBean.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/json/TestLinkBean.java b/common/src/test/java/org/apache/sqoop/json/TestLinkBean.java
index 0df0f9d..9523f24 100644
--- a/common/src/test/java/org/apache/sqoop/json/TestLinkBean.java
+++ b/common/src/test/java/org/apache/sqoop/json/TestLinkBean.java
@@ -22,6 +22,7 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -52,7 +53,7 @@ public class TestLinkBean {
     JSONObject json = linkBean.extract(false);
 
     // Check for sensitivity
-    JSONObject linkObj = (JSONObject) json.get(LinkBean.LINK);
+    JSONObject linkObj = (JSONObject)((JSONArray) json.get(LinkBean.LINKS)).get(0);
     JSONObject linkConfigList = (JSONObject) linkObj.get(LinkBean.LINK_CONFIG_VALUES);
     JSONArray linkConfigs = (JSONArray) linkConfigList.get(ConfigInputConstants.CONFIGS);
     List<MValidator> linkValidators = restoreValidator((JSONArray)
@@ -108,7 +109,7 @@ public class TestLinkBean {
     JSONObject jsonFiltered = bean.extract(true);
 
     // Sensitive values should exist
-    JSONObject linkObj = (JSONObject) json.get(LinkBean.LINK);
+    JSONObject linkObj = (JSONObject)((JSONArray) json.get(LinkBean.LINKS)).get(0);
     JSONObject linkConfigList = (JSONObject) linkObj.get(LinkBean.LINK_CONFIG_VALUES);
     JSONArray linkConfigs = (JSONArray) linkConfigList.get(ConfigInputConstants.CONFIGS);
     JSONObject linkConfigObj = (JSONObject) linkConfigs.get(0);
@@ -119,7 +120,7 @@ public class TestLinkBean {
     assertTrue(password.containsKey(ConfigInputConstants.CONFIG_INPUT_VALUE));
 
     // Sensitive values should not exist
-    linkObj = (JSONObject) jsonFiltered.get(LinkBean.LINK);
+    linkObj = (JSONObject)((JSONArray) jsonFiltered.get(LinkBean.LINKS)).get(0);
     linkConfigList = (JSONObject) linkObj.get(LinkBean.LINK_CONFIG_VALUES);
     linkConfigs = (JSONArray) linkConfigList.get(ConfigInputConstants.CONFIGS);
     linkConfigObj = (JSONObject) linkConfigs.get(0);
@@ -129,4 +130,65 @@ public class TestLinkBean {
     password = (JSONObject) inputs.get(2);
     assertFalse(password.containsKey(ConfigInputConstants.CONFIG_INPUT_VALUE));
   }
+
+  @Test
+  public void testLinksSerialization() {
+    Date created = new Date();
+    Date updated = new Date();
+    MLink link1 = BeanTestUtil.createLink("ahoj", "link1", 666L, created, updated);
+    MLink link2 = BeanTestUtil.createLink("jhoa", "link2", 888L, created, updated);
+
+    List<MLink> links = new ArrayList<>();
+    links.add(link1);
+    links.add(link2);
+
+    // Fill some data at the beginning
+    MStringInput input = (MStringInput) link1.getConnectorLinkConfig().getConfigs().get(0)
+        .getInputs().get(0);
+    input.setValue("Hi there!");
+
+    // Serialize it to JSON object
+    LinkBean linkBean = new LinkBean(links);
+    JSONObject json = linkBean.extract(false);
+
+    // Check for sensitivity
+    JSONArray linksObj = (JSONArray) json.get(LinkBean.LINKS);
+    JSONObject linkObj = (JSONObject) linksObj.get(0);
+
+    JSONObject linkConfigList = (JSONObject) linkObj.get(LinkBean.LINK_CONFIG_VALUES);
+    JSONArray linkConfigs = (JSONArray) linkConfigList.get(ConfigInputConstants.CONFIGS);
+    JSONObject linkConfig = (JSONObject) linkConfigs.get(0);
+    JSONArray inputs = (JSONArray) linkConfig.get(ConfigInputConstants.CONFIG_INPUTS);
+    for (Object inp : inputs) {
+      assertTrue(((JSONObject) inp).containsKey(ConfigInputConstants.CONFIG_INPUT_SENSITIVE));
+    }
+
+    // "Move" it across network in text form
+    String linkJsonString = json.toJSONString();
+
+    // Retrieved transferred object
+    JSONObject parsedLinkJson = JSONUtils.parse(linkJsonString);
+    LinkBean retrievedBean = new LinkBean();
+    retrievedBean.restore(parsedLinkJson);
+    MLink targetLink1 = retrievedBean.getLinks().get(0);
+    MLink targetLink2 = retrievedBean.getLinks().get(1);
+
+    // Check id and name
+    assertEquals(666L, targetLink1.getPersistenceId());
+    assertEquals(888L, targetLink2.getPersistenceId());
+
+    assertEquals("link1", targetLink1.getName());
+    assertEquals("link2", targetLink2.getName());
+
+    assertEquals("admin", targetLink1.getCreationUser());
+    assertEquals(created, targetLink1.getCreationDate());
+    assertEquals("user", targetLink1.getLastUpdateUser());
+    assertEquals(updated, targetLink1.getLastUpdateDate());
+    assertEquals(false, targetLink1.getEnabled());
+
+    // Test that value was correctly moved
+    MStringInput targetInput = (MStringInput) targetLink1.getConnectorLinkConfig().getConfigs()
+        .get(0).getInputs().get(0);
+    assertEquals("Hi there!", targetInput.getValue());
+  }
 }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/common/src/test/java/org/apache/sqoop/json/TestLinksBean.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/json/TestLinksBean.java b/common/src/test/java/org/apache/sqoop/json/TestLinksBean.java
deleted file mode 100644
index 0ee29fa..0000000
--- a/common/src/test/java/org/apache/sqoop/json/TestLinksBean.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sqoop.json;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.sqoop.json.util.BeanTestUtil;
-import org.apache.sqoop.json.util.ConfigInputConstants;
-import org.apache.sqoop.model.MLink;
-import org.apache.sqoop.model.MStringInput;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.testng.annotations.Test;
-
-public class TestLinksBean {
-
-  @Test
-  public void testLinksSerialization() {
-    Date created = new Date();
-    Date updated = new Date();
-    MLink link1 = BeanTestUtil.createLink("ahoj", "link1", 666L, created, updated);
-    MLink link2 = BeanTestUtil.createLink("jhoa", "link2", 888L, created, updated);
-
-    List<MLink> links = new ArrayList<MLink>();
-    links.add(link1);
-    links.add(link2);
-
-    // Fill some data at the beginning
-    MStringInput input = (MStringInput) link1.getConnectorLinkConfig().getConfigs().get(0)
-        .getInputs().get(0);
-    input.setValue("Hi there!");
-
-    // Serialize it to JSON object
-    LinksBean linkBean = new LinksBean(links);
-    JSONObject json = linkBean.extract(false);
-
-    // Check for sensitivity
-    JSONArray linksObj = (JSONArray) json.get(LinksBean.LINKS);
-    JSONObject linkObj = (JSONObject) linksObj.get(0);
-
-    JSONObject linkConfigList = (JSONObject) linkObj.get(LinkBean.LINK_CONFIG_VALUES);
-    JSONArray linkConfigs = (JSONArray) linkConfigList.get(ConfigInputConstants.CONFIGS);
-    JSONObject linkConfig = (JSONObject) linkConfigs.get(0);
-    JSONArray inputs = (JSONArray) linkConfig.get(ConfigInputConstants.CONFIG_INPUTS);
-    for (Object inp : inputs) {
-      assertTrue(((JSONObject) inp).containsKey(ConfigInputConstants.CONFIG_INPUT_SENSITIVE));
-    }
-
-    // "Move" it across network in text form
-    String linkJsonString = json.toJSONString();
-
-    // Retrieved transferred object
-    JSONObject parsedLinkJson = JSONUtils.parse(linkJsonString);
-    LinksBean retrievedBean = new LinksBean();
-    retrievedBean.restore(parsedLinkJson);
-    MLink targetLink1 = retrievedBean.getLinks().get(0);
-    MLink targetLink2 = retrievedBean.getLinks().get(1);
-
-    // Check id and name
-    assertEquals(666L, targetLink1.getPersistenceId());
-    assertEquals(888L, targetLink2.getPersistenceId());
-
-    assertEquals("link1", targetLink1.getName());
-    assertEquals("link2", targetLink2.getName());
-
-    assertEquals("admin", targetLink1.getCreationUser());
-    assertEquals(created, targetLink1.getCreationDate());
-    assertEquals("user", targetLink1.getLastUpdateUser());
-    assertEquals(updated, targetLink1.getLastUpdateDate());
-    assertEquals(false, targetLink1.getEnabled());
-
-    // Test that value was correctly moved
-    MStringInput targetInput = (MStringInput) targetLink1.getConnectorLinkConfig().getConfigs()
-        .get(0).getInputs().get(0);
-    assertEquals("Hi there!", targetInput.getValue());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
index 9f6ed90..7d7f1de 100644
--- a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
@@ -31,7 +31,6 @@ import org.apache.sqoop.connector.spi.SqoopConnector;
 import org.apache.sqoop.json.JSONUtils;
 import org.apache.sqoop.json.JsonBean;
 import org.apache.sqoop.json.LinkBean;
-import org.apache.sqoop.json.LinksBean;
 import org.apache.sqoop.json.ValidationResultBean;
 import org.apache.sqoop.model.*;
 import org.apache.sqoop.repository.Repository;
@@ -189,7 +188,6 @@ public class LinkRequestHandler implements RequestHandler {
 
   private JsonBean getLinks(RequestContext ctx) {
     String linkName = ctx.getLastURLElement();
-    LinkBean linkBean;
     List<MLink> links;
     Locale locale = ctx.getAcceptLanguageHeader();
     Repository repository = RepositoryManager.getInstance().getRepository();
@@ -216,13 +214,8 @@ public class LinkRequestHandler implements RequestHandler {
     // Authorization check
     links = AuthorizationEngine.filterResource(ctx.getUserName(), MResource.TYPE.LINK, links);
 
-    // Return bean entity (we have to separate what we're returning here)
-    if(linkName.equals("all")) {
-      linkBean = createLinksBean(links, locale);
-    } else {
-      linkBean = createLinkBean(links, locale);
-    }
-    return linkBean;
+    // And return resulting links
+    return createLinkBean(links, locale);
   }
 
   private LinkBean createLinkBean(List<MLink> links, Locale locale) {
@@ -231,12 +224,6 @@ public class LinkRequestHandler implements RequestHandler {
     return linkBean;
   }
 
-  private LinksBean createLinksBean(List<MLink> links, Locale locale) {
-    LinksBean linksBean = new LinksBean(links);
-    addConnectorConfigBundle(locale, linksBean);
-    return linksBean;
-  }
-
   private void addConnectorConfigBundle(Locale locale, LinkBean bean) {
     // Add associated resources into the bean
     for (MLink link : bean.getLinks()) {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java
b/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java
index cce2c6c..5f346ae 100644
--- a/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java
+++ b/test/src/test/java/org/apache/sqoop/integration/tools/RepositoryDumpLoadToolTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.sqoop.common.VersionInfo;
 import org.apache.sqoop.json.JSONUtils;
 import org.apache.sqoop.json.JobsBean;
-import org.apache.sqoop.json.LinksBean;
+import org.apache.sqoop.json.LinkBean;
 import org.apache.sqoop.json.SubmissionsBean;
 import org.apache.sqoop.model.*;
 import org.apache.sqoop.submission.SubmissionStatus;
@@ -69,7 +69,7 @@ public class RepositoryDumpLoadToolTest extends SqoopTestCase {
 
       // verify the links
       JSONObject jsonLinks = (JSONObject) json.get(JSONConstants.LINKS);
-      LinksBean linksBean = new LinksBean();
+      LinkBean linksBean = new LinkBean();
       linksBean.restore(jsonLinks);
       verifyLinks(linksBean.getLinks());
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryDumpTool.java
----------------------------------------------------------------------
diff --git a/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryDumpTool.java b/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryDumpTool.java
index a3d490c..18f48c7 100644
--- a/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryDumpTool.java
+++ b/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryDumpTool.java
@@ -34,7 +34,7 @@ import org.apache.sqoop.cli.SqoopGnuParser;
 import org.apache.sqoop.common.VersionInfo;
 import org.apache.sqoop.connector.ConnectorManager;
 import org.apache.sqoop.json.JobsBean;
-import org.apache.sqoop.json.LinksBean;
+import org.apache.sqoop.json.LinkBean;
 import org.apache.sqoop.json.SubmissionsBean;
 import org.apache.sqoop.model.MLink;
 import org.apache.sqoop.repository.Repository;
@@ -107,7 +107,7 @@ public class RepositoryDumpTool extends ConfiguredTool {
 
     LOG.info("Dumping Links with skipSensitive=" + String.valueOf(skipSensitive));
     List<MLink> links = repository.findLinks();
-    LinksBean linkBeans = new LinksBean(links);
+    LinkBean linkBeans = new LinkBean(links);
     JSONObject linksJsonObject = linkBeans.extract(skipSensitive);
     result.put(JSONConstants.LINKS, linksJsonObject);
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/7b158d51/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryLoadTool.java
----------------------------------------------------------------------
diff --git a/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryLoadTool.java b/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryLoadTool.java
index 75ef74d..34d1ab2 100644
--- a/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryLoadTool.java
+++ b/tools/src/main/java/org/apache/sqoop/tools/tool/RepositoryLoadTool.java
@@ -42,7 +42,7 @@ import org.apache.sqoop.driver.Driver;
 import org.apache.sqoop.driver.DriverUpgrader;
 import org.apache.sqoop.json.JSONUtils;
 import org.apache.sqoop.json.JobsBean;
-import org.apache.sqoop.json.LinksBean;
+import org.apache.sqoop.json.LinkBean;
 import org.apache.sqoop.json.SubmissionsBean;
 import org.apache.sqoop.model.ConfigUtils;
 import org.apache.sqoop.model.MConfig;
@@ -149,7 +149,7 @@ public class RepositoryLoadTool extends ConfiguredTool {
             (JSONArray) jsonLinks.get(JSONConstants.LINKS),
             JSONConstants.CONNECTOR_NAME, true);
 
-    LinksBean linksBean = new LinksBean();
+    LinkBean linksBean = new LinkBean();
     linksBean.restore(jsonLinks);
 
     for (MLink link : linksBean.getLinks()) {


Mime
View raw message