[atlas] branch master updated: ATLAS-3688: updated dependencies to remove unnecessary references to hdfs-model, hbase-common and hbase-server

2020-03-25 Thread madhan
This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 0d0a389  ATLAS-3688: updated dependencies to remove unnecessary 
references to hdfs-model, hbase-common and hbase-server
0d0a389 is described below

commit 0d0a3899443f7e701aa4c5c152ad601e9f913e52
Author: Madhan Neethiraj 
AuthorDate: Wed Mar 25 10:32:56 2020 -0700

ATLAS-3688: updated dependencies to remove unnecessary references to 
hdfs-model, hbase-common and hbase-server
---
 addons/falcon-bridge/pom.xml |  5 -
 addons/hbase-bridge/pom.xml  | 10 --
 addons/hive-bridge/pom.xml   | 20 
 addons/impala-bridge/pom.xml | 20 
 addons/sqoop-bridge/pom.xml  |  5 -
 addons/storm-bridge/pom.xml  | 10 --
 pom.xml  |  6 --
 tools/classification-updater/pom.xml |  5 -
 8 files changed, 81 deletions(-)

diff --git a/addons/falcon-bridge/pom.xml b/addons/falcon-bridge/pom.xml
index c53d0ef..7f98b4f 100644
--- a/addons/falcon-bridge/pom.xml
+++ b/addons/falcon-bridge/pom.xml
@@ -159,11 +159,6 @@
 
${project.version}
 
 
-
${project.groupId}
-hdfs-model
-
${project.version}
-
-
 org.apache.kafka
 
kafka_${kafka.scala.binary.version}
 ${kafka.version}
diff --git a/addons/hbase-bridge/pom.xml b/addons/hbase-bridge/pom.xml
index ff88c8b..c1d18c2 100644
--- a/addons/hbase-bridge/pom.xml
+++ b/addons/hbase-bridge/pom.xml
@@ -62,11 +62,6 @@
 atlas-notification
 
 
-
-org.apache.atlas
-hdfs-model
-
-
 
 
 com.sun.jersey
@@ -295,11 +290,6 @@
 
 
 
${project.groupId}
-hdfs-model
-
${project.version}
-
-
-
${project.groupId}
 
atlas-common
 
${project.version}
 
diff --git a/addons/hive-bridge/pom.xml b/addons/hive-bridge/pom.xml
index 13384cb..662fdd4 100755
--- a/addons/hive-bridge/pom.xml
+++ b/addons/hive-bridge/pom.xml
@@ -128,11 +128,6 @@
 atlas-notification
 
 
-
-org.apache.atlas
-hdfs-model
-
-
 
 
 org.apache.atlas
@@ -258,11 +253,6 @@
 
 
 
${project.groupId}
-hdfs-model
-
${project.version}
-
-
-
${project.groupId}
 
atlas-common
 
${project.version}
 
@@ -302,16 +292,6 @@
 
${commons-conf.version}
 
 
-org.apache.hbase
-
hbase-common
-${hbase.version}
-
-
-org.apache.hbase
-
hbase-server
-${hbase.version}
-
-
 com.sun.jersey
 
jersey-json
 
${jersey.version}
diff --git a/addons/impala-bridge/pom.xml b/addons/impala-bridge/pom.xml
index a684dd0..14150dd 100644
--- a/addons/impala-bridge/pom.xml
+++ b/addons/impala-bridge/pom.xml
@@ -66,11 +66,6 @@
   test
 
 
-  org.apache.atlas
-  hdfs-model
- 

[atlas] branch branch-2.0 updated: ATLAS-3688: updated dependencies to remove unnecessary references to hdfs-model, hbase-common and hbase-server

2020-03-25 Thread madhan
This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
 new c496aeb  ATLAS-3688: updated dependencies to remove unnecessary 
references to hdfs-model, hbase-common and hbase-server
c496aeb is described below

commit c496aeb0fe51f12baeb5d8c5c5175b46ddc1419f
Author: Madhan Neethiraj 
AuthorDate: Wed Mar 25 10:32:56 2020 -0700

ATLAS-3688: updated dependencies to remove unnecessary references to 
hdfs-model, hbase-common and hbase-server

(cherry picked from commit 0d0a3899443f7e701aa4c5c152ad601e9f913e52)
---
 addons/falcon-bridge/pom.xml |  5 -
 addons/hbase-bridge/pom.xml  | 10 --
 addons/hive-bridge/pom.xml   | 20 
 addons/impala-bridge/pom.xml | 20 
 addons/sqoop-bridge/pom.xml  |  5 -
 addons/storm-bridge/pom.xml  | 10 --
 pom.xml  |  6 --
 tools/classification-updater/pom.xml |  5 -
 8 files changed, 81 deletions(-)

diff --git a/addons/falcon-bridge/pom.xml b/addons/falcon-bridge/pom.xml
index 18c9c03..5f91744 100644
--- a/addons/falcon-bridge/pom.xml
+++ b/addons/falcon-bridge/pom.xml
@@ -159,11 +159,6 @@
 
