Tabnine Logo
AtlasEntity$AtlasEntitiesWithExtInfo.getEntity
Code IndexAdd Tabnine to your IDE (free)

How to use
getEntity
method
in
org.apache.atlas.model.instance.AtlasEntity$AtlasEntitiesWithExtInfo

Best Java code snippets using org.apache.atlas.model.instance.AtlasEntity$AtlasEntitiesWithExtInfo.getEntity (Showing top 20 results out of 315)

origin: org.apache.atlas/atlas-repository

@Override
@GraphTransaction
public AtlasEntitiesWithExtInfo getByIds(List<String> guids, boolean isMinExtInfo) throws AtlasBaseException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("==> getByIds({}, {})", guids, isMinExtInfo);
  }
  EntityGraphRetriever entityRetriever = new EntityGraphRetriever(typeRegistry);
  AtlasEntitiesWithExtInfo ret = entityRetriever.toAtlasEntitiesWithExtInfo(guids, isMinExtInfo);
  if(ret != null){
    for(String guid : guids){
      AtlasEntity entity = ret.getEntity(guid);
      AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(entity)), "read entity: guid=", guid);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("<== getByIds({}, {}): {}", guids, isMinExtInfo, ret);
  }
  return ret;
}
origin: apache/atlas

@Override
@GraphTransaction
public AtlasEntitiesWithExtInfo getByIds(List<String> guids, boolean isMinExtInfo) throws AtlasBaseException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("==> getByIds({}, {})", guids, isMinExtInfo);
  }
  EntityGraphRetriever entityRetriever = new EntityGraphRetriever(typeRegistry);
  AtlasEntitiesWithExtInfo ret = entityRetriever.toAtlasEntitiesWithExtInfo(guids, isMinExtInfo);
  if(ret != null){
    for(String guid : guids){
      AtlasEntity entity = ret.getEntity(guid);
      AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(typeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(entity)), "read entity: guid=", guid);
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("<== getByIds({}, {}): {}", guids, isMinExtInfo, ret);
  }
  return ret;
}
origin: apache/atlas

@Test
public void testInverseReferenceAutoUpdate_NonComposite_OneToMany() throws Exception {
  AtlasObjectId juliusId = nameIdMap.get("Julius");
  // Change Max's Employee.manager reference to Julius and apply the change as a partial update.
  // This should also update Julius to add Max to the inverse Manager.subordinates reference.
  AtlasEntity maxEntityForUpdate = new AtlasEntity(TestUtilsV2.EMPLOYEE_TYPE);
  maxEntityForUpdate.setAttribute("manager", juliusId);
  AtlasEntityType employeeType = typeRegistry.getEntityTypeByName(TestUtilsV2.EMPLOYEE_TYPE);
  Map<String, Object> uniqAttributes = Collections.<String, Object>singletonMap("name", "Max");
  EntityMutationResponse updateResponse = entityStore.updateByUniqueAttributes(employeeType, uniqAttributes , new AtlasEntityWithExtInfo(maxEntityForUpdate));
  List<AtlasEntityHeader> partialUpdatedEntities = updateResponse.getPartialUpdatedEntities();
  // 3 entities should have been updated:
  // * Max to change the Employee.manager reference
  // * Julius to add Max to Manager.subordinates
  // * Jane to remove Max from Manager.subordinates
  assertEquals(partialUpdatedEntities.size(), 3);
  AtlasObjectId maxId = nameIdMap.get("Max");
  String janeGuid = nameIdMap.get("Jane").getGuid();
  AtlasEntitiesWithExtInfo storedEntities = entityStore.getByIds(ImmutableList.of(maxId.getGuid(), juliusId.getGuid(), janeGuid));
  AtlasEntity storedEntity = storedEntities.getEntity(maxId.getGuid());
  verifyReferenceValue(storedEntity, "manager", juliusId.getGuid());
  storedEntity = storedEntities.getEntity(juliusId.getGuid());
  verifyReferenceList(storedEntity, "subordinates", ImmutableList.of(maxId));
  storedEntity = storedEntities.getEntity(janeGuid);
  verify_testInverseReferenceAutoUpdate_NonComposite_OneToMany(storedEntity);
}
origin: org.apache.atlas/atlas-repository

