atlas git commit: ATLAS-2984: export should include type defintions of relationships referenced by entities

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 943e5c711 -> ee22f0b14


ATLAS-2984: export should include type defintions of relationships referenced 
by entities

(cherry picked from commit e4921452ebea5b338c07bbc6f886c44c8843f64b)


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

Branch: refs/heads/branch-1.0
Commit: ee22f0b140f04aa4339b1935f654a380f74e8fc4
Parents: 943e5c7
Author: Madhan Neethiraj 
Authored: Thu Nov 29 13:10:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 20:34:18 2018 -0800

--
 .../atlas/repository/impexp/ExportService.java  | 30 
 .../repository/impexp/ExportTypeProcessor.java  | 24 
 .../impexp/ImportTypeDefProcessor.java  |  1 +
 3 files changed, 55 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/ee22f0b1/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
index 3558d2a..5632520 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
@@ -32,6 +32,7 @@ import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
 import org.apache.atlas.model.typedef.AtlasClassificationDef;
 import org.apache.atlas.model.typedef.AtlasEntityDef;
 import org.apache.atlas.model.typedef.AtlasEnumDef;
+import org.apache.atlas.model.typedef.AtlasRelationshipDef;
 import org.apache.atlas.model.typedef.AtlasStructDef;
 import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef;
 import org.apache.atlas.model.typedef.AtlasTypesDef;
@@ -43,6 +44,7 @@ import org.apache.atlas.type.AtlasClassificationType;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasEnumType;
 import org.apache.atlas.type.AtlasMapType;
+import org.apache.atlas.type.AtlasRelationshipType;
 import org.apache.atlas.type.AtlasStructType;
 import org.apache.atlas.type.AtlasStructType.AtlasAttribute;
 import org.apache.atlas.type.AtlasType;
@@ -175,6 +177,12 @@ public class ExportService {
 
 typesDef.getEnumDefs().add(enumDef);
 }
+
+for (String relationshipType : context.relationshipTypes) {
+AtlasRelationshipDef relationshipDef = 
typeRegistry.getRelationshipDefByName(relationshipType);
+
+typesDef.getRelationshipDefs().add(relationshipDef);
+}
 }
 
 private AtlasExportResult.OperationStatus[] 
processItems(AtlasExportRequest request, ExportContext context) {
@@ -611,6 +619,8 @@ public class ExportService {
 addStructType((AtlasStructType)type, context);
 } else if (type instanceof AtlasEnumType) {
 addEnumType((AtlasEnumType)type, context);
+} else if (type instanceof AtlasRelationshipType) {
+addRelationshipType((AtlasRelationshipType)type, context);
 }
 }
 
