@JsonIgnore @Override public AtlasEntity getEntity(String guid) { AtlasEntity ret = super.getEntity(guid); if (ret == null && CollectionUtils.isNotEmpty(entities)) { for (AtlasEntity entity : entities) { if (StringUtils.equals(guid, entity.getGuid())) { ret = entity; break; } } } return ret; }
@JsonIgnore @Override public AtlasEntity getEntity(String guid) { AtlasEntity ret = super.getEntity(guid); if (ret == null && entity != null) { if (StringUtils.equals(guid, entity.getGuid())) { ret = entity; } } return ret; }
if (followReferences) { AtlasObjectId objectId = (AtlasObjectId) value; AtlasEntity entity = entityExtInfo.getEntity(objectId.getGuid());
private AtlasEntity mapVertexToAtlasEntityMin(AtlasVertex entityVertex, AtlasEntityExtInfo entityExtInfo, Set<String> attributes) throws AtlasBaseException { String guid = GraphHelper.getGuid(entityVertex); AtlasEntity entity = entityExtInfo != null ? entityExtInfo.getEntity(guid) : null; if (entity == null) { entity = new AtlasEntity(); if (entityExtInfo != null) { entityExtInfo.addReferredEntity(guid, entity); } mapSystemAttributes(entityVertex, entity); mapClassifications(entityVertex, entity); AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entity.getTypeName()); if (entityType != null) { for (AtlasAttribute attribute : entityType.getMinInfoAttributes().values()) { Object attrValue = getVertexAttribute(entityVertex, attribute); if (attrValue != null) { entity.setAttribute(attribute.getName(), attrValue); } } } } return entity; }
private AtlasEntity mapVertexToAtlasEntityMin(AtlasVertex entityVertex, AtlasEntityExtInfo entityExtInfo, Set<String> attributes) throws AtlasBaseException { String guid = GraphHelper.getGuid(entityVertex); AtlasEntity entity = entityExtInfo != null ? entityExtInfo.getEntity(guid) : null; if (entity == null) { entity = new AtlasEntity(); if (entityExtInfo != null) { entityExtInfo.addReferredEntity(guid, entity); } mapSystemAttributes(entityVertex, entity); mapClassifications(entityVertex, entity); AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entity.getTypeName()); if (entityType != null) { for (AtlasAttribute attribute : entityType.getMinInfoAttributes().values()) { Object attrValue = getVertexAttribute(entityVertex, attribute); if (attrValue != null) { entity.setAttribute(attribute.getName(), attrValue); } } } } return entity; }
private AtlasEntity mapVertexToAtlasEntity(AtlasVertex entityVertex, AtlasEntityExtInfo entityExtInfo, boolean isMinExtInfo) throws AtlasBaseException { String guid = GraphHelper.getGuid(entityVertex); AtlasEntity entity = entityExtInfo != null ? entityExtInfo.getEntity(guid) : null; if (entity == null) { if (LOG.isDebugEnabled()) { LOG.debug("Mapping graph vertex to atlas entity for guid {}", guid); } entity = new AtlasEntity(); if (entityExtInfo != null) { entityExtInfo.addReferredEntity(guid, entity); } mapSystemAttributes(entityVertex, entity); mapAttributes(entityVertex, entity, entityExtInfo, isMinExtInfo); if (!ignoreRelationshipAttr) { // only map when really needed mapRelationshipAttributes(entityVertex, entity); } mapClassifications(entityVertex, entity); } return entity; }
private AtlasEntity mapVertexToAtlasEntity(AtlasVertex entityVertex, AtlasEntityExtInfo entityExtInfo, boolean isMinExtInfo) throws AtlasBaseException { String guid = GraphHelper.getGuid(entityVertex); AtlasEntity entity = entityExtInfo != null ? entityExtInfo.getEntity(guid) : null; if (entity == null) { if (LOG.isDebugEnabled()) { LOG.debug("Mapping graph vertex to atlas entity for guid {}", guid); } entity = new AtlasEntity(); if (entityExtInfo != null) { entityExtInfo.addReferredEntity(guid, entity); } mapSystemAttributes(entityVertex, entity); mapAttributes(entityVertex, entity, entityExtInfo, isMinExtInfo); mapRelationshipAttributes(entityVertex, entity); mapClassifications(entityVertex, entity); } return entity; }
public boolean hasEntity(String guid) { return getEntity(guid) != null; }
protected void validateEntity(AtlasEntityExtInfo entityExtInfo, AtlasEntity actual) throws AtlasBaseException, AtlasException { validateEntity(entityExtInfo, actual, entityExtInfo.getEntity(actual.getGuid())); }
public boolean hasEntity(String guid) { return getEntity(guid) != null; }
protected void validateEntity(AtlasEntityExtInfo entityExtInfo, AtlasEntity actual) throws AtlasBaseException, AtlasException { validateEntity(entityExtInfo, actual, entityExtInfo.getEntity(actual.getGuid())); }
@JsonIgnore @Override public AtlasEntity getEntity(String guid) { AtlasEntity ret = super.getEntity(guid); if (ret == null && CollectionUtils.isNotEmpty(entities)) { for (AtlasEntity entity : entities) { if (StringUtils.equals(guid, entity.getGuid())) { ret = entity; break; } } } return ret; }
@JsonIgnore @Override public AtlasEntity getEntity(String guid) { AtlasEntity ret = super.getEntity(guid); if (ret == null && entity != null) { if (StringUtils.equals(guid, entity.getGuid())) { ret = entity; } } return ret; }
public void updateEntityGuid(String oldGuid, String newGuid) { AtlasEntity entity = getEntity(oldGuid); if (entity != null) { entity.setGuid(newGuid); if(removeEntity(oldGuid) != null) { addReferredEntity(newGuid, entity); } } }
private void renameColumns(List<AtlasObjectId> columns, AtlasEntityExtInfo oldEntityExtInfo, String newTableQualifiedName, List<HookNotification> notifications) { if (CollectionUtils.isNotEmpty(columns)) { for (AtlasObjectId columnId : columns) { AtlasEntity oldColumn = oldEntityExtInfo.getEntity(columnId.getGuid()); AtlasObjectId oldColumnId = new AtlasObjectId(oldColumn.getTypeName(), ATTRIBUTE_QUALIFIED_NAME, oldColumn.getAttribute(ATTRIBUTE_QUALIFIED_NAME)); AtlasEntity newColumn = new AtlasEntity(oldColumn.getTypeName(), ATTRIBUTE_QUALIFIED_NAME, getColumnQualifiedName(newTableQualifiedName, (String) oldColumn.getAttribute(ATTRIBUTE_NAME))); notifications.add(new EntityPartialUpdateRequestV2(getUserName(), oldColumnId, new AtlasEntityWithExtInfo(newColumn))); } } }
public void updateEntityGuid(String oldGuid, String newGuid) { AtlasEntity entity = getEntity(oldGuid); if (entity != null) { entity.setGuid(newGuid); if(removeEntity(oldGuid) != null) { addReferredEntity(newGuid, entity); } } }