private void readClassificationsFromEdge(AtlasEdge edge, AtlasRelationshipWithExtInfo relationshipWithExtInfo, boolean extendedInfo) throws AtlasBaseException { List<AtlasVertex> classificationVertices = getClassificationVertices(edge); List<String> blockedClassificationIds = getBlockedClassificationIds(edge); AtlasRelationship relationship = relationshipWithExtInfo.getRelationship(); Set<AtlasClassification> propagatedClassifications = new HashSet<>(); Set<AtlasClassification> blockedClassifications = new HashSet<>(); for (AtlasVertex classificationVertex : classificationVertices) { String classificationId = classificationVertex.getIdForDisplay(); AtlasClassification classification = toAtlasClassification(classificationVertex); String entityGuid = classification.getEntityGuid(); if (blockedClassificationIds.contains(classificationId)) { blockedClassifications.add(classification); } else { propagatedClassifications.add(classification); } // add entity headers to referred entities if (extendedInfo) { addToReferredEntities(relationshipWithExtInfo, entityGuid); } } relationship.setPropagatedClassifications(propagatedClassifications); relationship.setBlockedPropagatedClassifications(blockedClassifications); }
private void readClassificationsFromEdge(AtlasEdge edge, AtlasRelationshipWithExtInfo relationshipWithExtInfo, boolean extendedInfo) throws AtlasBaseException { List<AtlasVertex> classificationVertices = getClassificationVertices(edge); List<String> blockedClassificationIds = getBlockedClassificationIds(edge); AtlasRelationship relationship = relationshipWithExtInfo.getRelationship(); Set<AtlasClassification> propagatedClassifications = new HashSet<>(); Set<AtlasClassification> blockedClassifications = new HashSet<>(); for (AtlasVertex classificationVertex : classificationVertices) { String classificationId = classificationVertex.getIdForDisplay(); AtlasClassification classification = toAtlasClassification(classificationVertex); String entityGuid = classification.getEntityGuid(); if (blockedClassificationIds.contains(classificationId)) { blockedClassifications.add(classification); } else { propagatedClassifications.add(classification); } // add entity headers to referred entities if (extendedInfo) { addToReferredEntities(relationshipWithExtInfo, entityGuid); } } relationship.setPropagatedClassifications(propagatedClassifications); relationship.setBlockedPropagatedClassifications(blockedClassifications); }
AtlasRelationship relationship = relationshipWithExtInfo.getRelationship();
AtlasRelationship relationship = relationshipWithExtInfo.getRelationship();
private void mapAttributes(AtlasEdge edge, AtlasRelationshipWithExtInfo relationshipWithExtInfo) throws AtlasBaseException { AtlasRelationship relationship = relationshipWithExtInfo.getRelationship(); AtlasType objType = typeRegistry.getType(relationship.getTypeName()); if (!(objType instanceof AtlasRelationshipType)) { throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, relationship.getTypeName()); } AtlasRelationshipType relationshipType = (AtlasRelationshipType) objType; for (AtlasAttribute attribute : relationshipType.getAllAttributes().values()) { // mapping only primitive attributes Object attrValue = mapVertexToPrimitive(edge, attribute.getVertexPropertyName(), attribute.getAttributeDef()); relationship.setAttribute(attribute.getName(), attrValue); } } }
public AtlasRelationship mapEdgeToAtlasRelationship(AtlasEdge edge) throws AtlasBaseException { return mapEdgeToAtlasRelationship(edge, false).getRelationship(); }
private void mapAttributes(AtlasEdge edge, AtlasRelationshipWithExtInfo relationshipWithExtInfo) throws AtlasBaseException { AtlasRelationship relationship = relationshipWithExtInfo.getRelationship(); AtlasType objType = typeRegistry.getType(relationship.getTypeName()); if (!(objType instanceof AtlasRelationshipType)) { throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, relationship.getTypeName()); } AtlasRelationshipType relationshipType = (AtlasRelationshipType) objType; for (AtlasAttribute attribute : relationshipType.getAllAttributes().values()) { // mapping only primitive attributes Object attrValue = mapVertexToPrimitive(edge, attribute.getVertexPropertyName(), attribute.getAttributeDef()); relationship.setAttribute(attribute.getName(), attrValue); } } }
public AtlasRelationship mapEdgeToAtlasRelationship(AtlasEdge edge) throws AtlasBaseException { return mapEdgeToAtlasRelationship(edge, false).getRelationship(); }