@@ -619,6 +629,7 @@ public class ExportService {
 context.entityTypes.add(entityType.getTypeName());
 
 addAttributeTypes(entityType, context);
+addRelationshipTypes(entityType, context);
 
 if (CollectionUtils.isNotEmpty(entityType.getAllSuperTypes())) {
 for (String superType : entityType.getAllSuperTypes()) {
@@ -656,12 +667,30 @@ public class ExportService {
 }
 }
 
+private void addRelationshipType(AtlasRelationshipType relationshipType, 
ExportContext context) {
+if 
(!context.relationshipTypes.contains(relationshipType.getTypeName())) {
+context.relationshipTypes.add(relationshipType.getTypeName());
+
+addAttributeTypes(relationshipType, context);
+addEntityType(relationshipType.getEnd1Type(), context);
+addEntityType(relationshipType.getEnd2Type(), context);
+}
+}
+
 private void addAttributeTypes(AtlasStructType structType, ExportContext 
context) {
 for (AtlasAttributeDef attributeDef : 
structType.getStructDef().getAttributeDefs()) {
 addType(attributeDef.getTypeName(), context);
 }
 }
 
+private void addRelationshipTypes(AtlasEntityType entityType, 
ExportContext context) {
+for (List relationshipTypes : 
entityType.getRelationshipAttributesType().values()) {
+for (AtlasRelationshipType relationshipType : relationshipTypes) {
+addRelationshipType(relationshipType, 

atlas git commit: ATLAS-2984: export should include type defintions of relationships referenced by entities

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/master 9a5553731 -> e4921452e


ATLAS-2984: export should include type defintions of relationships referenced 
by entities


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

Branch: refs/heads/master
Commit: e4921452ebea5b338c07bbc6f886c44c8843f64b
Parents: 9a55537
Author: Madhan Neethiraj 
Authored: Thu Nov 29 13:10:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 17:33:45 2018 -0800

--
 .../atlas/repository/impexp/ExportService.java  | 30 
 .../repository/impexp/ExportTypeProcessor.java  | 24 
 .../impexp/ImportTypeDefProcessor.java  |  1 +
 3 files changed, 55 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/e4921452/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
index 3558d2a..5632520 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
@@ -32,6 +32,7 @@ import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
 import org.apache.atlas.model.typedef.AtlasClassificationDef;
 import org.apache.atlas.model.typedef.AtlasEntityDef;
 import org.apache.atlas.model.typedef.AtlasEnumDef;
+import org.apache.atlas.model.typedef.AtlasRelationshipDef;
 import org.apache.atlas.model.typedef.AtlasStructDef;
 import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef;
 import org.apache.atlas.model.typedef.AtlasTypesDef;
@@ -43,6 +44,7 @@ import org.apache.atlas.type.AtlasClassificationType;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasEnumType;
 import org.apache.atlas.type.AtlasMapType;
+import org.apache.atlas.type.AtlasRelationshipType;
 import org.apache.atlas.type.AtlasStructType;
 import org.apache.atlas.type.AtlasStructType.AtlasAttribute;
 import org.apache.atlas.type.AtlasType;
@@ -175,6 +177,12 @@ public class ExportService {
 
 typesDef.getEnumDefs().add(enumDef);
 }
+
+for (String relationshipType : context.relationshipTypes) {
+AtlasRelationshipDef relationshipDef = 
typeRegistry.getRelationshipDefByName(relationshipType);
+
+typesDef.getRelationshipDefs().add(relationshipDef);
+}
 }
 
 private AtlasExportResult.OperationStatus[] 
processItems(AtlasExportRequest request, ExportContext context) {
@@ -611,6 +619,8 @@ public class ExportService {
 addStructType((AtlasStructType)type, context);
 } else if (type instanceof AtlasEnumType) {
 addEnumType((AtlasEnumType)type, context);
+} else if (type instanceof AtlasRelationshipType) {
+addRelationshipType((AtlasRelationshipType)type, context);
 }
 }
 
@@ -619,6 +629,7 @@ public class ExportService {
 context.entityTypes.add(entityType.getTypeName());
 
 addAttributeTypes(entityType, context);
+addRelationshipTypes(entityType, context);
 
 if (CollectionUtils.isNotEmpty(entityType.getAllSuperTypes())) {
 for (String superType : entityType.getAllSuperTypes()) {
@@ -656,12 +667,30 @@ public class ExportService {
 }
 }
 
+private void addRelationshipType(AtlasRelationshipType relationshipType, 
ExportContext context) {
+if 
(!context.relationshipTypes.contains(relationshipType.getTypeName())) {
+context.relationshipTypes.add(relationshipType.getTypeName());
+
+addAttributeTypes(relationshipType, context);
+addEntityType(relationshipType.getEnd1Type(), context);
+addEntityType(relationshipType.getEnd2Type(), context);
+}
+}
+
 private void addAttributeTypes(AtlasStructType structType, ExportContext 
context) {
 for (AtlasAttributeDef attributeDef : 
structType.getStructDef().getAttributeDefs()) {
 addType(attributeDef.getTypeName(), context);
 }
 }
 
+private void addRelationshipTypes(AtlasEntityType entityType, 
ExportContext context) {
+for (List relationshipTypes : 
entityType.getRelationshipAttributesType().values()) {
+for (AtlasRelationshipType relationshipType : relationshipTypes) {
+addRelationshipType(relationshipType, context);
+}
+}
+}
+
 private List> 

atlas git commit: ATLAS-2982: import fails to create classification-def - #2

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 73185dc51 -> 943e5c711


ATLAS-2982: import fails to create classification-def - #2

(cherry picked from commit 9a5553731b3ace19b2bca05f91676ec61b33f338)


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

Branch: refs/heads/branch-1.0
Commit: 943e5c7c29f9f46bcb9a2e120a97e539efb5
Parents: 73185dc
Author: Madhan Neethiraj 
Authored: Thu Nov 29 16:48:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 17:33:20 2018 -0800

--
 .../java/org/apache/atlas/repository/impexp/ImportService.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/943e5c71/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 d06fd4a..a52c3f9 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
@@ -80,8 +80,6 @@ public class ImportService {
 
 public AtlasImportResult run(ZipSource source, AtlasImportRequest request, 
String userName,
  String hostName, String requestingIP) throws 
AtlasBaseException {
-RequestContext.get().setImportInProgress(true);
-
 if (request == null) {
 request = new AtlasImportRequest();
 }
@@ -91,6 +89,8 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
+RequestContext.get().setImportInProgress(true);
+
 String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
 
@@ -110,6 +110,8 @@ public class ImportService {
 
 throw new AtlasBaseException(excp);
 } finally {
+RequestContext.get().setImportInProgress(false);
+
 source.close();
 LOG.info("<== import(user={}, from={}): status={}", userName, 
requestingIP, result.getOperationStatus());
 }



atlas git commit: ATLAS-2982: import fails to create classification-def - #2

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/master 18a4984a4 -> 9a5553731


ATLAS-2982: import fails to create classification-def - #2


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

Branch: refs/heads/master
Commit: 9a5553731b3ace19b2bca05f91676ec61b33f338
Parents: 18a4984
Author: Madhan Neethiraj 
Authored: Thu Nov 29 16:48:58 2018 -0800
Committer: Madhan Neethiraj 
Committed: Thu Nov 29 17:32:47 2018 -0800

--
 .../java/org/apache/atlas/repository/impexp/ImportService.java | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/9a555373/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 d06fd4a..a52c3f9 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
@@ -80,8 +80,6 @@ public class ImportService {
 
 public AtlasImportResult run(ZipSource source, AtlasImportRequest request, 
String userName,
  String hostName, String requestingIP) throws 
AtlasBaseException {
-RequestContext.get().setImportInProgress(true);
-
 if (request == null) {
 request = new AtlasImportRequest();
 }
@@ -91,6 +89,8 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
+RequestContext.get().setImportInProgress(true);
+
 String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
 
@@ -110,6 +110,8 @@ public class ImportService {
 
 throw new AtlasBaseException(excp);
 } finally {
+RequestContext.get().setImportInProgress(false);
+
 source.close();
 LOG.info("<== import(user={}, from={}): status={}", userName, 
requestingIP, result.getOperationStatus());
 }



atlas git commit: ATLAS-2983: Fixes and clean up for Atlas Kafka bridge utility

2018-11-29 Thread rmani
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 8d06446ce -> 73185dc51


ATLAS-2983: Fixes and clean up for Atlas Kafka bridge utility

Signed-off-by: rmani 


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

Branch: refs/heads/branch-1.0
Commit: 73185dc51866f901aae23076ba8340fadbc1f2bb
Parents: 8d06446
Author: Umesh S Padashetty 
Authored: Thu Nov 29 20:37:40 2018 +0530
Committer: rmani 
Committed: Thu Nov 29 17:27:28 2018 -0800

--
 .../java/org/apache/atlas/kafka/bridge/KafkaBridge.java  | 11 ++-
 .../org/apache/atlas/web/resources/AdminResource.java|  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/73185dc5/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
--
diff --git 
a/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
 
b/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
index bf5d1e7..214dd25 100644
--- 
a/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
+++ 
b/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
@@ -53,6 +53,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 public class KafkaBridge {
 private static final Logger LOG = 
LoggerFactory.getLogger(KafkaBridge.class);
@@ -170,7 +171,7 @@ public class KafkaBridge {
 if (StringUtils.isNotEmpty(topicToImport)) {
 List topics_subset = new ArrayList<>();
 for(String topic : topics) {
-if (topic.startsWith(topicToImport)) {
+if (Pattern.compile(topicToImport).matcher(topic).matches()) {
 topics_subset.add(topic);
 }
 }
@@ -305,12 +306,12 @@ public class KafkaBridge {
 
 private static  void printUsage(){
 System.out.println("Usage 1: import-kafka.sh");
-System.out.println("Usage 2: import-kafka.sh [-n  OR 
--topic ]");
+System.out.println("Usage 2: import-kafka.sh [-t  OR 
--topic ]");
 System.out.println("Usage 3: import-kafka.sh [-f ]" );
 System.out.println("   Format:");
-System.out.println("topic1");
-System.out.println("topic2");
-System.out.println("topic3");
+System.out.println("topic1 OR topic1 regex");
+System.out.println("topic2 OR topic2 regex");
+System.out.println("topic3 OR topic3 regex");
 }
 
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/73185dc5/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
--
diff --git 
a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java 
b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index 3998932..3c24418 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -114,7 +114,7 @@ public class AdminResource {
 private static final String isEntityUpdateAllowed  = 
"atlas.entity.update.allowed";
 private static final String isEntityCreateAllowed  = 
"atlas.entity.create.allowed";
 private static final String editableEntityTypes= 
"atlas.ui.editable.entity.types";
-private static final String DEFAULT_EDITABLE_ENTITY_TYPES  = 
"hdfs_path,hbase_table,hbase_column,hbase_column_family,kafka_topic,hbase_namespace";
+private static final String DEFAULT_EDITABLE_ENTITY_TYPES  = "hdfs_path";
 private static final List TIMEZONE_LIST  = 
Arrays.asList(TimeZone.getAvailableIDs());
 
 @Context



atlas git commit: ATLAS-2983: Fixes and clean up for Atlas Kafka bridge utility

2018-11-29 Thread rmani
Repository: atlas
Updated Branches:
  refs/heads/master 5ebb16901 -> 18a4984a4


ATLAS-2983: Fixes and clean up for Atlas Kafka bridge utility

Signed-off-by: rmani 


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

Branch: refs/heads/master
Commit: 18a4984a4f6d28cd03c0e2fed194b1f129a5a9ec
Parents: 5ebb169
Author: Umesh S Padashetty 
Authored: Thu Nov 29 20:37:40 2018 +0530
Committer: rmani 
Committed: Thu Nov 29 17:14:21 2018 -0800

--
 .../java/org/apache/atlas/kafka/bridge/KafkaBridge.java  | 11 ++-
 .../org/apache/atlas/web/resources/AdminResource.java|  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/18a4984a/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
--
diff --git 
a/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
 
b/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
index bf5d1e7..214dd25 100644
--- 
a/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
+++ 
b/addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/bridge/KafkaBridge.java
@@ -53,6 +53,7 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 public class KafkaBridge {
 private static final Logger LOG = 
LoggerFactory.getLogger(KafkaBridge.class);
@@ -170,7 +171,7 @@ public class KafkaBridge {
 if (StringUtils.isNotEmpty(topicToImport)) {
 List topics_subset = new ArrayList<>();
 for(String topic : topics) {
-if (topic.startsWith(topicToImport)) {
+if (Pattern.compile(topicToImport).matcher(topic).matches()) {
 topics_subset.add(topic);
 }
 }
@@ -305,12 +306,12 @@ public class KafkaBridge {
 
 private static  void printUsage(){
 System.out.println("Usage 1: import-kafka.sh");
-System.out.println("Usage 2: import-kafka.sh [-n  OR 
--topic ]");
+System.out.println("Usage 2: import-kafka.sh [-t  OR 
--topic ]");
 System.out.println("Usage 3: import-kafka.sh [-f ]" );
 System.out.println("   Format:");
-System.out.println("topic1");
-System.out.println("topic2");
-System.out.println("topic3");
+System.out.println("topic1 OR topic1 regex");
+System.out.println("topic2 OR topic2 regex");
+System.out.println("topic3 OR topic3 regex");
 }
 
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/18a4984a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
--
diff --git 
a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java 
b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index 83dac65..b62c90c 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -114,7 +114,7 @@ public class AdminResource {
 private static final String isEntityUpdateAllowed  = 
"atlas.entity.update.allowed";
 private static final String isEntityCreateAllowed  = 
"atlas.entity.create.allowed";
 private static final String editableEntityTypes= 
"atlas.ui.editable.entity.types";
-private static final String DEFAULT_EDITABLE_ENTITY_TYPES  = 
"hdfs_path,hbase_table,hbase_column,hbase_column_family,kafka_topic,hbase_namespace";
+private static final String DEFAULT_EDITABLE_ENTITY_TYPES  = "hdfs_path";
 private static final List TIMEZONE_LIST  = 
Arrays.asList(TimeZone.getAvailableIDs());
 
 @Context



atlas git commit: ATLAS-2982: import fails to create classification-def

2018-11-29 Thread madhan
Repository: atlas
Updated Branches:
  refs/heads/master 18350777e -> 5ebb16901


ATLAS-2982: import fails to create classification-def


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

Branch: refs/heads/master
Commit: 5ebb16901040c22a717de29f962ca53941ba4078
Parents: 1835077
Author: Madhan Neethiraj 
Authored: Wed Nov 28 08:15:21 2018 -0800
Committer: Madhan Neethiraj 
Committed: Wed Nov 28 21:01:24 2018 -0800

--
 .../atlas/authorize/AtlasAuthorizationUtils.java   |  6 +++---
 .../apache/atlas/repository/impexp/ImportService.java  |  3 +++
 .../repository/store/graph/v2/AtlasEntityStoreV2.java  | 13 ++---
 .../repository/store/graph/v2/EntityGraphMapper.java   | 10 +-
 .../store/graph/v2/EntityMutationContext.java  |  4 
 .../store/graph/v2/IDBasedEntityResolver.java  |  5 +++--
 .../src/main/java/org/apache/atlas/RequestContext.java |  8 
 7 files changed, 28 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/5ebb1690/authorization/src/main/java/org/apache/atlas/authorize/AtlasAuthorizationUtils.java
--
diff --git 
a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAuthorizationUtils.java
 
b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAuthorizationUtils.java
index 3f5bd24..c59b186 100644
--- 
a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAuthorizationUtils.java
+++ 
b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAuthorizationUtils.java
@@ -111,7 +111,7 @@ public class AtlasAuthorizationUtils {
 boolean ret  = false;
 String  userName = getCurrentUserName();
 
-if (StringUtils.isNotEmpty(userName)) {
+if (StringUtils.isNotEmpty(userName) && 
!RequestContext.get().isImportInProgress()) {
 try {
 AtlasAuthorizer authorizer = 
AtlasAuthorizerFactory.getAtlasAuthorizer();
 
@@ -132,7 +132,7 @@ public class AtlasAuthorizationUtils {
 boolean ret  = false;
 String  userName = getCurrentUserName();
 
-if (StringUtils.isNotEmpty(userName)) {
+if (StringUtils.isNotEmpty(userName) && 
!RequestContext.get().isImportInProgress()) {
 try {
 AtlasAuthorizer authorizer = 
AtlasAuthorizerFactory.getAtlasAuthorizer();
 
@@ -153,7 +153,7 @@ public class AtlasAuthorizationUtils {
 boolean ret  = false;
 String  userName = getCurrentUserName();
 
-if (StringUtils.isNotEmpty(userName)) {
+if (StringUtils.isNotEmpty(userName) && 
!RequestContext.get().isImportInProgress()) {
 try {
 AtlasAuthorizer authorizer = 
AtlasAuthorizerFactory.getAtlasAuthorizer();
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/5ebb1690/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 b5d8b7c..d06fd4a 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,6 +19,7 @@ package org.apache.atlas.repository.impexp;
 
 import com.google.common.annotations.VisibleForTesting;
 import org.apache.atlas.AtlasErrorCode;
+import org.apache.atlas.RequestContext;
 import org.apache.atlas.entitytransform.BaseEntityHandler;
 import org.apache.atlas.entitytransform.TransformerContext;
 import org.apache.atlas.exception.AtlasBaseException;
@@ -79,6 +80,8 @@ public class ImportService {
 
 public AtlasImportResult run(ZipSource source, AtlasImportRequest request, 
String userName,
  String hostName, String requestingIP) throws 
AtlasBaseException {
+RequestContext.get().setImportInProgress(true);
+
 if (request == null) {
 request = new AtlasImportRequest();
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/5ebb1690/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index 6ee0279..d97b74d 100644
---