[atlas] branch master updated: ATLAS-3095: Update QuickStartV2 to use relationships
This is an automated email from the ASF dual-hosted git repository. sarath 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 01ea65c ATLAS-3095: Update QuickStartV2 to use relationships 01ea65c is described below commit 01ea65c2153c6541f479c6f4f527aa4883e9fbe2 Author: Sarath Subramanian AuthorDate: Mon Mar 25 13:54:09 2019 -0700 ATLAS-3095: Update QuickStartV2 to use relationships --- .../atlas/model/typedef/AtlasRelationshipDef.java | 3 +- .../java/org/apache/atlas/type/AtlasTypeUtil.java | 35 ++ .../store/graph/v2/AtlasGraphUtilsV2.java | 2 +- .../org/apache/atlas/examples/QuickStartV2.java| 472 - .../org/apache/atlas/examples/QuickStartV2IT.java | 119 +++--- 5 files changed, 389 insertions(+), 242 deletions(-) diff --git a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java index e3de460..b9e8af1 100644 --- a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java +++ b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java @@ -152,13 +152,12 @@ public class AtlasRelationshipDef extends AtlasStructDef implements java.io.Seri * *The ends are defined as 1 and 2 to avoid implying a direction. So we do not use to and from. * - * @throws AtlasBaseException */ public AtlasRelationshipDef(String name, String description, String typeVersion, RelationshipCategory relationshipCategory, PropagateTags propagatetags, AtlasRelationshipEndDef endDef1, -AtlasRelationshipEndDef endDef2) throws AtlasBaseException { +AtlasRelationshipEndDef endDef2) { this(name, description, typeVersion, relationshipCategory,propagatetags, endDef1, endDef2, new ArrayList()); } 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 3ba8a12..079a8fc 100644 --- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java +++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java @@ -21,6 +21,7 @@ import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntity; import org.apache.atlas.model.instance.AtlasEntityHeader; import org.apache.atlas.model.instance.AtlasObjectId; +import org.apache.atlas.model.instance.AtlasRelatedObjectId; import org.apache.atlas.model.instance.AtlasStruct; import org.apache.atlas.model.typedef.AtlasBaseTypeDef; import org.apache.atlas.model.typedef.AtlasClassificationDef; @@ -276,6 +277,10 @@ public class AtlasTypeUtil { return new AtlasEntityDef(name, description, version, Arrays.asList(attrDefs), superTypes); } +public static AtlasEntityDef createClassTypeDef(String name, String description, String version, Set superTypes, Map options, AtlasAttributeDef... attrDefs) { +return new AtlasEntityDef(name, description, version, Arrays.asList(attrDefs), superTypes, options); +} + public static AtlasRelationshipDef createRelationshipTypeDef(String name, String description, String version, @@ -288,6 +293,10 @@ public class AtlasTypeUtil { endDef1, endDef2, Arrays.asList(attrDefs)); } +public static AtlasRelationshipEndDef createRelationshipEndDef(String typeName, String name, Cardinality cardinality, boolean isContainer) { +return new AtlasRelationshipEndDef(typeName, name, cardinality, isContainer); +} + public static AtlasTypesDef getTypesDef(List enums, List structs, List traits, @@ -295,6 +304,14 @@ public class AtlasTypeUtil { return new AtlasTypesDef(enums, structs, traits, classes); } +public static AtlasTypesDef getTypesDef(List enums, +List structs, +List traits, +List classes, +List relations) { +return new AtlasTypesDef(enums, structs, traits, classes, relations); +} + public static List toTypeDefHeader(AtlasTypesDef typesDef) { List headerList = new LinkedList<>(); if (CollectionUtils.isNotEmpty(typesDef.getEnumDefs())) { @@ -360,6 +377,20 @@ public class AtlasTypeUtil { return ret; } +public static Collection toAtlasRelatedObjectIds(Collection en
[atlas] branch master updated: ATLAS-3089: PC Framework Moved to Intg Module
This is an automated email from the ASF dual-hosted git repository. amestry 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 3ba4a3f ATLAS-3089: PC Framework Moved to Intg Module 3ba4a3f is described below commit 3ba4a3fe670c36b71f42d3579264a0f060af1090 Author: Ashutosh Mestry AuthorDate: Fri Mar 22 16:13:13 2019 -0700 ATLAS-3089: PC Framework Moved to Intg Module --- .../graphdb/janus/migration/JsonNodeProcessManager.java | 6 +++--- .../graphdb/janus/migration/PostProcessManager.java | 6 +++--- .../main/java/org/apache/atlas}/pc/WorkItemBuilder.java | 2 +- .../java/org/apache/atlas}/pc/WorkItemConsumer.java | 17 - .../main/java/org/apache/atlas}/pc/WorkItemManager.java | 2 +- .../java/org/apache/atlas/pc}/WorkItemConsumerTest.java | 3 +-- .../java/org/apache/atlas/pc}/WorkItemManagerTest.java | 5 + 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java index e2f418e..fb1e684 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java +++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java @@ -19,8 +19,8 @@ package org.apache.atlas.repository.graphdb.janus.migration; import org.apache.tinkerpop.shaded.jackson.databind.JsonNode; -import org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemBuilder; -import org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemConsumer; +import org.apache.atlas.pc.WorkItemBuilder; +import org.apache.atlas.pc.WorkItemConsumer; import org.apache.atlas.repository.graphdb.janus.migration.JsonNodeParsers.ParseElement; import org.apache.tinkerpop.gremlin.structure.Graph; import org.slf4j.Logger; @@ -206,7 +206,7 @@ public class JsonNodeProcessManager { } } -static class WorkItemManager extends org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemManager { +static class WorkItemManager extends org.apache.atlas.pc.WorkItemManager { public WorkItemManager(WorkItemBuilder builder, int batchSize, int numWorkers) { super(builder, batchSize, numWorkers); } diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/PostProcessManager.java b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/PostProcessManager.java index 7046f8c..cf18501 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/PostProcessManager.java +++ b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/PostProcessManager.java @@ -18,9 +18,9 @@ package org.apache.atlas.repository.graphdb.janus.migration; -import org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemBuilder; -import org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemConsumer; -import org.apache.atlas.repository.graphdb.janus.migration.pc.WorkItemManager; +import org.apache.atlas.pc.WorkItemBuilder; +import org.apache.atlas.pc.WorkItemConsumer; +import org.apache.atlas.pc.WorkItemManager; import org.apache.atlas.repository.graphdb.janus.migration.postProcess.PostProcessListProperty; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.Vertex; diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemBuilder.java b/intg/src/main/java/org/apache/atlas/pc/WorkItemBuilder.java similarity index 93% rename from graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemBuilder.java rename to intg/src/main/java/org/apache/atlas/pc/WorkItemBuilder.java index 257b633..6dcb29d 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemBuilder.java +++ b/intg/src/main/java/org/apache/atlas/pc/WorkItemBuilder.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.atlas.repository.graphdb.janus.migration.pc; +package org.apache.atlas.pc; import java.util.concurrent.BlockingQueue; diff --git a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemConsumer.java b/intg/src/main/java/org/apache/atlas/pc/WorkItemConsumer.java similarity index 82% rename from graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemConsumer.java rename to intg/src/main/java/org/apache/atlas/pc/WorkItemConsumer.java index 39b50de..df2cb67 100644 --- a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/pc/WorkItemCon
[atlas] branch master updated: Missing AtlasEntityDef constructor for serviceType
This is an automated email from the ASF dual-hosted git repository. apoorvnaik 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 b2a77d0 Missing AtlasEntityDef constructor for serviceType new dcf0404 Merge pull request #33 from ZepHakase22/miss-service-type b2a77d0 is described below commit b2a77d0f657e321c6e2d54f73ac9b6a0fec59cad Author: Diego Marino Monetti AuthorDate: Fri Mar 22 12:48:06 2019 +0100 Missing AtlasEntityDef constructor for serviceType --- .../apache/atlas/model/typedef/AtlasEntityDef.java | 39 ++ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasEntityDef.java b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasEntityDef.java index 36bb3df..29dbf09 100644 --- a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasEntityDef.java +++ b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasEntityDef.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonSerialize; + import org.apache.atlas.model.PList; import org.apache.atlas.model.SearchFilter.SortType; import org.apache.atlas.model.TypeCategory; @@ -60,29 +61,44 @@ public class AtlasEntityDef extends AtlasStructDef implements java.io.Serializab public AtlasEntityDef() { -this(null, null, null, null, null, null); +this(null, null, null, null, null, null, null); } public AtlasEntityDef(String name) { -this(name, null, null, null, null, null); +this(name, null, null, null, null, null, null); } public AtlasEntityDef(String name, String description) { -this(name, description, null, null, null, null); +this(name, description, null, null, null, null, null); } public AtlasEntityDef(String name, String description, String typeVersion) { -this(name, description, typeVersion, null, null, null); +this(name, description, typeVersion, null, null, null, null); +} + +public AtlasEntityDef(String name, String description, String typeVersion, String serviceType) { +this(name, description, typeVersion, serviceType, null, null, null); } + public AtlasEntityDef(String name, String description, String typeVersion, List attributeDefs) { -this(name, description, typeVersion, attributeDefs, null, null); +this(name, description, typeVersion, attributeDefs, null); +} + +public AtlasEntityDef(String name, String description, String typeVersion, String serviceType, List attributeDefs) { +this(name, description, typeVersion, serviceType, attributeDefs, null, null); } public AtlasEntityDef(String name, String description, String typeVersion, List attributeDefs, Set superTypes) { this(name, description, typeVersion, attributeDefs, superTypes, null); } + +public AtlasEntityDef(String name, String description, String typeVersion, String serviceType, List attributeDefs, +Set superTypes) { + this(name, description, typeVersion, serviceType, attributeDefs, superTypes, null); +} + public AtlasEntityDef(String name, String description, String typeVersion, List attributeDefs, Set superTypes, Map options) { @@ -90,6 +106,14 @@ public class AtlasEntityDef extends AtlasStructDef implements java.io.Serializab setSuperTypes(superTypes); } + +public AtlasEntityDef(String name, String description, String typeVersion, String serviceType, List attributeDefs, +Set superTypes, Map options) { + super(TypeCategory.ENTITY, name, description, typeVersion, attributeDefs, serviceType, options); + + setSuperTypes(superTypes); + } + public AtlasEntityDef(AtlasEntityDef other) { super(other); @@ -97,7 +121,10 @@ public class AtlasEntityDef extends AtlasStructDef implements java.io.Serializab setSuperTypes(other != null ? other.getSuperTypes() : null); } -public Set getSuperTypes() { + + + + public Set getSuperTypes() { return superTypes; }