AtlasEntity storedEntity = storedEntities.getEntity(a1.getGuid());
Object value = storedEntity.getAttribute("mapToB");
assertTrue(value instanceof Map);
referencedEntityId = refMap.get("b2");
assertEquals(referencedEntityId, AtlasTypeUtil.getAtlasObjectId(b2));
storedEntity = storedEntities.getEntity(b1.getGuid());
verifyReferenceValue(storedEntity, "mappedFromA", a1.getGuid());
storedEntity = storedEntities.getEntity(b2.getGuid());
verifyReferenceValue(storedEntity, "mappedFromA", a1.getGuid());
AtlasEntity storedB3 = storedEntities.getEntity(b3.getGuid());
verifyReferenceValue(storedB3, "mappedFromA", a1.getGuid());
verify_testInverseReferenceAutoUpdate_Map(storedEntities.getEntity(a1.getGuid()), storedEntities.getEntity(b1.getGuid()), storedEntities.getEntity(b2.getGuid()), storedB3);
origin: org.apache.atlas/atlas-repository

AtlasEntity maxEntity = updatedEntities.getEntity(maxId.getGuid());
verifyRelationshipAttributeValue(maxEntity, "manager", juliusId.getGuid());
AtlasEntity juliusEntity = updatedEntities.getEntity(juliusId.getGuid());
verifyRelationshipAttributeList(juliusEntity, "subordinates", ImmutableList.of(maxId, mikeId));
AtlasEntity janeEntity = updatedEntities.getEntity(janeId.getGuid());
maxEntity    = updatedEntities.getEntity(maxId.getGuid());
juliusEntity = updatedEntities.getEntity(juliusId.getGuid());
AtlasEntity mikeEntity = updatedEntities.getEntity(mikeId.getGuid());
AtlasEntity johnEntity = updatedEntities.getEntity(johnId.getGuid());
juliusEntity = updatedEntities.getEntity(juliusId.getGuid());
janeEntity   = updatedEntities.getEntity(janeId.getGuid());
mikeEntity   = updatedEntities.getEntity(mikeId.getGuid());
origin: apache/atlas

AtlasEntitiesWithExtInfo updatedEntities = entityStore.getByIds(ImmutableList.of(a1.getGuid(), a2.getGuid(), b.getGuid()));
AtlasEntity a1Entity = updatedEntities.getEntity(a1.getGuid());
verifyRelationshipAttributeValue(a1Entity, "oneB", b.getGuid());
AtlasEntity a2Entity = updatedEntities.getEntity(a2.getGuid());
verifyRelationshipAttributeValue(a2Entity, "oneB", b.getGuid());
AtlasEntity bEntity = updatedEntities.getEntity(b.getGuid());
verifyRelationshipAttributeList(bEntity, "manyA", ImmutableList.of(getAtlasObjectId(a1), getAtlasObjectId(a2)));
a1Entity        = updatedEntities.getEntity(a1.getGuid());
a2Entity        = updatedEntities.getEntity(a2.getGuid());
bEntity         = updatedEntities.getEntity(b.getGuid());
AtlasEntity a3Entity = updatedEntities.getEntity(a3.getGuid());
verifyRelationshipAttributeValue(a3Entity, "oneB", b.getGuid());
origin: org.apache.atlas/atlas-repository

AtlasEntity storedEntity = storedEntities.getEntity(a1.getGuid());
verifyReferenceValue(storedEntity, "oneB", b.getGuid());
storedEntity = storedEntities.getEntity(a2.getGuid());
verifyReferenceValue(storedEntity, "oneB", b.getGuid());
storedEntity = storedEntities.getEntity(b.getGuid());
verifyReferenceList(storedEntity, "manyA", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(a1), AtlasTypeUtil.getAtlasObjectId(a2)));
verifyReferenceValue(storedEntities.getEntity(a3.getGuid()), "oneB", b.getGuid());
verify_testInverseReferenceAutoUpdate_NonCompositeManyToOne(storedEntities.getEntity(a1.getGuid()), storedEntities.getEntity(a2.getGuid()),
  storedEntities.getEntity(a3.getGuid()), storedEntities.getEntity(b.getGuid()));
