atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suma...@apache.org
Subject incubator-atlas git commit: ATLAS-1108: updated references to atlas.rest.address to handle multiple URLs
Date Fri, 12 Aug 2016 05:57:52 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master 531a9684f -> 7f2a40864


ATLAS-1108: updated references to atlas.rest.address to handle multiple URLs


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

Branch: refs/heads/master
Commit: 7f2a40864df223cde3b1292961b40ebbeaec4267
Parents: 531a968
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Thu Aug 11 13:19:22 2016 -0700
Committer: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Committed: Thu Aug 11 22:00:14 2016 -0700

----------------------------------------------------------------------
 .../apache/atlas/falcon/hook/FalconHookIT.java  |  4 ++--
 .../atlas/hive/bridge/HiveMetaStoreBridge.java  |  4 ++--
 .../java/org/apache/atlas/hive/HiveITBase.java  | 10 +++++++--
 .../apache/atlas/sqoop/hook/SqoopHookIT.java    |  4 ++--
 .../atlas/storm/hook/StormAtlasHookIT.java      |  4 ++--
 .../java/org/apache/atlas/AtlasAdminClient.java | 13 +++++++-----
 release-log.txt                                 |  1 +
 .../org/apache/atlas/examples/QuickStart.java   | 22 +++++++++-----------
 .../atlas/web/resources/BaseResourceIT.java     | 15 ++++++-------
 .../web/resources/EntityJerseyResourceIT.java   |  5 ++---
 10 files changed, 45 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
----------------------------------------------------------------------
diff --git a/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
b/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
index 0ce7ecb..31b70fd 100644
--- a/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
+++ b/addons/falcon-bridge/src/test/java/org/apache/atlas/falcon/hook/FalconHookIT.java
@@ -76,9 +76,9 @@ public class FalconHookIT {
     public void setUp() throws Exception {
         Configuration atlasProperties = ApplicationProperties.get();
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            atlasClient = new AtlasClient(new String[]{atlasProperties.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT)},
new String[]{"admin", "admin"});
+            atlasClient = new AtlasClient(atlasProperties.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT),
new String[]{"admin", "admin"});
         } else {
-            atlasClient = new AtlasClient(atlasProperties.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT));
+            atlasClient = new AtlasClient(atlasProperties.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT));
         }
 
         AtlasService service = new AtlasService();

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
index ae969e1..1f13d74 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
@@ -635,8 +635,8 @@ public class HiveMetaStoreBridge {
 
         Configuration atlasConf = ApplicationProperties.get();
         String[] atlasEndpoint = atlasConf.getStringArray(ATLAS_ENDPOINT);
-        if (atlasEndpoint == null){
-            atlasEndpoint = new String[]{DEFAULT_DGI_URL};
+        if (atlasEndpoint == null || atlasEndpoint.length == 0){
+            atlasEndpoint = new String[] { DEFAULT_DGI_URL };
         }
         AtlasClient atlasClient;
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index e3dc1ad..bc3312d 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -80,10 +80,16 @@ public class HiveITBase {
         SessionState.setCurrentSessionState(ss);
 
         Configuration configuration = ApplicationProperties.get();
+
+        String[] atlasEndPoint = configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT);
+        if (atlasEndPoint == null || atlasEndPoint.length == 0) {
+            atlasEndPoint = new String[] { DGI_URL };
+        }
+
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            atlasClient = new AtlasClient(new String[]{configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT,
DGI_URL)}, new String[]{"admin", "admin"});
+            atlasClient = new AtlasClient(atlasEndPoint, new String[]{"admin", "admin"});
         } else {
-            atlasClient = new AtlasClient(configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT,
DGI_URL));
+            atlasClient = new AtlasClient(atlasEndPoint);
         }
 
         hiveMetaStoreBridge = new HiveMetaStoreBridge(configuration, conf, atlasClient);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/addons/sqoop-bridge/src/test/java/org/apache/atlas/sqoop/hook/SqoopHookIT.java
