use of org.apache.atlas.type.AtlasBusinessMetadataType in project atlas by apache.
the class SolrIndexHelper method geIndexFieldNamesWithSearchWeights.
private Map<String, Integer> geIndexFieldNamesWithSearchWeights() {
Map<String, Integer> ret = new HashMap<>();
// the following properties are specially added manually.
// as, they don't come in the entity definitions as attributes.
ret.put(typeRegistry.getIndexFieldName(CLASSIFICATION_TEXT_KEY), SEARCHWEIGHT_FOR_CLASSIFICATIONS);
ret.put(typeRegistry.getIndexFieldName(LABELS_PROPERTY_KEY), SEARCHWEIGHT_FOR_LABELS);
ret.put(typeRegistry.getIndexFieldName(CUSTOM_ATTRIBUTES_PROPERTY_KEY), SEARCHWEIGHT_FOR_CUSTOM_ATTRS);
ret.put(typeRegistry.getIndexFieldName(TYPE_NAME_PROPERTY_KEY), SEARCHWEIGHT_FOR_TYPENAME);
for (AtlasEntityType entityType : typeRegistry.getAllEntityTypes()) {
if (entityType.isInternalType()) {
continue;
}
processType(ret, entityType);
}
for (AtlasBusinessMetadataType businessMetadataType : typeRegistry.getAllBusinessMetadataTypes()) {
processType(ret, businessMetadataType);
}
return ret;
}
use of org.apache.atlas.type.AtlasBusinessMetadataType in project atlas by apache.
the class AtlasBusinessMetadataDefStoreV2Test method createBusinessMetadataDefMultivaluedAttributes.
@Test
public void createBusinessMetadataDefMultivaluedAttributes() throws AtlasBaseException {
createEnumTypes();
createBusinessMetadataTypesMultivaluedAttributes(businessMetadataName);
AtlasBusinessMetadataType businessMetadataType = typeRegistry.getBusinessMetadataTypeByName(businessMetadataName);
Assert.assertEquals(businessMetadataType.getAllAttributes().size(), 10);
Map<String, AtlasStructType.AtlasAttribute> attributeMap = businessMetadataType.getAllAttributes();
for (Map.Entry<String, AtlasStructType.AtlasAttribute> e : attributeMap.entrySet()) {
AtlasStructType.AtlasAttribute atlasAttribute = e.getValue();
AtlasStructDef.AtlasAttributeDef atlasAttributeDef = atlasAttribute.getAttributeDef();
Assert.assertTrue(atlasAttributeDef.getTypeName().startsWith("array<"));
}
}
use of org.apache.atlas.type.AtlasBusinessMetadataType in project atlas by apache.
the class AtlasBusinessMetadataDefStoreV2Test method createBusinessMetadataDefWithoutAttributes.
@Test
public void createBusinessMetadataDefWithoutAttributes() throws AtlasBaseException {
createBusinessMetadataTypesWithoutAttributes(businessMetadataName);
AtlasBusinessMetadataType businessMetadataType = typeRegistry.getBusinessMetadataTypeByName(businessMetadataName);
Assert.assertTrue(businessMetadataType.getAllAttributes() == null ? true : businessMetadataType.getAllAttributes().isEmpty());
}
use of org.apache.atlas.type.AtlasBusinessMetadataType in project atlas by apache.
the class ExportTypeProcessor method addType.
private void addType(AtlasType type, ExportService.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 AtlasRelationshipType) {
addRelationshipType(type.getTypeName(), context);
} else if (type instanceof AtlasBusinessMetadataType) {
addBusinessMetadataType((AtlasBusinessMetadataType) type, context);
} else if (type instanceof AtlasStructType) {
addStructType((AtlasStructType) type, context);
} else if (type instanceof AtlasEnumType) {
addEnumType((AtlasEnumType) type, context);
}
}
use of org.apache.atlas.type.AtlasBusinessMetadataType in project atlas by apache.
the class ExportTypeProcessor method addBusinessMetadataType.
private void addBusinessMetadataType(AtlasEntityType entityType, ExportService.ExportContext context) {
for (String bmTypeName : entityType.getBusinessAttributes().keySet()) {
AtlasBusinessMetadataType bmType = typeRegistry.getBusinessMetadataTypeByName(bmTypeName);
addBusinessMetadataType(bmType, context);
}
}
Aggregations