You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2018/08/21 23:46:16 UTC
atlas git commit: ATLAS-2833: Associating tag to entity API throws
exception since mapGraphToTypedInstance uses outdated transient typesystem
information
Repository: atlas
Updated Branches:
refs/heads/0.7.1-incubating 15748e7bc -> 2ee6ad097
ATLAS-2833: Associating tag to entity API throws exception since mapGraphToTypedInstance uses outdated transient typesystem information
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2ee6ad09
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2ee6ad09
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2ee6ad09
Branch: refs/heads/0.7.1-incubating
Commit: 2ee6ad097cf59531750e4511c171c8553d5b7f78
Parents: 15748e7
Author: Sarath Subramanian <ss...@hortonworks.com>
Authored: Tue Aug 21 16:38:13 2018 -0700
Committer: Sarath Subramanian <ss...@hortonworks.com>
Committed: Tue Aug 21 16:38:13 2018 -0700
----------------------------------------------------------------------
.../org/apache/atlas/typesystem/types/AbstractDataType.java | 4 ++++
.../main/java/org/apache/atlas/typesystem/types/EnumType.java | 6 +++++-
.../org/apache/atlas/typesystem/types/HierarchicalType.java | 6 +++++-
.../main/java/org/apache/atlas/typesystem/types/IDataType.java | 2 ++
.../java/org/apache/atlas/typesystem/types/StructType.java | 6 +++++-
.../java/org/apache/atlas/typesystem/types/TypeSystem.java | 3 +++
6 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
index dc9cdf2..cbe04e3 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java
@@ -38,6 +38,10 @@ abstract class AbstractDataType<T> implements IDataType<T> {
this.description = description;
}
+ public void setTypeSystem(TypeSystem typeSystem) {
+ // do nothing
+ }
+
protected T convertNull(Multiplicity m) throws AtlasException {
if (!m.nullAllowed()) {
throw new ValueConversionException.NullConversionException(m);
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java
index bdd0a13..5535271 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java
@@ -28,7 +28,7 @@ import java.security.MessageDigest;
public class EnumType extends AbstractDataType<EnumValue> {
- public final TypeSystem typeSystem;
+ public TypeSystem typeSystem;
public final ImmutableMap<String, EnumValue> valueMap;
public final ImmutableMap<Integer, EnumValue> ordinalMap;
@@ -49,6 +49,10 @@ public class EnumType extends AbstractDataType<EnumValue> {
ordinalMap = b2.build();
}
+ public void setTypeSystem(TypeSystem typeSystem) {
+ this.typeSystem = typeSystem;
+ }
+
@Override
public EnumValue convert(Object val, Multiplicity m) throws AtlasException {
if (val != null) {
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
index befc705..2988f3c 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java
@@ -50,7 +50,7 @@ import java.util.Set;
*/
public abstract class HierarchicalType<ST extends HierarchicalType, T> extends AbstractDataType<T> {
- public final TypeSystem typeSystem;
+ public TypeSystem typeSystem;
public final Class<ST> superTypeClass;
public final FieldMapping fieldMapping;
public final int numFields;
@@ -97,6 +97,10 @@ public abstract class HierarchicalType<ST extends HierarchicalType, T> extends A
this.immediateAttrs = ImmutableList.copyOf(fields);
}
+ public void setTypeSystem(TypeSystem typeSystem) {
+ this.typeSystem = typeSystem;
+ }
+
public FieldMapping fieldMapping() {
return fieldMapping;
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java
index 85ddee7..3272038 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java
@@ -55,5 +55,7 @@ public interface IDataType<T> {
void updateSignatureHash(MessageDigest digester, Object val) throws AtlasException;
String getDescription();
+
+ void setTypeSystem(TypeSystem typeSystem);
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java
index 6f40c1d..42d9c9f 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java
@@ -35,7 +35,7 @@ import org.apache.atlas.typesystem.ITypedStruct;
public class StructType extends AbstractDataType<IStruct> implements IConstructableType<IStruct, ITypedStruct> {
- public final TypeSystem typeSystem;
+ public TypeSystem typeSystem;
public final FieldMapping fieldMapping;
public final Map<AttributeInfo, List<String>> infoToNameMap;
public final int numFields;
@@ -60,6 +60,10 @@ public class StructType extends AbstractDataType<IStruct> implements IConstructa
this.handler = new TypedStructHandler(this);
}
+ public void setTypeSystem(TypeSystem typeSystem) {
+ this.typeSystem = typeSystem;
+ }
+
public FieldMapping fieldMapping() {
return fieldMapping;
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/2ee6ad09/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
index c355ba9..ed395b4 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
@@ -345,6 +345,9 @@ public class TypeSystem {
String typeName = typeEntry.getKey();
IDataType type = typeEntry.getValue();
//Add/replace the new type in the typesystem
+
+ type.setTypeSystem(this);
+
typeCache.put(type);
}
}