----------------------------------------------------------------------
diff --git a/addons/sqoop-bridge/src/test/java/org/apache/atlas/sqoop/hook/SqoopHookIT.java
b/addons/sqoop-bridge/src/test/java/org/apache/atlas/sqoop/hook/SqoopHookIT.java
index 2a5bf9b..772f1b2 100644
--- a/addons/sqoop-bridge/src/test/java/org/apache/atlas/sqoop/hook/SqoopHookIT.java
+++ b/addons/sqoop-bridge/src/test/java/org/apache/atlas/sqoop/hook/SqoopHookIT.java
@@ -50,9 +50,9 @@ public class SqoopHookIT {
         //Set-up sqoop session
         Configuration configuration = ApplicationProperties.get();
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            atlasClient = new AtlasClient(new String[]{configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT)},
new String[]{"admin", "admin"});
+            atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT),
new String[]{"admin", "admin"});
         } else {
-            atlasClient = new AtlasClient(configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT));
+            atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT));
         }
         registerDataModels(atlasClient);
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
----------------------------------------------------------------------
diff --git a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
index d3beb63..fe4c001 100644
--- a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
+++ b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
@@ -63,9 +63,9 @@ public class StormAtlasHookIT {
 
         Configuration configuration = ApplicationProperties.get();
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            atlasClient = new AtlasClient(new String[]{configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT)},
new String[]{"admin", "admin"});
+            atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT),
new String[]{"admin", "admin"});
         } else {
-            atlasClient = new AtlasClient(configuration.getString(HiveMetaStoreBridge.ATLAS_ENDPOINT));
+            atlasClient = new AtlasClient(configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT));
         }
         registerDataModel(new HiveDataModelGenerator());
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/client/src/main/java/org/apache/atlas/AtlasAdminClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/atlas/AtlasAdminClient.java b/client/src/main/java/org/apache/atlas/AtlasAdminClient.java
index 1fbfc85..63e9213 100644
--- a/client/src/main/java/org/apache/atlas/AtlasAdminClient.java
+++ b/client/src/main/java/org/apache/atlas/AtlasAdminClient.java
@@ -60,20 +60,23 @@ public class AtlasAdminClient {
     private int run(String[] args) throws AtlasException {
         CommandLine commandLine = parseCommandLineOptions(args);
         Configuration configuration = ApplicationProperties.get();
-        String atlasServerUri = configuration.getString(
-                AtlasConstants.ATLAS_REST_ADDRESS_KEY, AtlasConstants.DEFAULT_ATLAS_REST_ADDRESS);
+        String[] atlasServerUri = configuration.getStringArray(AtlasConstants.ATLAS_REST_ADDRESS_KEY);
+
+        if (atlasServerUri == null || atlasServerUri.length == 0) {
+            atlasServerUri = new String[] { AtlasConstants.DEFAULT_ATLAS_REST_ADDRESS };
+        }
 
         AtlasClient atlasClient = null;
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
             String[] basicAuthUsernamePassword = AuthenticationUtil.getBasicAuthenticationInput();
-            atlasClient = new AtlasClient(new String[]{atlasServerUri}, basicAuthUsernamePassword);
+            atlasClient = new AtlasClient(atlasServerUri, basicAuthUsernamePassword);
         } else {
-            atlasClient = new AtlasClient(atlasServerUri, null, null);
+            atlasClient = new AtlasClient(atlasServerUri, null);
         }
         return handleCommand(commandLine, atlasServerUri, atlasClient);
     }
 
