Unlinks all the edges between iSourceVertex and iTargetVertex

@param iDatabase
@param iSourceVertex
@param iTargetVertex
160437
public static void unlink(final ODatabaseGraphTx iDatabase, final ODocument iSourceVertex, final ODocument iTargetVertex) {
		if (iTargetVertex == null)
			throw new IllegalArgumentException("Missed the target vertex");

		if (iDatabase.existsUserObjectByRID(iSourceVertex.getIdentity())) {
			// WORK ALSO WITH IN MEMORY OBJECTS

			final OGraphVertex vertex = (OGraphVertex) iDatabase.getUserObjectByRecord(iSourceVertex, null);
			// REMOVE THE EDGE OBJECT
			if (vertex.out != null) {
				final Set<OGraphEdge> obj = vertex.out.get();
				if (obj != null)
					for (OGraphEdge e : obj)
						if (e.getIn().getDocument().equals(iTargetVertex))
							obj.remove(e);
			}
		}

		if (iDatabase.existsUserObjectByRID(iTargetVertex.getIdentity())) {
			// WORK ALSO WITH IN MEMORY OBJECTS

			final OGraphVertex vertex = (OGraphVertex) iDatabase.getUserObjectByRecord(iTargetVertex, null);
			// REMOVE THE EDGE OBJECT FROM THE TARGET VERTEX
			if (vertex.in != null) {
				final Set<OGraphEdge> obj = vertex.in.get();
				if (obj != null)
					for (OGraphEdge e : obj)
						if (e.getOut().getDocument().equals(iSourceVertex))
							obj.remove(e);
			}
		}

		final List<ODocument> edges2Remove = new ArrayList<ODocument>();

		// REMOVE THE EDGE DOCUMENT
		ODocument edge = null;
		Set<ODocument> docs = iSourceVertex.field(OGraphDatabase.VERTEX_FIELD_OUT);
		if (docs != null) {
			// USE A TEMP ARRAY TO AVOID CONCURRENT MODIFICATION TO THE ITERATOR
			for (OIdentifiable d : docs) {
				final ODocument doc = (ODocument) d.getRecord();
				if (doc.field(OGraphDatabase.EDGE_FIELD_IN).equals(iTargetVertex)) {
					edges2Remove.add(doc);
					edge = doc;
				}
			}

			for (ODocument d : edges2Remove)
				docs.remove(d);
		}

		if (edge == null)
			throw new OGraphException("Edge not found between the ougoing edges");

		iSourceVertex.setDirty();
		iSourceVertex.save();

		docs = iTargetVertex.field(OGraphDatabase.VERTEX_FIELD_IN);

		// REMOVE THE EDGE DOCUMENT FROM THE TARGET VERTEX
		if (docs != null) {
			edges2Remove.clear();

			for (OIdentifiable d : docs) {
				final ODocument doc = (ODocument) d.getRecord();
				if (doc.field(OGraphDatabase.EDGE_FIELD_IN).equals(iTargetVertex))
					edges2Remove.add(doc);
			}

			for (ODocument d : edges2Remove)
				docs.remove(d);
		}

		iTargetVertex.setDirty();
		iTargetVertex.save();

		edge.delete();
	}
607855
public static EntityUnlinkOperation unlinkOptions(String contentKeyAuthorizationPolicyId,
            String contentKeyAuthorizationPolicyOptionId) {
        return new EntityUnlinkOperation(ENTITY_SET, contentKeyAuthorizationPolicyId, "Options", contentKeyAuthorizationPolicyOptionId);
    }
1156276
void unlinkNode(int index, int lastLookup, int lookup) {

        // A VoltDB extension to diagnose ArrayOutOfBounds.
        voltDBhistory[voltDBhistoryDepth++ % voltDBhistoryCapacity] = -index-1;
        // End of VoltDB extension
        // unlink the node
        if (lastLookup == -1) {
            hashTable[index] = linkTable[lookup];
        } else {
            linkTable[lastLookup] = linkTable[lookup];
        }

        // add to reclaimed list
        linkTable[lookup]    = reclaimedNodePointer;
        reclaimedNodePointer = lookup;

        elementCount--;
    }
208508
public boolean unlink(Object source, String attributeName, Object target)
    {
        return linkOrUnlink(false, source, attributeName, false);
    }