origin: apache/atlas

AtlasEntitiesWithExtInfo partialUpdatedEntities = entityStore.getByIds(ImmutableList.of(a1.getGuid(), b.getGuid()));
AtlasEntity a1Entity = partialUpdatedEntities.getEntity(a1.getGuid());
verifyRelationshipAttributeValue(a1Entity, "b", b.getGuid());
AtlasEntity bEntity = partialUpdatedEntities.getEntity(b.getGuid());
verifyRelationshipAttributeValue(bEntity, "a", a1.getGuid());
partialUpdatedEntities = entityStore.getByIds(ImmutableList.of(a1.getGuid(), a2.getGuid(), b.getGuid()));
bEntity = partialUpdatedEntities.getEntity(b.getGuid());
verifyRelationshipAttributeValue(bEntity, "a", a2.getGuid());
AtlasEntity a2Entity = partialUpdatedEntities.getEntity(a2.getGuid());
verifyRelationshipAttributeValue(a2Entity, "b", b.getGuid());
a1Entity = partialUpdatedEntities.getEntity(a1.getGuid());
verifyRelationshipAttributeUpdate_NonComposite_OneToOne(a1Entity, bEntity);
origin: apache/atlas

AtlasEntity b1Entity = updatedEntities.getEntity(b1.getGuid());
verifyRelationshipAttributeList(b1Entity, "manyToManyA", ImmutableList.of(getAtlasObjectId(a1), getAtlasObjectId(a2)));
AtlasEntity a1Entity = updatedEntities.getEntity(a1.getGuid());
verifyRelationshipAttributeList(a1Entity, "manyB", ImmutableList.of(getAtlasObjectId(b1)));
AtlasEntity a2Entity = updatedEntities.getEntity(a2.getGuid());
verifyRelationshipAttributeList(a2Entity, "manyB", ImmutableList.of(getAtlasObjectId(b1)));
origin: apache/atlas

assertEquals(partialUpdatedEntities.size(), 3);
AtlasEntitiesWithExtInfo storedEntities = entityStore.getByIds(ImmutableList.of(a1.getGuid(), a2.getGuid(), b1.getGuid()));
AtlasEntity storedEntity = storedEntities.getEntity(b1.getGuid());
verifyReferenceList(storedEntity, "manyToManyA", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(a1), AtlasTypeUtil.getAtlasObjectId(a2)));
storedEntity = storedEntities.getEntity(a1.getGuid());
verifyReferenceList(storedEntity, "manyB", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(b1)));
storedEntity = storedEntities.getEntity(a2.getGuid());
verifyReferenceList(storedEntity, "manyB", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(b1)));
origin: org.apache.atlas/atlas-repository

assertEquals(partialUpdatedEntities.size(), 3);
AtlasEntitiesWithExtInfo storedEntities = entityStore.getByIds(ImmutableList.of(a1.getGuid(), a2.getGuid(), b1.getGuid()));
AtlasEntity storedEntity = storedEntities.getEntity(b1.getGuid());
verifyReferenceList(storedEntity, "manyToManyA", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(a1), AtlasTypeUtil.getAtlasObjectId(a2)));
storedEntity = storedEntities.getEntity(a1.getGuid());
verifyReferenceList(storedEntity, "manyB", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(b1)));
storedEntity = storedEntities.getEntity(a2.getGuid());
verifyReferenceList(storedEntity, "manyB", ImmutableList.of(AtlasTypeUtil.getAtlasObjectId(b1)));
origin: org.apache.atlas/atlas-repository

AtlasEntity b1Entity = updatedEntities.getEntity(b1.getGuid());
verifyRelationshipAttributeList(b1Entity, "manyToManyA", ImmutableList.of(getAtlasObjectId(a1), getAtlasObjectId(a2)));
AtlasEntity a1Entity = updatedEntities.getEntity(a1.getGuid());
verifyRelationshipAttributeList(a1Entity, "manyB", ImmutableList.of(getAtlasObjectId(b1)));
AtlasEntity a2Entity = updatedEntities.getEntity(a2.getGuid());
verifyRelationshipAttributeList(a2Entity, "manyB", ImmutableList.of(getAtlasObjectId(b1)));
origin: org.apache.atlas/atlas-repository

