Search in sources :

Example 46 with AtlasObjectId

use of org.apache.atlas.model.instance.AtlasObjectId in project incubator-atlas by apache.

the class AtlasEntityStoreV1 method deleteVertices.

private EntityMutationResponse deleteVertices(Collection<AtlasVertex> deletionCandidates) throws AtlasBaseException {
    EntityMutationResponse response = new EntityMutationResponse();
    deleteHandler.deleteEntities(deletionCandidates);
    RequestContextV1 req = RequestContextV1.get();
    for (AtlasObjectId id : req.getDeletedEntityIds()) {
        response.addEntity(DELETE, EntityGraphMapper.constructHeader(id));
    }
    for (AtlasObjectId id : req.getUpdatedEntityIds()) {
        response.addEntity(UPDATE, EntityGraphMapper.constructHeader(id));
    }
    return response;
}
Also used : RequestContextV1(org.apache.atlas.RequestContextV1) EntityMutationResponse(org.apache.atlas.model.instance.EntityMutationResponse) AtlasObjectId(org.apache.atlas.model.instance.AtlasObjectId)

Aggregations

AtlasObjectId (org.apache.atlas.model.instance.AtlasObjectId)46 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)27 Test (org.testng.annotations.Test)17 Map (java.util.Map)15 EntityMutationResponse (org.apache.atlas.model.instance.EntityMutationResponse)15 AtlasEntityHeader (org.apache.atlas.model.instance.AtlasEntityHeader)13 ArrayList (java.util.ArrayList)12 HashMap (java.util.HashMap)11 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)11 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)11 BeforeTest (org.testng.annotations.BeforeTest)11 AtlasEntityType (org.apache.atlas.type.AtlasEntityType)10 AtlasEntitiesWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo)7 List (java.util.List)6 AtlasEntityWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo)5 AtlasStruct (org.apache.atlas.model.instance.AtlasStruct)5 RequestContextV1 (org.apache.atlas.RequestContextV1)4 AtlasExportRequest (org.apache.atlas.model.impexp.AtlasExportRequest)4 TestUtils.randomString (org.apache.atlas.TestUtils.randomString)3 AtlasEntityDef (org.apache.atlas.model.typedef.AtlasEntityDef)3