1164781
private void convert(final int iIndex) {
    if (converted || !convertToRecord)
      return;

    Object o = list.get(iIndex);
    if (o == null) {

      final ODatabaseRecord database = getDatabase().getUnderlying();

      o = recordList.get(iIndex);
      ODocument doc;
      if (o instanceof ORID) {
        doc = database.load((ORID) o, fetchPlan);
      } else {
        doc = (ODocument) o;
      }
      list.set(iIndex,
          OObjectEntityEnhancer.getInstance().getProxiedInstance(doc.getClassName(), getDatabase().getEntityManager(), doc));
    }
  }
268652
protected void deleteTypeVertex(AtlasVertex instanceVertex, boolean force) throws AtlasBaseException {
        LOG.debug("Deleting {}", string(instanceVertex));
        String typeName = GraphHelper.getTypeName(instanceVertex);


        AtlasType parentType = typeRegistry.getType(typeName);

        if (parentType instanceof AtlasStructType) {
            AtlasStructType structType   = (AtlasStructType) parentType;
            boolean         isEntityType = (parentType instanceof AtlasEntityType);

            for (AtlasStructType.AtlasAttribute attributeInfo : structType.getAllAttributes().values()) {
                LOG.debug("Deleting attribute {} for {}", attributeInfo.getName(), string(instanceVertex));
                boolean isOwned = isEntityType && attributeInfo.isOwnedRef();

                AtlasType attrType = attributeInfo.getAttributeType();

                String edgeLabel = AtlasGraphUtilsV1.getAttributeEdgeLabel(structType, attributeInfo.getName());

                switch (attrType.getTypeCategory()) {
                case OBJECT_ID_TYPE:
                    //If its class attribute, delete the reference
                    deleteEdgeReference(instanceVertex, edgeLabel, attrType.getTypeCategory(), isOwned);
                    break;

                case STRUCT:
                    //If its struct attribute, delete the reference
                    deleteEdgeReference(instanceVertex, edgeLabel, attrType.getTypeCategory(), false);
                    break;

                case ARRAY:
                    //For array attribute, if the element is struct/class, delete all the references
                    AtlasArrayType arrType = (AtlasArrayType) attrType;
                    AtlasType elemType = arrType.getElementType();
                    if (AtlasGraphUtilsV1.isReference(elemType.getTypeCategory())) {
                        Iterator<AtlasEdge> edges = graphHelper.getOutGoingEdgesByLabel(instanceVertex, edgeLabel);
                        if (edges != null) {
                            while (edges.hasNext()) {
                                AtlasEdge edge = edges.next();
                                deleteEdgeReference(edge, elemType.getTypeCategory(), isOwned, false);
                            }
                        }
                    }
                    break;

                case MAP:
                    //For map attribute, if the value type is struct/class, delete all the references
                    AtlasMapType mapType = (AtlasMapType) attrType;
                    AtlasType keyType = mapType.getKeyType();
                    TypeCategory valueTypeCategory = mapType.getValueType().getTypeCategory();
                    String propertyName = AtlasGraphUtilsV1.getQualifiedAttributePropertyKey(structType, attributeInfo.getName());

                    if (AtlasGraphUtilsV1.isReference(valueTypeCategory)) {
                        List<Object> keys = EntityGraphMapper.getArrayElementsProperty(keyType, instanceVertex, propertyName);
                        if (keys != null) {
                            for (Object key : keys) {
                                String mapEdgeLabel = GraphHelper.getQualifiedNameForMapKey(edgeLabel, (String) key);
                                deleteEdgeReference(instanceVertex, mapEdgeLabel, valueTypeCategory, isOwned);
                            }
                        }
                    }
                }
            }
        }

        deleteVertex(instanceVertex, force);
    }
65859
public function removeEdge( $sourceNode, $targetNode )
	{
		if( !$this->isEdge( $sourceNode, $targetNode ) )
			throw new Exception( 'Edge is not existing.' );
		$index = $this->getEdgeIndex( $sourceNode, $targetNode );
		unset( $this->edges[$index] );
		sort( $this->edges );
	}
574133
public final void invalidateAllKeys(String dataStructureName, String sourceUuid) {
        checkNotNull(sourceUuid, "sourceUuid cannot be null");

        int orderKey = getPartitionId(dataStructureName);
        Invalidation invalidation = newClearInvalidation(dataStructureName, sourceUuid);
        sendImmediately(invalidation, orderKey);
    }