${project.version}
 
 
-
${project.groupId}
-hdfs-model
-
${project.version}
-
-
 org.apache.kafka
 
kafka_${kafka.scala.binary.version}
 ${kafka.version}
diff --git a/addons/hbase-bridge/pom.xml b/addons/hbase-bridge/pom.xml
index 37d14f1..3261f3d 100644
--- a/addons/hbase-bridge/pom.xml
+++ b/addons/hbase-bridge/pom.xml
@@ -62,11 +62,6 @@
 atlas-notification
 
 
-
-org.apache.atlas
-hdfs-model
-
-
 
 
 com.sun.jersey
@@ -295,11 +290,6 @@
 
 
 
${project.groupId}
-hdfs-model
-
${project.version}
-
-
-
${project.groupId}
 
atlas-common
 
${project.version}
 
diff --git a/addons/hive-bridge/pom.xml b/addons/hive-bridge/pom.xml
index fa848b6..dc33ab7 100755
--- a/addons/hive-bridge/pom.xml
+++ b/addons/hive-bridge/pom.xml
@@ -128,11 +128,6 @@
 atlas-notification
 
 
-
-org.apache.atlas
-hdfs-model
-
-
 
 
 org.apache.atlas
@@ -258,11 +253,6 @@
 
 
 
${project.groupId}
-hdfs-model
-
${project.version}
-
-
-
${project.groupId}
 
atlas-common
 
${project.version}
 
@@ -302,16 +292,6 @@
 
${commons-conf.version}
 
 
-org.apache.hbase
-
hbase-common
-${hbase.version}
-
-
-org.apache.hbase
-
hbase-server
-${hbase.version}
-
-
 com.sun.jersey
 
jersey-json
 
${jersey.version}
diff --git a/addons/impala-bridge/pom.xml b/addons/impala-bridge/pom.xml
index 39ae740..5c78202 100644
--- a/addons/impala-bridge/pom.xml
+++ b/addons/impala-bridge/pom.xml
@

[atlas] branch branch-2.0 updated: ATLAS-3632: Max length validation for business-metadata string attributes and Test cases. which cover 1.business-metadata typedef creation 2.entity-BM association 3.

2020-03-25 Thread nixon
This is an automated email from the ASF dual-hosted git repository.

nixon pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
 new a284ed9  ATLAS-3632: Max length validation for business-metadata 
string attributes and Test cases.  which cover 1.business-metadata typedef 
creation 2.entity-BM association 3.Max length check
a284ed9 is described below

commit a284ed9e17de557b14ff1cbd34b50e3c2c1d320f
Author: Mandar Ambawane 
AuthorDate: Thu Mar 12 15:42:51 2020 +0530

ATLAS-3632: Max length validation for business-metadata string attributes 
and Test cases.
 which cover 1.business-metadata typedef creation 2.entity-BM association 
3.Max length check

Signed-off-by: nixonrodrigues 
(cherry picked from commit 00fb162d880489dfdd744c136d128bfaeaadde24)
---
 .../atlas/type/AtlasBusinessMetadataType.java  |  44 +++-
 .../java/org/apache/atlas/type/AtlasTypeUtil.java  |  14 ++
 .../test/java/org/apache/atlas/TestUtilsV2.java|  67 ++
 .../store/graph/v2/AtlasEntityStoreV2.java |   5 +
 .../v2/AtlasBusinessMetadataDefStoreV2Test.java| 154 +++-
 .../store/graph/v2/AtlasEntityStoreV2Test.java |  94 +++-
 .../apache/atlas/web/adapters/TestEntityREST.java  | 264 -
 7 files changed, 633 insertions(+), 9 deletions(-)

diff --git 
a/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
index 0f4725f..f173001 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
@@ -26,6 +26,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Array;
 import java.util.*;
 
 import static org.apache.atlas.model.typedef.AtlasBusinessMetadataDef.*;
@@ -100,7 +101,7 @@ public class AtlasBusinessMetadataType extends 
AtlasStructType {
 }
 
 AtlasBusinessAttribute bmAttribute;
-if (attribute.getAttributeType() instanceof 
AtlasBuiltInTypes.AtlasStringType) {
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) {
 Integer maxStringLength = 
attribute.getOptionInt(ATTR_MAX_STRING_LENGTH);
 if (maxStringLength == null) {
 throw new 
AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ATTRIBUTE, 
attributeDef.getName(), "options." + ATTR_MAX_STRING_LENGTH);
@@ -171,5 +172,46 @@ public class AtlasBusinessMetadataType extends 
AtlasStructType {
 public int getMaxStringLength() {
 return maxStringLength;
 }
+
+public boolean isValidLength(Object value) {
+boolean ret = true;
+if (value != null) {
+AtlasType attrType = getAttributeType();
+
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) {
+ret = isValidStringValue(value);
+} else if (attrType instanceof AtlasArrayType) {
+attrType = ((AtlasArrayType) attrType).getElementType();
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) 
{
+ret = isValidArrayValue(value);
+}
+}
+}
+return ret;
+}
+
+private boolean isValidStringValue(Object obj) {
+return obj == null || String.valueOf(obj).length() <= 
this.maxStringLength;
+}
+
+private boolean isValidArrayValue(Object obj) {
+if (obj instanceof List || obj instanceof Set) {
+Collection objList = (Collection) obj;
+
+for (Object element : objList) {
+if (!isValidStringValue(element)) {
+return false;
+}
+}
+} else if (obj.getClass().isArray()) {
+int arrayLen = Array.getLength(obj);
+for (int i = 0; i < arrayLen; i++) {
+if (!isValidStringValue(Array.get(obj, i))) {
+return false;
+}
+}
+}
+return true;
+}
 }
 }
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
index e9d8683..9abcd34 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
@@ -178,6 +178,13 @@ public class AtlasTypeUtil {
 Collections.emptyList());
 }
 
