final String pathQualifiedName = toStr(flowPathEntity.getAttribute(ATTR_QUALIFIED_NAME)); final NiFiFlowPath flowPath = new NiFiFlowPath(getComponentIdFromQualifiedName(pathQualifiedName)); if (flowPathEntity.hasAttribute(ATTR_URL)) { final Matcher urlMatcher = FLOW_PATH_URL_PATTERN.matcher(toStr(flowPathEntity.getAttribute(ATTR_URL))); if (urlMatcher.matches()) {
void visitEntity(AtlasEntityType entityType, AtlasEntity entity) throws AtlasBaseException { List<String> visitedAttributes = new ArrayList<>(); // visit relationship attributes visitRelationships(entityType, entity, visitedAttributes); // visit struct attributes for (AtlasAttribute attribute : entityType.getAllAttributes().values()) { AtlasType attrType = attribute.getAttributeType(); String attrName = attribute.getName(); Object attrVal = entity.getAttribute(attrName); if (entity.hasAttribute(attrName) && !visitedAttributes.contains(attrName)) { visitAttribute(attrType, attrVal); } } }
void visitEntity(AtlasEntityType entityType, AtlasEntity entity) throws AtlasBaseException { List<String> visitedAttributes = new ArrayList<>(); // visit relationship attributes visitRelationships(entityType, entity, visitedAttributes); // visit struct attributes for (AtlasAttribute attribute : entityType.getAllAttributes().values()) { AtlasType attrType = attribute.getAttributeType(); String attrName = attribute.getName(); Object attrVal = entity.getAttribute(attrName); if (entity.hasAttribute(attrName) && !visitedAttributes.contains(attrName)) { visitAttribute(attrType, attrVal); } } }
private void updateAttribute(AtlasEntity entity, String attributeName, Object value) { if(entity.hasAttribute(attributeName) == false) return; try { AtlasVertex vertex = entityGraphRetriever.getEntityVertex(entity.getGuid()); if(vertex == null) { return; } String qualifiedFieldName = getVertexPropertyName(entity, attributeName); List list = vertex.getListProperty(qualifiedFieldName); if (CollectionUtils.isEmpty(list)) { list = new ArrayList(); } if (!list.contains(value)) { list.add(value); vertex.setListProperty(qualifiedFieldName, list); } } catch (AtlasBaseException ex) { LOG.error("error retrieving vertex from guid: {}", entity.getGuid(), ex); } }
public AtlasEntity apply(AtlasEntity entity) throws AtlasBaseException { if(entity != null) { Map<String, List<ImportTransformer>> entityTransforms = getTransforms(entity.getTypeName()); if (MapUtils.isNotEmpty(entityTransforms)) { for (Map.Entry<String, List<ImportTransformer>> entry : entityTransforms.entrySet()) { String attributeName = entry.getKey(); List<ImportTransformer> attrTransforms = entry.getValue(); if (!entity.hasAttribute(attributeName)) { continue; } Object transformedValue = entity.getAttribute(attributeName); for (ImportTransformer attrTransform : attrTransforms) { transformedValue = attrTransform.apply(transformedValue); } entity.setAttribute(attributeName, transformedValue); } } } return entity; }
public AtlasEntity apply(AtlasEntity entity) throws AtlasBaseException { if(entity != null) { Map<String, List<ImportTransformer>> entityTransforms = getTransforms(entity.getTypeName()); if (MapUtils.isNotEmpty(entityTransforms)) { for (Map.Entry<String, List<ImportTransformer>> entry : entityTransforms.entrySet()) { String attributeName = entry.getKey(); List<ImportTransformer> attrTransforms = entry.getValue(); if (!entity.hasAttribute(attributeName)) { continue; } Object transformedValue = entity.getAttribute(attributeName); for (ImportTransformer attrTransform : attrTransforms) { transformedValue = attrTransform.apply(transformedValue); } entity.setAttribute(attributeName, transformedValue); } } } return entity; }
final String pathQualifiedName = toStr(flowPathEntity.getAttribute(ATTR_QUALIFIED_NAME)); final NiFiFlowPath flowPath = new NiFiFlowPath(getComponentIdFromQualifiedName(pathQualifiedName)); if (flowPathEntity.hasAttribute(ATTR_URL)) { final Matcher urlMatcher = FLOW_PATH_URL_PATTERN.matcher(toStr(flowPathEntity.getAttribute(ATTR_URL))); if (urlMatcher.matches()) {