Search in sources :

Example 26 with AtlasStructType

use of org.apache.atlas.type.AtlasStructType in project incubator-atlas by apache.

the class ModelTestUtil method newStruct.

public static AtlasStruct newStruct(AtlasStructDef structDef, AtlasTypeRegistry typesRegistry) {
    AtlasStruct ret = null;
    AtlasStructType structType = typesRegistry.getStructTypeByName(structDef.getName());
    if (structType != null) {
        ret = structType.createDefaultValue();
    } else {
        LOG.error("failed to get struct-type {}", structDef.getName());
    }
    return ret;
}
Also used : AtlasStruct(org.apache.atlas.model.instance.AtlasStruct) AtlasStructType(org.apache.atlas.type.AtlasStructType)

Example 27 with AtlasStructType

use of org.apache.atlas.type.AtlasStructType in project incubator-atlas by apache.

the class ExportService method addType.

private void addType(AtlasType type, ExportContext context) {
    if (type.getTypeCategory() == TypeCategory.PRIMITIVE) {
        return;
    }
    if (type instanceof AtlasArrayType) {
        AtlasArrayType arrayType = (AtlasArrayType) type;
        addType(arrayType.getElementType(), context);
    } else if (type instanceof AtlasMapType) {
        AtlasMapType mapType = (AtlasMapType) type;
        addType(mapType.getKeyType(), context);
        addType(mapType.getValueType(), context);
    } else if (type instanceof AtlasEntityType) {
        addEntityType((AtlasEntityType) type, context);
    } else if (type instanceof AtlasClassificationType) {
        addClassificationType((AtlasClassificationType) type, context);
    } else if (type instanceof AtlasStructType) {
        addStructType((AtlasStructType) type, context);
    } else if (type instanceof AtlasEnumType) {
        addEnumType((AtlasEnumType) type, context);
    }
}
Also used : AtlasArrayType(org.apache.atlas.type.AtlasArrayType) AtlasEnumType(org.apache.atlas.type.AtlasEnumType) AtlasStructType(org.apache.atlas.type.AtlasStructType) AtlasClassificationType(org.apache.atlas.type.AtlasClassificationType) AtlasEntityType(org.apache.atlas.type.AtlasEntityType) AtlasMapType(org.apache.atlas.type.AtlasMapType)

Aggregations

AtlasStructType (org.apache.atlas.type.AtlasStructType)27 AtlasType (org.apache.atlas.type.AtlasType)12 AtlasEdge (org.apache.atlas.repository.graphdb.AtlasEdge)10 AtlasEntityType (org.apache.atlas.type.AtlasEntityType)8 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)7 AtlasAttribute (org.apache.atlas.type.AtlasStructType.AtlasAttribute)7 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)6 AtlasArrayType (org.apache.atlas.type.AtlasArrayType)5 AtlasStruct (org.apache.atlas.model.instance.AtlasStruct)4 AtlasMapType (org.apache.atlas.type.AtlasMapType)4 Map (java.util.Map)3 RequestContextV1 (org.apache.atlas.RequestContextV1)3 AtlasObjectId (org.apache.atlas.model.instance.AtlasObjectId)3 HashMap (java.util.HashMap)2 TypeCategory (org.apache.atlas.model.TypeCategory)2 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)2 AtlasAttributeDef (org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef)2 AtlasEdgeLabel (org.apache.atlas.repository.graph.AtlasEdgeLabel)2 AtlasTypeDefGraphStoreV1 (org.apache.atlas.repository.store.graph.v1.AtlasTypeDefGraphStoreV1)2 AtlasClassificationType (org.apache.atlas.type.AtlasClassificationType)2