152981
private void deleteLinks(@NotNull final PersistentStoreTransaction txn, @NotNull final PersistentEntity entity) {
        final PersistentEntityId id = entity.getId();
        final int entityTypeId = id.getTypeId();
        final long entityLocalId = id.getLocalId();
        final Transaction envTxn = txn.getEnvironmentTransaction();
        final LinksTable links = getLinksTable(txn, entityTypeId);
        final IntHashSet deletedLinks = new IntHashSet();
        try (Cursor cursor = links.getFirstIndexCursor(envTxn)) {
            for (boolean success = cursor.getSearchKeyRange(PropertyKey.propertyKeyToEntry(new PropertyKey(entityLocalId, 0))) != null;
                 success; success = cursor.getNext()) {
                final ByteIterable keyEntry = cursor.getKey();
                final PropertyKey key = PropertyKey.entryToPropertyKey(keyEntry);
                if (key.getEntityLocalId() != entityLocalId) {
                    break;
                }
                final ByteIterable valueEntry = cursor.getValue();
                if (links.delete(envTxn, keyEntry, valueEntry)) {
                    int linkId = key.getPropertyId();
                    if (getLinkName(txn, linkId) != null) {
                        deletedLinks.add(linkId);
                        final LinkValue linkValue = LinkValue.entryToLinkValue(valueEntry);
                        txn.linkDeleted(entity.getId(), (PersistentEntityId) linkValue.getEntityId(), linkValue.getLinkId());
                    }
                }
            }
        }
        for (Integer linkId : deletedLinks) {
            links.deleteAllIndex(envTxn, linkId, entityLocalId);
        }
    }
654135
public void freeFiltersWithSource(Object objSource)
    {
        Object[] rgFilter = m_mapFilters.values().toArray();
        for (int i = 0; i < rgFilter.length; i++)
        {
            BaseMessageFilter filter = (BaseMessageFilter)rgFilter[i];
            if (filter.getMessageSource() == objSource)
                filter.free();
        }
    }
1170894
public void unintern(InternTable table)
  {
    // This implementation is inherited by Identifier and Literal which have no children,
    // but is overridden in Operator, which does.
    refCount--;
    if (refCount < 0)
      throw new IllegalStateException();
    if (refCount == 0)
    {
      Object res = table.remove(this);
      if (res == null)
        throw new IllegalStateException();
    }
  }
513603
@Override
	public void removeAssociationRow(GraphDatabaseService executionEngine, AssociationKey associationKey, RowKey rowKey) {
		Object[] queryValues = relationshipValues( associationKey, rowKey );
		executionEngine.execute( removeAssociationRowQuery, params( queryValues ) );
	}
1121324
protected void deleteTypeVertex(AtlasVertex instanceVertex, boolean force) throws AtlasException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Deleting {}", string(instanceVertex));
        }

        String typeName = GraphHelper.getTypeName(instanceVertex);
        IDataType type = typeSystem.getDataType(IDataType.class, typeName);
        FieldMapping fieldMapping = getFieldMapping(type);

        for (AttributeInfo attributeInfo : fieldMapping.fields.values()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Deleting attribute {} for {}", attributeInfo.name, string(instanceVertex));
            }

            String edgeLabel = GraphHelper.getEdgeLabel(type, attributeInfo);

            switch (attributeInfo.dataType().getTypeCategory()) {
            case CLASS:
                //If its class attribute, delete the reference
                deleteEdgeReference(instanceVertex, edgeLabel, DataTypes.TypeCategory.CLASS, attributeInfo.isComposite);
                break;

            case STRUCT:
                //If its struct attribute, delete the reference
                deleteEdgeReference(instanceVertex, edgeLabel, DataTypes.TypeCategory.STRUCT, false);
                break;

            case ARRAY:
                //For array attribute, if the element is struct/class, delete all the references
                IDataType elementType = ((DataTypes.ArrayType) attributeInfo.dataType()).getElemType();
                DataTypes.TypeCategory elementTypeCategory = elementType.getTypeCategory();
                if (elementTypeCategory == DataTypes.TypeCategory.STRUCT ||
                        elementTypeCategory == DataTypes.TypeCategory.CLASS) {
                    Iterator<AtlasEdge> edges = graphHelper.getOutGoingEdgesByLabel(instanceVertex, edgeLabel);
                    if (edges != null) {
                        while (edges.hasNext()) {
                            AtlasEdge edge = edges.next();
                            deleteEdgeReference(edge, elementType.getTypeCategory(), attributeInfo.isComposite, false);
                        }
                    }
                }
                break;

            case MAP:
                //For map attribute, if the value type is struct/class, delete all the references
                DataTypes.MapType mapType = (DataTypes.MapType) attributeInfo.dataType();
                DataTypes.TypeCategory valueTypeCategory = mapType.getValueType().getTypeCategory();
                String propertyName = GraphHelper.getQualifiedFieldName(type, attributeInfo.name);

                if (valueTypeCategory == DataTypes.TypeCategory.STRUCT ||
                        valueTypeCategory == DataTypes.TypeCategory.CLASS) {
                    List<String> keys = GraphHelper.getListProperty(instanceVertex, propertyName);
                    if (keys != null) {
                        for (String key : keys) {
                            String mapEdgeLabel = GraphHelper.getQualifiedNameForMapKey(edgeLabel, key);
                            deleteEdgeReference(instanceVertex, mapEdgeLabel, valueTypeCategory, attributeInfo.isComposite);
                        }
                    }
                }
            }
        }

        deleteVertex(instanceVertex, force);
    }