+public static AtlasAttributeDef createOptionalAttrDef(String name, String 
dataType, Map options, String desc) {
+return new AtlasAttributeDef(name, dataType, true,
+

[atlas] branch master updated: ATLAS-3632: Max length validation for business-metadata string attributes and Test cases. which cover 1.business-metadata typedef creation 2.entity-BM association 3.Max

2020-03-25 Thread nixon
This is an automated email from the ASF dual-hosted git repository.

nixon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 00fb162  ATLAS-3632: Max length validation for business-metadata 
string attributes and Test cases.  which cover 1.business-metadata typedef 
creation 2.entity-BM association 3.Max length check
00fb162 is described below

commit 00fb162d880489dfdd744c136d128bfaeaadde24
Author: Mandar Ambawane 
AuthorDate: Thu Mar 12 15:42:51 2020 +0530

ATLAS-3632: Max length validation for business-metadata string attributes 
and Test cases.
 which cover 1.business-metadata typedef creation 2.entity-BM association 
3.Max length check

Signed-off-by: nixonrodrigues 
---
 .../atlas/type/AtlasBusinessMetadataType.java  |  44 +++-
 .../java/org/apache/atlas/type/AtlasTypeUtil.java  |  14 ++
 .../test/java/org/apache/atlas/TestUtilsV2.java|  67 ++
 .../store/graph/v2/AtlasEntityStoreV2.java |   5 +
 .../v2/AtlasBusinessMetadataDefStoreV2Test.java| 154 +++-
 .../store/graph/v2/AtlasEntityStoreV2Test.java |  94 +++-
 .../apache/atlas/web/adapters/TestEntityREST.java  | 264 -
 7 files changed, 633 insertions(+), 9 deletions(-)

diff --git 
a/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
index 0f4725f..f173001 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasBusinessMetadataType.java
@@ -26,6 +26,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Array;
 import java.util.*;
 
 import static org.apache.atlas.model.typedef.AtlasBusinessMetadataDef.*;
@@ -100,7 +101,7 @@ public class AtlasBusinessMetadataType extends 
AtlasStructType {
 }
 
 AtlasBusinessAttribute bmAttribute;
-if (attribute.getAttributeType() instanceof 
AtlasBuiltInTypes.AtlasStringType) {
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) {
 Integer maxStringLength = 
attribute.getOptionInt(ATTR_MAX_STRING_LENGTH);
 if (maxStringLength == null) {
 throw new 
AtlasBaseException(AtlasErrorCode.MISSING_MANDATORY_ATTRIBUTE, 
attributeDef.getName(), "options." + ATTR_MAX_STRING_LENGTH);
@@ -171,5 +172,46 @@ public class AtlasBusinessMetadataType extends 
AtlasStructType {
 public int getMaxStringLength() {
 return maxStringLength;
 }
+
+public boolean isValidLength(Object value) {
+boolean ret = true;
+if (value != null) {
+AtlasType attrType = getAttributeType();
+
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) {
+ret = isValidStringValue(value);
+} else if (attrType instanceof AtlasArrayType) {
+attrType = ((AtlasArrayType) attrType).getElementType();
+if (attrType instanceof AtlasBuiltInTypes.AtlasStringType) 
{
+ret = isValidArrayValue(value);
+}
+}
+}
+return ret;
+}
+
+private boolean isValidStringValue(Object obj) {
+return obj == null || String.valueOf(obj).length() <= 
this.maxStringLength;
+}
+
+private boolean isValidArrayValue(Object obj) {
+if (obj instanceof List || obj instanceof Set) {
+Collection objList = (Collection) obj;
+
+for (Object element : objList) {
+if (!isValidStringValue(element)) {
+return false;
+}
+}
+} else if (obj.getClass().isArray()) {
+int arrayLen = Array.getLength(obj);
+for (int i = 0; i < arrayLen; i++) {
+if (!isValidStringValue(Array.get(obj, i))) {
+return false;
+}
+}
+}
+return true;
+}
 }
 }
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
index e9d8683..9abcd34 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
@@ -178,6 +178,13 @@ public class AtlasTypeUtil {
 Collections.emptyList());
 }
 
+public static AtlasAttributeDef createOptionalAttrDef(String name, String 
dataType, Map options, String desc) {
+return new AtlasAttributeDef(name, dataType, true,
+Cardinality.SINGLE, 0, 1,
+false, false, false, "