@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(final AtlasGlossaryTerm obj) throws AtlasBaseException { if (LOG.isDebugEnabled()) { LOG.debug("==> AtlasGlossaryTermDTO.toEntityWithExtInfo()", obj); } Objects.requireNonNull(obj, "atlasGlossaryTerm"); AtlasEntity entity = toEntity(obj); AtlasEntity.AtlasEntityWithExtInfo ret = new AtlasEntity.AtlasEntityWithExtInfo(entity); if (LOG.isDebugEnabled()) { LOG.debug("<== AtlasGlossaryTermDTO.toEntityWithExtInfo() : {}", ret); } return ret; }
@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(final AtlasGlossaryCategory obj) throws AtlasBaseException { if (LOG.isDebugEnabled()) { LOG.debug("==> AtlasGlossaryCategoryDTO.toEntityWithExtInfo()", obj); } Objects.requireNonNull(obj, "atlasGlossaryCategory"); AtlasEntity.AtlasEntityWithExtInfo ret = new AtlasEntity.AtlasEntityWithExtInfo(toEntity(obj)); if (LOG.isDebugEnabled()) { LOG.debug("<== AtlasGlossaryCategoryDTO.toEntityWithExtInfo() : {}", ret); } return ret; }
@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(final AtlasGlossaryCategory obj) throws AtlasBaseException { if (LOG.isDebugEnabled()) { LOG.debug("==> AtlasGlossaryCategoryDTO.toEntityWithExtInfo()", obj); } Objects.requireNonNull(obj, "atlasGlossaryCategory"); AtlasEntity.AtlasEntityWithExtInfo ret = new AtlasEntity.AtlasEntityWithExtInfo(toEntity(obj)); if (LOG.isDebugEnabled()) { LOG.debug("<== AtlasGlossaryCategoryDTO.toEntityWithExtInfo() : {}", ret); } return ret; }
@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(final AtlasGlossary obj) throws AtlasBaseException { if (LOG.isDebugEnabled()) { LOG.debug("==> AtlasGlossaryDTO.toEntityWithExtInfo()", obj); } Objects.requireNonNull(obj, "atlasGlossary"); AtlasEntity entity = toEntity(obj); AtlasEntity.AtlasEntityWithExtInfo ret = new AtlasEntity.AtlasEntityWithExtInfo(entity); if (LOG.isDebugEnabled()) { LOG.debug("<== AtlasGlossaryDTO.toEntityWithExtInfo() : {}", ret); } return ret; }
@Override public AtlasEntityWithExtInfo toEntityWithExtInfo(AtlasUserSavedSearch obj) throws AtlasBaseException { return new AtlasEntityWithExtInfo(toEntity(obj)); }
@Override public AtlasEntityWithExtInfo toEntityWithExtInfo(AtlasUserSavedSearch obj) throws AtlasBaseException { return new AtlasEntityWithExtInfo(toEntity(obj)); }
@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(ExportImportAuditEntry obj) throws AtlasBaseException { return new AtlasEntity.AtlasEntityWithExtInfo(toEntity(obj)); }
private AtlasEntity createInstance(AtlasEntity entity, String[] traitNames) throws Exception { AtlasEntity ret = null; EntityMutationResponse response = atlasClientV2.createEntity(new AtlasEntityWithExtInfo(entity)); List<AtlasEntityHeader> entities = response.getEntitiesByOperation(EntityOperation.CREATE); if (CollectionUtils.isNotEmpty(entities)) { AtlasEntityWithExtInfo getByGuidResponse = atlasClientV2.getEntityByGuid(entities.get(0).getGuid()); ret = getByGuidResponse.getEntity(); System.out.println("Created entity of type [" + ret.getTypeName() + "], guid: " + ret.getGuid()); } return ret; }
protected AtlasEntityWithExtInfo toTableEntity(Table table) throws Exception { AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(); AtlasEntity entity = toTableEntity(table, ret); if (entity != null) { ret.setEntity(entity); } else { ret = null; } return ret; }
@Override public AtlasEntityWithExtInfo getNextEntityWithExtInfo() { currentPosition++; AtlasEntity entity = next(); return entity != null ? new AtlasEntityWithExtInfo(entity, super.entitiesWithExtInfo) : null; }
private AtlasEntityWithExtInfo getAtlasEntityWithExtInfo() { AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(getHiveTableAtlasEntity()); Map<String, AtlasEntity> referredEntities = new HashMap<>(); referredEntities.put("0", getHiveColumnAtlasEntity(1)); referredEntities.put("1", getHiveColumnAtlasEntity(2)); referredEntities.put("2", getHiveColumnAtlasEntity(3)); ret.setReferredEntities(referredEntities); return ret; } }
@Override public AtlasEntity.AtlasEntityWithExtInfo toEntityWithExtInfo(AtlasServer obj) { return new AtlasEntity.AtlasEntityWithExtInfo(toEntity(obj)); }
public AtlasEntityWithExtInfo toAtlasEntityWithExtInfo(AtlasVertex entityVertex, boolean isMinExtInfo) throws AtlasBaseException { AtlasEntityExtInfo entityExtInfo = new AtlasEntityExtInfo(); AtlasEntity entity = mapVertexToAtlasEntity(entityVertex, entityExtInfo, isMinExtInfo); AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(entity, entityExtInfo); ret.compact(); return ret; }
private AtlasEntityWithExtInfo getAtlasEntityWithExtInfo() { AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(getHiveTableAtlasEntity()); Map<String, AtlasEntity> referredEntities = new HashMap<>(); referredEntities.put("0", getHiveColumnAtlasEntity(1)); referredEntities.put("1", getHiveColumnAtlasEntity(2)); referredEntities.put("2", getHiveColumnAtlasEntity(3)); ret.setReferredEntities(referredEntities); return ret; } }
public static AtlasEntityWithExtInfo createprimitiveEntityV2() { AtlasEntity defaultprimitive = new AtlasEntity(createPrimitiveEntityDef()); defaultprimitive.setAttribute("name", "testname"); defaultprimitive.setAttribute("description","test"); defaultprimitive.setAttribute("check","check"); AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(defaultprimitive); return ret; }
public static AtlasEntityWithExtInfo createDBEntityV2() { AtlasEntity dbEntity = new AtlasEntity(DATABASE_TYPE); dbEntity.setAttribute(NAME, RandomStringUtils.randomAlphanumeric(10)); dbEntity.setAttribute("description", "us db"); return new AtlasEntityWithExtInfo(dbEntity); }
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 AtlasEntityWithExtInfo toAtlasEntityWithExtInfo(AtlasVertex entityVertex, boolean isMinExtInfo) throws AtlasBaseException { AtlasEntityExtInfo entityExtInfo = new AtlasEntityExtInfo(); AtlasEntity entity = mapVertexToAtlasEntity(entityVertex, entityExtInfo, isMinExtInfo); AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(entity, entityExtInfo); ret.compact(); return ret; }
private void renameStorageDesc(AtlasEntityWithExtInfo oldEntityExtInfo, AtlasEntityWithExtInfo newEntityExtInfo, List<HookNotification> notifications) { AtlasEntity oldSd = getStorageDescEntity(oldEntityExtInfo); AtlasEntity newSd = getStorageDescEntity(newEntityExtInfo); if (oldSd != null && newSd != null) { AtlasObjectId oldSdId = new AtlasObjectId(oldSd.getTypeName(), ATTRIBUTE_QUALIFIED_NAME, oldSd.getAttribute(ATTRIBUTE_QUALIFIED_NAME)); newSd.removeAttribute(ATTRIBUTE_TABLE); notifications.add(new EntityPartialUpdateRequestV2(getUserName(), oldSdId, new AtlasEntityWithExtInfo(newSd))); } }
@Override public AtlasEntityWithExtInfo getNextEntityWithExtInfo() { currentPosition++; AtlasEntity entity = next(); return entity != null ? new AtlasEntityWithExtInfo(entity, super.entitiesWithExtInfo) : null; }