@Test
public void testInverseReferenceAutoUpdate_NonComposite_OneToMany() throws Exception {
  AtlasObjectId juliusId = nameIdMap.get("Julius");
  // Change Max's Employee.manager reference to Julius and apply the change as a partial update.
  // This should also update Julius to add Max to the inverse Manager.subordinates reference.
  AtlasEntity maxEntityForUpdate = new AtlasEntity(TestUtilsV2.EMPLOYEE_TYPE);
  maxEntityForUpdate.setAttribute("manager", juliusId);
  AtlasEntityType employeeType = typeRegistry.getEntityTypeByName(TestUtilsV2.EMPLOYEE_TYPE);
  Map<String, Object> uniqAttributes = Collections.<String, Object>singletonMap("name", "Max");
  EntityMutationResponse updateResponse = entityStore.updateByUniqueAttributes(employeeType, uniqAttributes , new AtlasEntityWithExtInfo(maxEntityForUpdate));
  List<AtlasEntityHeader> partialUpdatedEntities = updateResponse.getPartialUpdatedEntities();
  // 3 entities should have been updated:
  // * Max to change the Employee.manager reference
  // * Julius to add Max to Manager.subordinates
  // * Jane to remove Max from Manager.subordinates
  assertEquals(partialUpdatedEntities.size(), 3);
  AtlasObjectId maxId = nameIdMap.get("Max");
  String janeGuid = nameIdMap.get("Jane").getGuid();
  AtlasEntitiesWithExtInfo storedEntities = entityStore.getByIds(ImmutableList.of(maxId.getGuid(), juliusId.getGuid(), janeGuid));
  AtlasEntity storedEntity = storedEntities.getEntity(maxId.getGuid());
  verifyReferenceValue(storedEntity, "manager", juliusId.getGuid());
  storedEntity = storedEntities.getEntity(juliusId.getGuid());
  verifyReferenceList(storedEntity, "subordinates", ImmutableList.of(maxId));
  storedEntity = storedEntities.getEntity(janeGuid);
  verify_testInverseReferenceAutoUpdate_NonComposite_OneToMany(storedEntity);
}
origin: apache/atlas

public AtlasEntity getEntity(String guid) {
  return entitiesWithExtInfo != null && guid != null ? entitiesWithExtInfo.getEntity(guid) : null;
}
origin: org.apache.atlas/atlas-repository

public AtlasEntity getById(String guid) {
  if( entities != null) {
    return entities.getEntity(guid);
  }
  return null;
}
origin: org.apache.atlas/atlas-repository

@Override
public AtlasEntity getByGuid(String guid) {
  AtlasEntity ent = super.entitiesWithExtInfo.getEntity(guid);
  if(ent == null && entityStream != null) {
    return entityStream.getByGuid(guid);
  }
  return ent;
}
origin: org.apache.atlas/atlas-repository

@Override
public AtlasEntity getByGuid(String guid) {
  return entityStream != null ?  entityStream.getByGuid(guid) : entitiesWithExtInfo.getEntity(guid);
}
origin: apache/atlas

@Override
public AtlasEntity getByGuid(String guid) {
  return entityStream != null ?  entityStream.getByGuid(guid) : entitiesWithExtInfo.getEntity(guid);
}
origin: apache/atlas

@Override
public AtlasEntity getByGuid(String guid) {
  AtlasEntity ent = super.entitiesWithExtInfo.getEntity(guid);
  if(ent == null && entityStream != null) {
    return entityStream.getByGuid(guid);
  }
  return ent;
}
origin: apache/incubator-atlas

public AtlasEntity getById(String guid) {
  if( entities != null) {
    return entities.getEntity(guid);
  }
  return null;
}
org.apache.atlas.model.instanceAtlasEntity$AtlasEntitiesWithExtInfogetEntity

Popular methods of AtlasEntity$AtlasEntitiesWithExtInfo

  • <init>
  • addReferredEntity
  • addEntity
  • getEntities
  • getReferredEntities
  • compact
  • hasEntity
  • removeReferredEntity
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now