-    private int handleCommand(CommandLine commandLine, String atlasServerUri, AtlasClient
atlasClient) {
+    private int handleCommand(CommandLine commandLine, String[] atlasServerUri, AtlasClient
atlasClient) {
         int cmdStatus = PROGRAM_ERROR_STATUS;
         if (commandLine.hasOption(STATUS.getOpt())) {
             try {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 73c44ea..10667ad 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 ATLAS-1060 Add composite indexes for exact match performance improvements for all attributes
(sumasai via shwethags)
 
 ALL CHANGES:
+ATLAS-1115 Show Tag / Taxonomy Listing in sorted order (Kalyanikashikar via sumasai)
 ATLAS-1117 Atlas start fails on trunk (jnhagelb via dkantor)
 ATLAS-1112 Hive table GET response from atlas server had duplicate column entries ( ayubkhan,
mneethiraj via sumasai)
 ATLAS-1108 In Atlas HA mode , import-hive.sh in Passive instance fails. (ayubkhan via sumasai)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/webapp/src/main/java/org/apache/atlas/examples/QuickStart.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/examples/QuickStart.java b/webapp/src/main/java/org/apache/atlas/examples/QuickStart.java
index 2426f63..8322bc6 100755
--- a/webapp/src/main/java/org/apache/atlas/examples/QuickStart.java
+++ b/webapp/src/main/java/org/apache/atlas/examples/QuickStart.java
@@ -81,13 +81,13 @@ public class QuickStart {
 
     @VisibleForTesting
     static void runQuickstart(String[] args, String[] basicAuthUsernamePassword) throws Exception
{
-        String baseUrl = getServerUrl(args);
+        String[] urls = getServerUrl(args);
         QuickStart quickStart;
 
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            quickStart = new QuickStart(baseUrl, basicAuthUsernamePassword);
+            quickStart = new QuickStart(urls, basicAuthUsernamePassword);
         } else {
-            quickStart = new QuickStart(baseUrl);
+            quickStart = new QuickStart(urls);
         }
 
         // Shows how to create types in Atlas for your meta model
@@ -100,19 +100,19 @@ public class QuickStart {
         quickStart.search();
     }
 
-    static String getServerUrl(String[] args) throws AtlasException {
+    static String[] getServerUrl(String[] args) throws AtlasException {
         if (args.length > 0) {
-            return args[0];
+            return args[0].split(",");
         }
 
         Configuration configuration = ApplicationProperties.get();
-        String baseUrl = configuration.getString(ATLAS_REST_ADDRESS);
-        if (baseUrl == null) {
+        String[] urls = configuration.getStringArray(ATLAS_REST_ADDRESS);
+        if (urls == null || urls.length == 0) {
             System.out.println("Usage: quick_start.py <atlas endpoint of format <http/https>://<atlas-fqdn>:<atlas
port> like http://localhost:21000>");
             System.exit(-1);
         }
 
-        return baseUrl;
+        return urls;
     }
 
     static final String DATABASE_TYPE = "DB";
@@ -128,13 +128,11 @@ public class QuickStart {
 
     private final AtlasClient metadataServiceClient;
 
-    QuickStart(String baseUrl,String[] basicAuthUsernamePassword) {
-        String[] urls = baseUrl.split(",");
+    QuickStart(String[] urls,String[] basicAuthUsernamePassword) {
         metadataServiceClient = new AtlasClient(urls,basicAuthUsernamePassword);
     }
 
-    QuickStart(String baseUrl) throws AtlasException {
-        String[] urls = baseUrl.split(",");
+    QuickStart(String[] urls) throws AtlasException {
         metadataServiceClient = new AtlasClient(urls);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java
index aa69556..0238b95 100755
--- a/webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/resources/BaseResourceIT.java
@@ -21,9 +21,7 @@ package org.apache.atlas.web.resources;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
-import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
 import kafka.consumer.ConsumerTimeoutException;
 import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.AtlasClient;
@@ -58,7 +56,6 @@ import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 
-import javax.ws.rs.core.UriBuilder;
 import java.util.List;
 
 /**
@@ -72,18 +69,22 @@ public abstract class BaseResourceIT {
     protected AtlasClient serviceClient;
     public static final Logger LOG = LoggerFactory.getLogger(BaseResourceIT.class);
     protected static final int MAX_WAIT_TIME = 60000;
-    protected String baseUrl;
+    protected String[] atlasUrls;
 
     @BeforeClass
     public void setUp() throws Exception {
 
         Configuration configuration = ApplicationProperties.get();
-        baseUrl = configuration.getString(ATLAS_REST_ADDRESS, "http://localhost:21000/");
+        atlasUrls = configuration.getStringArray(ATLAS_REST_ADDRESS);
+
+        if (atlasUrls == null || atlasUrls.length == 0) {
+            atlasUrls = new String[] { "http://localhost:21000/" };
+        }
 
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            serviceClient = new AtlasClient(new String[]{baseUrl}, new String[]{"admin",
"admin"});
+            serviceClient = new AtlasClient(atlasUrls, new String[]{"admin", "admin"});
         } else {
-            serviceClient = new AtlasClient(baseUrl);
+            serviceClient = new AtlasClient(atlasUrls);
         }
         service = serviceClient.getResource();
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7f2a4086/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
b/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
index 0b49148..a1988ef 100755
--- a/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/resources/EntityJerseyResourceIT.java
@@ -50,7 +50,6 @@ import org.apache.atlas.typesystem.types.TraitType;
 import org.apache.atlas.typesystem.types.utils.TypesUtil;
 import org.apache.atlas.web.util.Servlets;
 import org.apache.commons.lang.RandomStringUtils;
-import org.apache.hadoop.security.UserGroupInformation;
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
@@ -131,9 +130,9 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
         String user = "admin";
         AtlasClient localClient = null;
         if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-            localClient = new AtlasClient(new String[]{baseUrl}, new String[]{"admin", "admin"});
+            localClient = new AtlasClient(atlasUrls, new String[]{"admin", "admin"});
         } else {
-            localClient = new AtlasClient(baseUrl);
+            localClient = new AtlasClient(atlasUrls);
         }
         String entityId = localClient.createEntity(entity).get(0);
 


Mime
View raw message