Search in sources :

Example 21 with IDataType

use of org.apache.atlas.typesystem.types.IDataType in project incubator-atlas by apache.

the class DeleteHandler method getAttributeForEdge.

protected AttributeInfo getAttributeForEdge(String edgLabel) throws AtlasException {
    AtlasEdgeLabel atlasEdgeLabel = new AtlasEdgeLabel(edgLabel);
    IDataType referenceType = typeSystem.getDataType(IDataType.class, atlasEdgeLabel.getTypeName());
    return getFieldMapping(referenceType).fields.get(atlasEdgeLabel.getAttributeName());
}
Also used : IDataType(org.apache.atlas.typesystem.types.IDataType)

Example 22 with IDataType

use of org.apache.atlas.typesystem.types.IDataType in project incubator-atlas by apache.

the class DefaultTypeCache method getTypeNames.

/**
     * Return the list of type names in the type system which match the specified filter.
     *
     * @return list of type names
     * @param filterMap - Map of filter for type names. Valid keys are CATEGORY, SUPERTYPE, NOT_SUPERTYPE
     * For example, CATEGORY = TRAIT && SUPERTYPE contains 'X' && SUPERTYPE !contains 'Y'
     */
@Override
public Collection<String> getTypeNames(Map<TYPE_FILTER, String> filterMap) throws AtlasException {
    assertFilter(filterMap);
    List<String> typeNames = new ArrayList<>();
    for (IDataType type : types_.values()) {
        if (shouldIncludeType(type, filterMap)) {
            typeNames.add(type.getName());
        }
    }
    return typeNames;
}
Also used : ArrayList(java.util.ArrayList) IDataType(org.apache.atlas.typesystem.types.IDataType)

Aggregations

IDataType (org.apache.atlas.typesystem.types.IDataType)22 AttributeInfo (org.apache.atlas.typesystem.types.AttributeInfo)6 Test (org.testng.annotations.Test)5 ArrayList (java.util.ArrayList)4 AtlasEdge (org.apache.atlas.repository.graphdb.AtlasEdge)4 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)4 DataTypes (org.apache.atlas.typesystem.types.DataTypes)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 ITypedReferenceableInstance (org.apache.atlas.typesystem.ITypedReferenceableInstance)3 Id (org.apache.atlas.typesystem.persistence.Id)3 List (java.util.List)2 ClosureExpression (org.apache.atlas.groovy.ClosureExpression)2 FunctionCallExpression (org.apache.atlas.groovy.FunctionCallExpression)2 GroovyExpression (org.apache.atlas.groovy.GroovyExpression)2 LiteralExpression (org.apache.atlas.groovy.LiteralExpression)2 ClassType (org.apache.atlas.typesystem.types.ClassType)2 HashSet (java.util.HashSet)1 Stack (java.util.Stack)1 AtlasException (org.apache.atlas.AtlasException)1