Search in sources :

Example 11 with GraphTransaction

use of org.apache.atlas.annotation.GraphTransaction in project incubator-atlas by apache.

the class AtlasEntityStoreV1 method getById.

@Override
@GraphTransaction
public AtlasEntityWithExtInfo getById(String guid) throws AtlasBaseException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("==> getById({})", guid);
    }
    EntityGraphRetriever entityRetriever = new EntityGraphRetriever(typeRegistry);
    AtlasEntityWithExtInfo ret = entityRetriever.toAtlasEntityWithExtInfo(guid);
    if (ret == null) {
        throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid);
    }
    if (LOG.isDebugEnabled()) {
        LOG.debug("<== getById({}): {}", guid, ret);
    }
    return ret;
}
Also used : AtlasBaseException(org.apache.atlas.exception.AtlasBaseException) AtlasEntityWithExtInfo(org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo) GraphTransaction(org.apache.atlas.annotation.GraphTransaction)

Example 12 with GraphTransaction

use of org.apache.atlas.annotation.GraphTransaction in project incubator-atlas by apache.

the class AtlasTypeDefGraphStore method updateClassificationDefByName.

@Override
@GraphTransaction
public AtlasClassificationDef updateClassificationDefByName(String name, AtlasClassificationDef classificationDef) throws AtlasBaseException {
    AtlasTransientTypeRegistry ttr = lockTypeRegistryAndReleasePostCommit();
    tryUpdateByName(name, classificationDef, ttr);
    return getClassificationDefStore(ttr).updateByName(name, classificationDef);
}
Also used : AtlasTransientTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry.AtlasTransientTypeRegistry) GraphTransaction(org.apache.atlas.annotation.GraphTransaction)

Example 13 with GraphTransaction

use of org.apache.atlas.annotation.GraphTransaction in project incubator-atlas by apache.

the class AtlasTypeDefGraphStore method updateStructDefByGuid.

@Override
@GraphTransaction
public AtlasStructDef updateStructDefByGuid(String guid, AtlasStructDef structDef) throws AtlasBaseException {
    AtlasTransientTypeRegistry ttr = lockTypeRegistryAndReleasePostCommit();
    tryUpdateByGUID(guid, structDef, ttr);
    return getStructDefStore(ttr).updateByGuid(guid, structDef);
}
Also used : AtlasTransientTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry.AtlasTransientTypeRegistry) GraphTransaction(org.apache.atlas.annotation.GraphTransaction)

Example 14 with GraphTransaction

use of org.apache.atlas.annotation.GraphTransaction in project incubator-atlas by apache.

the class AtlasTypeDefGraphStore method updateEntityDefByGuid.

@Override
@GraphTransaction
public AtlasEntityDef updateEntityDefByGuid(String guid, AtlasEntityDef entityDef) throws AtlasBaseException {
    AtlasTransientTypeRegistry ttr = lockTypeRegistryAndReleasePostCommit();
    tryUpdateByGUID(guid, entityDef, ttr);
    return getEntityDefStore(ttr).updateByGuid(guid, entityDef);
}
Also used : AtlasTransientTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry.AtlasTransientTypeRegistry) GraphTransaction(org.apache.atlas.annotation.GraphTransaction)

Example 15 with GraphTransaction

use of org.apache.atlas.annotation.GraphTransaction in project incubator-atlas by apache.

the class AtlasTypeDefGraphStore method updateStructDefByName.

@Override
@GraphTransaction
public AtlasStructDef updateStructDefByName(String name, AtlasStructDef structDef) throws AtlasBaseException {
    AtlasTransientTypeRegistry ttr = lockTypeRegistryAndReleasePostCommit();
    tryUpdateByName(name, structDef, ttr);
    return getStructDefStore(ttr).updateByName(name, structDef);
}
Also used : AtlasTransientTypeRegistry(org.apache.atlas.type.AtlasTypeRegistry.AtlasTransientTypeRegistry) GraphTransaction(org.apache.atlas.annotation.GraphTransaction)

Aggregations

GraphTransaction (org.apache.atlas.annotation.GraphTransaction)34 AtlasTransientTypeRegistry (org.apache.atlas.type.AtlasTypeRegistry.AtlasTransientTypeRegistry)12 AtlasBaseException (org.apache.atlas.exception.AtlasBaseException)11 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)11 AtlasException (org.apache.atlas.AtlasException)6 RepositoryException (org.apache.atlas.repository.RepositoryException)6 ArrayList (java.util.ArrayList)5 RequestContext (org.apache.atlas.RequestContext)4 AtlasEntityWithExtInfo (org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo)4 EntityMutationResponse (org.apache.atlas.model.instance.EntityMutationResponse)4 CreateUpdateEntitiesResult (org.apache.atlas.CreateUpdateEntitiesResult)3 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)3 GuidMapping (org.apache.atlas.model.instance.GuidMapping)3 AtlasTypesDef (org.apache.atlas.model.typedef.AtlasTypesDef)3 AtlasClassification (org.apache.atlas.model.instance.AtlasClassification)2 EntityResult (org.apache.atlas.model.legacy.EntityResult)2 AtlasClassificationDef (org.apache.atlas.model.typedef.AtlasClassificationDef)2 AtlasEntityDef (org.apache.atlas.model.typedef.AtlasEntityDef)2 AtlasEnumDef (org.apache.atlas.model.typedef.AtlasEnumDef)2 AtlasStructDef (org.apache.atlas.model.typedef.AtlasStructDef)2