633427
public function unhookSingleModel(
        ResourceSet $sourceResourceSet,
        $sourceEntityInstance,
        ResourceSet $targetResourceSet,
        $targetEntityInstance,
        $navPropName
    ) {
        $relation = $this->isModelHookInputsOk($sourceEntityInstance, $targetEntityInstance, $navPropName);

        // in case the fake 'PrimaryKey' attribute got set inbound for a polymorphic-affected model, flatten it now
        unset($targetEntityInstance->PrimaryKey);

        $changed = false;

        if ($relation instanceof BelongsTo) {
            $relation->dissociate();
            $changed = true;
        } elseif ($relation instanceof BelongsToMany) {
            $relation->detach($targetEntityInstance);
            $changed = true;
        } elseif ($relation instanceof HasOneOrMany) {
            // dig up inverse property name, so we can pass it to unhookSingleModel with source and target elements
            // swapped
            $otherPropName = $this->getMetadataProvider()
                ->resolveReverseProperty($sourceEntityInstance, $navPropName);
            if (null === $otherPropName) {
                $srcClass = get_class($sourceEntityInstance);
                $msg = 'Bad navigation property, ' . $navPropName . ', on source model ' . $srcClass;
                throw new \InvalidArgumentException($msg);
            }
            $this->unhookSingleModel(
                $targetResourceSet,
                $targetEntityInstance,
                $sourceResourceSet,
                $sourceEntityInstance,
                $otherPropName
            );
        }
        if ($changed) {
            LaravelQuery::queueModel($sourceEntityInstance);
            LaravelQuery::queueModel($targetEntityInstance);
        }
        return true;
    }
314721
public boolean removePDatabase(PDatabase pDatabase)
    {
        Object strKey = pDatabase.getDatabaseKey();
        Object obj = m_htDBList.get(strKey);
        if (obj == null)
            return false;
        return (m_htDBList.remove(strKey) != null);
    }
1064299
public void pruneInvalidOptional(DependencyExplorerOutput output, InvalidKeys invalidKeys) {   
    DependencyGraph.GraphPruner prunedGraph = new DependencyGraph.GraphPruner(output.getGraph());
    for (Key<?> key : invalidKeys.getInvalidOptionalKeys()) {
      prunedGraph.remove(key);
      output.removeBinding(key);
    }
    output.setGraph(prunedGraph.update());
  }
626449
public static void discard(MessageEndpointBase proxy)
    {
        // Ensure we are no longer holding any object references.
        proxy.ivMDB = null;
        proxy.ivMessageEndpointFactory = null;
        proxy.ivMethod = null;
        proxy.ivXAResource = null;
        proxy.ivRecoverableXAResource = false;
        proxy.container = null;
        proxy.ivEJSDeployedSupport = null;
        proxy.ivTransactionManager = null;
        proxy.ivThread = null;
    }