Map<String, Object> currentMap = getMapElementsProperty(mapType, ctx.getReferringVertex(), ctx.getVertexProperty(), attribute); boolean isReference = isReference(mapType.getValueType()); boolean isSoftReference = ctx.getAttribute().getAttributeDef().isSoftReferenced();
AtlasType elementType = arrType.getElementType(); boolean isReference = isReference(elementType); boolean isSoftReference = ctx.getAttribute().getAttributeDef().isSoftReferenced(); AtlasAttribute inverseRefAttribute = attribute.getInverseRefAttribute(); Cardinality cardinality = attribute.getAttributeDef().getCardinality();
@Test public void typeCreationFromFile() throws IOException, AtlasBaseException { String typesDefJson = TestResourceFileUtils.getJson(TYPESDEF_FILE_NAME); AtlasTypesDef typesDef = AtlasType.fromJson(typesDefJson, AtlasTypesDef.class); assertNotNull(typesDef); typeDefStore.createTypesDef(typesDef); dbType = typeRegistry.getType(TYPE_RDBMS_DB); assertNotNull(dbType); AtlasEntityDef dbType = typeRegistry.getEntityDefByName(TYPE_RDBMS_DB); assertNotNull(dbType); assertTrue(dbType.getAttribute(RDBMS_DB_STORAGE_PROPERTY).isSoftReferenced()); assertTrue(dbType.getAttribute(RDBMS_DB_TABLES_PROPERTY).isSoftReferenced()); assertTrue(dbType.getAttribute(RDBMS_DB_REGIONS_PROPERTY).isSoftReferenced()); assertNotNull(typeRegistry.getEntityDefByName(TYPE_RDBMS_STORAGE)); assertNotNull(typeRegistry.getEntityDefByName(TYPE_RDBMS_TABLES)); }
if (ctx.getAttributeDef().isSoftReferenced()) { return mapSoftRefValueWithUpdate(ctx, context);
break; case OBJECT_ID_TYPE: if(attribute.getAttributeDef().isSoftReferenced()) { ret = mapVertexToObjectIdForSoftRef(entityVertex, attribute, entityExtInfo, isMinExtInfo); } else { if(attribute.getAttributeDef().isSoftReferenced()) { ret = mapVertexToArrayForSoftRef(entityVertex, attribute, entityExtInfo, isMinExtInfo); } else { if(attribute.getAttributeDef().isSoftReferenced()) { ret = mapVertexToMapForSoftRef(entityVertex, attribute, entityExtInfo, isMinExtInfo); } else {
private Object mapCollectionElementsToVertex(AttributeMutationContext ctx, EntityMutationContext context) throws AtlasBaseException { switch(ctx.getAttrType().getTypeCategory()) { case PRIMITIVE: case ENUM: case MAP: case ARRAY: return ctx.getValue(); case STRUCT: return mapStructValue(ctx, context); case OBJECT_ID_TYPE: AtlasEntityType instanceType = getInstanceType(ctx.getValue()); ctx.setElementType(instanceType); if (ctx.getAttributeDef().isSoftReferenced()) { return mapSoftRefValue(ctx, context); } return mapObjectIdValueUsingRelationship(ctx, context); default: throw new AtlasBaseException(AtlasErrorCode.TYPE_CATEGORY_INVALID, ctx.getAttrType().getTypeCategory().name()); } }
private void updateInConsistentOwnedMapVertices(AttributeMutationContext ctx, AtlasMapType mapType, Object val) { if (mapType.getValueType().getTypeCategory() == TypeCategory.OBJECT_ID_TYPE && !ctx.getAttributeDef().isSoftReferenced()) { AtlasEdge edge = (AtlasEdge) val; if (ctx.getAttribute().isOwnedRef() && getStatus(edge) == DELETED && getStatus(edge.getInVertex()) == DELETED) { //Resurrect the vertex and edge to ACTIVE state AtlasGraphUtilsV2.setEncodedProperty(edge, STATE_PROPERTY_KEY, ACTIVE.name()); AtlasGraphUtilsV2.setEncodedProperty(edge.getInVertex(), STATE_PROPERTY_KEY, ACTIVE.name()); } } }