atlas git commit: ATLAS-2874: Include handling of Atlas Entity Transformers in current Import logic

2018-09-17 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 6b953b59c -> dc5ebabe1


ATLAS-2874: Include handling of Atlas Entity Transformers in current Import 
logic


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

Branch: refs/heads/branch-0.8
Commit: dc5ebabe1e55df389d9fb7c206fc22f18f93f9cc
Parents: 6b953b5
Author: Sarath Subramanian 
Authored: Mon Sep 17 21:57:40 2018 -0700
Committer: Sarath Subramanian 
Committed: Mon Sep 17 21:57:40 2018 -0700

--
 .../atlas/model/impexp/AtlasImportRequest.java  |  1 +
 .../atlas/repository/impexp/ImportService.java  | 50 +--
 .../atlas/repository/impexp/ZipSource.java  | 51 
 3 files changed, 89 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/dc5ebabe/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java 
b/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
index f56fe22..aa5fe00 100644
--- a/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
+++ b/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
@@ -38,6 +38,7 @@ public class AtlasImportRequest implements Serializable {
 private static final long   serialVersionUID = 1L;
 
 public  static final String TRANSFORMS_KEY = "transforms";
+public  static final String TRANSFORMERS_KEY   = "transformers";
 public  static final String OPTION_KEY_REPLICATED_FROM = "replicatedFrom";
 private static final String START_POSITION_KEY = "startPosition";
 private static final String START_GUID_KEY = "startGuid";

http://git-wip-us.apache.org/repos/asf/atlas/blob/dc5ebabe/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
index a88ba2b..a09385e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
@@ -19,15 +19,17 @@ package org.apache.atlas.repository.impexp;
 
 import com.google.common.annotations.VisibleForTesting;
 import org.apache.atlas.AtlasErrorCode;
+import org.apache.atlas.entitytransform.BaseEntityHandler;
 import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.model.impexp.AtlasImportRequest;
 import org.apache.atlas.model.impexp.AtlasImportResult;
+import org.apache.atlas.model.impexp.AttributeTransform;
 import org.apache.atlas.model.typedef.AtlasTypesDef;
 import org.apache.atlas.repository.store.graph.BulkImporter;
 import org.apache.atlas.store.AtlasTypeDefStore;
-import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.type.AtlasTypeRegistry;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -40,6 +42,11 @@ import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static 
org.apache.atlas.model.impexp.AtlasImportRequest.TRANSFORMERS_KEY;
+import static org.apache.atlas.model.impexp.AtlasImportRequest.TRANSFORMS_KEY;
 
 @Component
 public class ImportService {
@@ -82,9 +89,12 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
-String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(AtlasImportRequest.TRANSFORMS_KEY) : null;
-
+String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
+
+String transformers = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMERS_KEY) : null;
+setEntityTransformerHandlers(source, transformers);
+
 startTimestamp = System.currentTimeMillis();
 processTypes(source.getTypesDef(), result);
 setStartPosition(request, source);
@@ -121,6 +131,38 @@ public class ImportService {
 
  

atlas git commit: ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

2018-09-17 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 9e76ed2eb -> 042f5c2e7


ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit 6b953b59c4b1eb05ee4ddd2234b81cd98451ccc2)


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

Branch: refs/heads/branch-1.0
Commit: 042f5c2e7a6ab4b18ec0e114a9b324896e866e54
Parents: 9e76ed2
Author: Ashutosh Mestry 
Authored: Fri Sep 14 14:36:18 2018 -0700
Committer: Madhan Neethiraj 
Committed: Mon Sep 17 15:20:48 2018 -0700

--
 .../java/org/apache/atlas/hbase/HBaseAtlasHookIT.java |  4 ++--
 .../main/java/org/apache/atlas/AtlasBaseClient.java   |  2 +-
 .../org/apache/atlas/security/SecureClientUtils.java  |  7 +++
 .../java/org/apache/atlas/ApplicationProperties.java  | 14 --
 4 files changed, 18 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/042f5c2e/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
--
diff --git 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
index c0d0318..15bfbe3 100644
--- 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
+++ 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
@@ -148,7 +148,7 @@ public class HBaseAtlasHookIT {
 private void createAtlasClient() {
 try {
 org.apache.commons.configuration.Configuration configuration = 
ApplicationProperties.get();
-String[]   atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
+String[] atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
 
 configuration.setProperty("atlas.cluster.name", CLUSTER_NAME);
 
@@ -163,7 +163,7 @@ public class HBaseAtlasHookIT {
 }
 
 if (AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
null);
+atlasClient = new AtlasClientV2(atlasEndPoint);
 } else {
 atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
new String[]{"admin", "admin"});
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/042f5c2e/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
--
diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java 
b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
index 4464ade..7ca656d 100644
--- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
+++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
@@ -258,7 +258,7 @@ public abstract class AtlasBaseClient {
 // to create a
 // configuration object, persist it, then subsequently pass in an 
empty configuration to SSLFactory
 try {
-SecureClientUtils.persistSSLClientConfiguration(configuration);
+SecureClientUtils.persistSSLClientConfiguration(configuration, 
System.getProperty("atlas.conf") );
 } catch (Exception e) {
 LOG.info("Error processing client configuration.", e);
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/042f5c2e/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
--
diff --git 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
index d5392b2..550ef5a 100644
--- 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
+++ 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
@@ -163,8 +163,7 @@ public class SecureClientUtils {
 connection.setReadTimeout(socketTimeout);
 }
 
-private static File getSSLClientFile() throws AtlasException {
-String confLocation = System.getProperty("atlas.conf");
+private static File getSSLClientFile(String confLocation) throws 
AtlasException {
 File sslDir;
 try {
 if (confLocation == null) {
@@ -185,11 +184,11 @@ public class SecureClientUtils {
 return new File(sslDir, SecurityProperties.SSL_CLIENT_PROPERTIES);
 }
 
-

atlas git commit: ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

2018-09-17 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/master eae976187 -> 3176d1a1e


ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

Signed-off-by: Madhan Neethiraj 
(cherry picked from commit 6b953b59c4b1eb05ee4ddd2234b81cd98451ccc2)


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

Branch: refs/heads/master
Commit: 3176d1a1e4eab9916b7fa0498d8c5a99a7a1382d
Parents: eae9761
Author: Ashutosh Mestry 
Authored: Fri Sep 14 14:36:18 2018 -0700
Committer: Madhan Neethiraj 
Committed: Mon Sep 17 14:57:35 2018 -0700

--
 .../java/org/apache/atlas/hbase/HBaseAtlasHookIT.java |  4 ++--
 .../main/java/org/apache/atlas/AtlasBaseClient.java   |  2 +-
 .../org/apache/atlas/security/SecureClientUtils.java  |  7 +++
 .../java/org/apache/atlas/ApplicationProperties.java  | 14 --
 4 files changed, 18 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/3176d1a1/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
--
diff --git 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
index c0d0318..15bfbe3 100644
--- 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
+++ 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
@@ -148,7 +148,7 @@ public class HBaseAtlasHookIT {
 private void createAtlasClient() {
 try {
 org.apache.commons.configuration.Configuration configuration = 
ApplicationProperties.get();
-String[]   atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
+String[] atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
 
 configuration.setProperty("atlas.cluster.name", CLUSTER_NAME);
 
@@ -163,7 +163,7 @@ public class HBaseAtlasHookIT {
 }
 
 if (AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
null);
+atlasClient = new AtlasClientV2(atlasEndPoint);
 } else {
 atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
new String[]{"admin", "admin"});
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/3176d1a1/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
--
diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java 
b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
index 4464ade..7ca656d 100644
--- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
+++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
@@ -258,7 +258,7 @@ public abstract class AtlasBaseClient {
 // to create a
 // configuration object, persist it, then subsequently pass in an 
empty configuration to SSLFactory
 try {
-SecureClientUtils.persistSSLClientConfiguration(configuration);
+SecureClientUtils.persistSSLClientConfiguration(configuration, 
System.getProperty("atlas.conf") );
 } catch (Exception e) {
 LOG.info("Error processing client configuration.", e);
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/3176d1a1/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
--
diff --git 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
index d5392b2..550ef5a 100644
--- 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
+++ 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
@@ -163,8 +163,7 @@ public class SecureClientUtils {
 connection.setReadTimeout(socketTimeout);
 }
 
-private static File getSSLClientFile() throws AtlasException {
-String confLocation = System.getProperty("atlas.conf");
+private static File getSSLClientFile(String confLocation) throws 
AtlasException {
 File sslDir;
 try {
 if (confLocation == null) {
@@ -185,11 +184,11 @@ public class SecureClientUtils {
 return new File(sslDir, SecurityProperties.SSL_CLIENT_PROPERTIES);
 }
 
-public 

atlas git commit: ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

2018-09-17 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 fb635ece9 -> 6b953b59c


ATLAS-2860: Remove dependency on atlas-application.properties for AtlasClient.

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/branch-0.8
Commit: 6b953b59c4b1eb05ee4ddd2234b81cd98451ccc2
Parents: fb635ec
Author: Ashutosh Mestry 
Authored: Fri Sep 14 14:36:18 2018 -0700
Committer: Madhan Neethiraj 
Committed: Mon Sep 17 14:40:14 2018 -0700

--
 .../java/org/apache/atlas/hbase/HBaseAtlasHookIT.java |  4 ++--
 .../main/java/org/apache/atlas/AtlasBaseClient.java   |  2 +-
 .../org/apache/atlas/security/SecureClientUtils.java  |  7 +++
 .../java/org/apache/atlas/ApplicationProperties.java  | 14 --
 4 files changed, 18 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/6b953b59/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
--
diff --git 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
index c0d0318..15bfbe3 100644
--- 
a/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
+++ 
b/addons/hbase-bridge/src/test/java/org/apache/atlas/hbase/HBaseAtlasHookIT.java
@@ -148,7 +148,7 @@ public class HBaseAtlasHookIT {
 private void createAtlasClient() {
 try {
 org.apache.commons.configuration.Configuration configuration = 
ApplicationProperties.get();
-String[]   atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
+String[] atlasEndPoint = 
configuration.getStringArray(HBaseAtlasHook.ATTR_ATLAS_ENDPOINT);
 
 configuration.setProperty("atlas.cluster.name", CLUSTER_NAME);
 
@@ -163,7 +163,7 @@ public class HBaseAtlasHookIT {
 }
 
 if (AuthenticationUtil.isKerberosAuthenticationEnabled()) {
-atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
null);
+atlasClient = new AtlasClientV2(atlasEndPoint);
 } else {
 atlasClient = new AtlasClientV2(configuration, atlasEndPoint, 
new String[]{"admin", "admin"});
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/6b953b59/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
--
diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java 
b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
index d6f767e..ad92191 100644
--- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
+++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
@@ -272,7 +272,7 @@ public abstract class AtlasBaseClient {
 // to create a
 // configuration object, persist it, then subsequently pass in an 
empty configuration to SSLFactory
 try {
-SecureClientUtils.persistSSLClientConfiguration(configuration);
+SecureClientUtils.persistSSLClientConfiguration(configuration, 
System.getProperty("atlas.conf") );
 } catch (Exception e) {
 LOG.info("Error processing client configuration.", e);
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/6b953b59/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
--
diff --git 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
index d5392b2..550ef5a 100644
--- 
a/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
+++ 
b/client/common/src/main/java/org/apache/atlas/security/SecureClientUtils.java
@@ -163,8 +163,7 @@ public class SecureClientUtils {
 connection.setReadTimeout(socketTimeout);
 }
 
-private static File getSSLClientFile() throws AtlasException {
-String confLocation = System.getProperty("atlas.conf");
+private static File getSSLClientFile(String confLocation) throws 
AtlasException {
 File sslDir;
 try {
 if (confLocation == null) {
@@ -185,11 +184,11 @@ public class SecureClientUtils {
 return new File(sslDir, SecurityProperties.SSL_CLIENT_PROPERTIES);
 }
 
-public static void