extInfo.addReferredEntity(bucketEntity);
if (followReferences) { AtlasObjectId objectId = (AtlasObjectId) value; AtlasEntity entity = entityExtInfo.getEntity(objectId.getGuid());
@Override public void compact() { super.compact(); // remove 'entities' from referredEntities if (CollectionUtils.isNotEmpty(entities)) { for (AtlasEntity entity : entities) { removeReferredEntity(entity.getGuid()); } } }
dbEntity.setAttribute(AtlasConstants.CLUSTER_NAME_ATTRIBUTE, getClusterName(stormConf)); entityExtInfo.addReferredEntity(dbEntity); entityExtInfo.addReferredEntity(ret);
entityExtInfo.addReferredEntity(sd); entityExtInfo.addReferredEntity(partitionKey); entityExtInfo.addReferredEntity(column);
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; }
protected void validateEntity(AtlasEntityExtInfo entityExtInfo, AtlasEntity actual) throws AtlasBaseException, AtlasException { validateEntity(entityExtInfo, actual, entityExtInfo.getEntity(actual.getGuid())); }
public AtlasEntityExtInfo(AtlasEntity referredEntity) { addReferredEntity(referredEntity); }
@JsonIgnore public final void addReferredEntity(AtlasEntity entity) { addReferredEntity(entity.getGuid(), entity); }
public boolean hasEntity(String guid) { return getEntity(guid) != null; }
public AtlasEntityExtInfo(AtlasEntity referredEntity) { addReferredEntity(referredEntity); }
@JsonIgnore public final void addReferredEntity(AtlasEntity entity) { addReferredEntity(entity.getGuid(), entity); }
@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 && CollectionUtils.isNotEmpty(entities)) { for (AtlasEntity entity : entities) { if (StringUtils.equals(guid, entity.getGuid())) { ret = entity; break; } } } return ret; }
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; }
@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; }