deletionHandlingMetaNamespaceKeyFunc checks for DeletedFinalStateUnknown objects before calling
metaNamespaceKeyFunc.

@param object specific object
@return the key
540519
public static <ApiType> String deletionHandlingMetaNamespaceKeyFunc(ApiType object) {
    if (object instanceof DeltaFIFO.DeletedFinalStateUnknown) {
      DeltaFIFO.DeletedFinalStateUnknown deleteObj = (DeltaFIFO.DeletedFinalStateUnknown) object;
      return deleteObj.getKey();
    }
    return metaNamespaceKeyFunc(object);
  }
998795
public void remove (Object object) {
		if (!idToObject.containsValue(object, true)) return;
		int objectID = idToObject.findKey(object, true, -1);
		idToObject.remove(objectID);
		objectToID.remove(object, 0);
		if (TRACE) trace("kryonet", "Object " + objectID + " removed from ObjectSpace: " + object);
	}
971675
@Override
    public void delete(Object entity, Object pKey)
    {
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        AbstractManagedType managedType = (AbstractManagedType) metaModel.entity(entityMetadata.getEntityClazz());

        DBObject query = new BasicDBObject();

        if (managedType.hasLobAttribute())
        {
            KunderaGridFS gfs = new KunderaGridFS(mongoDb, entityMetadata.getTableName());
            String id = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
            query.put("metadata." + id, pKey);
            gfs.remove(query);
        }

        else
        {
            if (metaModel.isEmbeddable(entityMetadata.getIdAttribute().getBindableJavaType()))
            {
                MongoDBUtils.populateCompoundKey(query, entityMetadata, metaModel, pKey);
            }
            else
            {
                query.put("_id", MongoDBUtils.populateValue(pKey, pKey.getClass()));
            }
            // For secondary tables.
            List<String> secondaryTables = ((DefaultEntityAnnotationProcessor) managedType.getEntityAnnotation())
                    .getSecondaryTablesName();
            secondaryTables.add(entityMetadata.getTableName());

            for (String collectionName : secondaryTables)
            {
                KunderaCoreUtils.printQuery("Drop existing collection:" + query, showQuery);
                DBCollection dbCollection = mongoDb.getCollection(collectionName);
                dbCollection.remove(query, getWriteConcern(), encoder);
            }

            getIndexManager().remove(entityMetadata, entity, pKey);
        }
    }
879572
public boolean wasDeleted(@NonNull T object) {
        final DeleteResult result = results.get(object);
        return result != null && result.numberOfRowsDeleted() > 0;
    }
1244997
@Override
    public RemoteObjectInstance getRemoteObjectInstance(JavaColonNamespace namespace, String name) throws NamingException {
        RemoteObjectInstance roi = null;
        InjectionBinding<?> binding = getInjectionBinding(namespace, name);
        if (binding != null) {
            Object bindingObject = binding.getRemoteObject();
            if (bindingObject != null) {
                if (bindingObject instanceof IndirectReference) {
                    bindingObject = resolveIndirectReferences(binding, (IndirectReference) bindingObject, 0);
                }
                if (bindingObject instanceof javax.naming.Reference) {
                    SerializationContext sc = serializationService.createSerializationContext();
                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    ObjectOutputStream oos = null;
                    try {
                        oos = sc.createObjectOutputStream(baos);
                        oos.writeObject(bindingObject);
                    } catch (IOException ex) {
                        NamingException ne = new NamingException("Unable to serialize naming reference: " + bindingObject);
                        ne.initCause(ex);
                        throw ne;
                    } finally {
                        if (oos != null)
                            try {
                                oos.close();
                            } catch (IOException ex) {
                            }
                    }
                    roi = roiFactory.create(baos.toByteArray());
                } else if (bindingObject instanceof Remote) {
                    roi = roiFactory.create((Remote) bindingObject, binding.getInjectionClassTypeName());
                } else {
                    roi = roiFactory.create(bindingObject);
                }
            }
        }
        return roi;
    }
827033
public void delete(String bucketName, List<KeyVersion> objects) {
        ReactiveSeq.fromList(objects)
                   .grouped(1000)
                   .forEach(l -> {
                       DeleteObjectsRequest req = new DeleteObjectsRequest(
                                                                           bucketName);
                       req.setKeys(l.toList());
                       client.deleteObjects(req);
                   });
    }
341347
public void removeNodeMetaData(Object key) {
        if (key==null) throw new GroovyBugError("Tried to remove meta data with null key "+this+".");
        if (metaDataMap == null) {
            return;
        }
        metaDataMap.remove(key);
    }
335561
@Override
    public void delete(Object entity, Object pKey)
    {
        if (!isOpen())
        {
            throw new PersistenceException("ThriftClient is closed.");
        }

        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());
        Connection conn = null;
        try
        {
            conn = getConnection();
            MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                    metadata.getPersistenceUnit());

            AbstractManagedType managedType = (AbstractManagedType) metaModel.entity(metadata.getEntityClazz());
            // For secondary tables.
            List<String> secondaryTables = ((DefaultEntityAnnotationProcessor) managedType.getEntityAnnotation())
                    .getSecondaryTablesName();
            secondaryTables.add(metadata.getTableName());

            for (String tableName : secondaryTables)
            {
                if (isCql3Enabled(metadata))
                {
                    String deleteQuery = onDeleteQuery(metadata, tableName, metaModel, pKey);
                    executeCQLQuery(deleteQuery, isCql3Enabled(metadata));

                }
                else
                {
                    if (metadata.isCounterColumnType())
                    {
                        deleteRecordFromCounterColumnFamily(pKey, tableName, metadata, getConsistencyLevel());
                    }
                    else
                    {
                        ColumnPath path = new ColumnPath(tableName);

                        conn.getClient().remove(
                                CassandraUtilities.toBytes(pKey, metadata.getIdAttribute().getJavaType()), path,
                                generator.getTimestamp(), getConsistencyLevel());
                    }
                }
            }
            getIndexManager().remove(metadata, entity, pKey);

            // Delete from Inverted Index if applicable
            invertedIndexHandler.delete(entity, metadata, getConsistencyLevel(), kunderaMetadata);
        }
        catch (InvalidRequestException e)
        {
            log.error("Error while deleting of column family {} for row key {}, Caused by: .", metadata.getTableName(),
                    pKey, e);
            throw new KunderaException(e);
        }
        catch (TException e)
        {
            log.error("Error while deleting of column family {} for row key {}, Caused by: .", metadata.getTableName(),
                    pKey, e);
            throw new KunderaException(e);
        }
        finally
        {
            releaseConnection(conn);
        }
    }
225475
private static String getKey(Object... objects) {
    Object[] args = new Object[objects.length + 1];
    args[0] = LineageEventBuilder.LIENAGE_EVENT_NAMESPACE;
    System.arraycopy(objects, 0, args, 1, objects.length);
    return LineageEventBuilder.getKey(args);
  }
1088342
protected Object common_remove(Object key) {

        // CPF_CODE_REVIEW - Should this be cache.getEntryFromMemory() ??
        // CPF_CODE_REVIEW - Since we are going to invalidate anyway,
        // why go to the remote??

        ValidateUtility.objectNotNull(key, "key");
        Object old = get(key);
        cache.invalidateById(key, true);
        return old;
    }
749123
private static ObjectMetadata getObjectMetadataForKey(Key k) {
    String[] bk = decodeKey(k);
    assert (bk.length == 2);
    return getClient().getObjectMetadata(bk[0], bk[1]);
  }
701775
public static String simpleObjectName(Object object) {
        if (object == null) {
            return "<null>";
        }
        StringBuilder builder = new StringBuilder();
        builder.append(simpleClassName(object.getClass()))
            .append('#')
            .append(objectId(object));
        return builder.toString();
    }
1170789
public <S, T> T convertTo(ConverterKey<S,T> key, Object object) {

		if (object == null) {
			return null;
		}
		
		Converter<S, T> conv = findConverter(key.getInputClass(), key.getOutputClass(), key.getQualifierAnnotation() == null ? DefaultBinding.class : key.getQualifierAnnotation());
		
		if (conv == null) {
			throw new NoConverterFoundException(key);
		}
		
		@SuppressWarnings("unchecked")
		S myObject = (S)object;
		return conv.convert(myObject);
	}
37515
public void delete(Object object, DynamoDBMapperConfig config) {
        config = mergeConfig(config);

        Class<?> clazz = object.getClass();

        String tableName = getTableName(clazz, config);

        Method hashKeyGetter = reflector.getHashKeyGetter(clazz);
        AttributeValue hashKeyElement = getHashKeyElement(safeInvoke(hashKeyGetter, object), hashKeyGetter);

        AttributeValue rangeKeyElement = null;
        Method rangeKeyGetter = reflector.getRangeKeyGetter(clazz);
        if ( rangeKeyGetter != null ) {
            rangeKeyElement = getRangeKeyElement(safeInvoke(rangeKeyGetter, object), rangeKeyGetter);
        }

        Key objectKey = new Key().withHashKeyElement(hashKeyElement).withRangeKeyElement(rangeKeyElement);

        /*
         * If there is a version field, make sure we assert its value. If the
         * version field is null (only should happen in unusual circumstances),
         * pretend it doesn't have a version field after all.
         */
        Map<String, ExpectedAttributeValue> expectedValues = new HashMap<String, ExpectedAttributeValue>();
        if ( config.getSaveBehavior() != SaveBehavior.CLOBBER ) {
            for ( Method method : reflector.getRelevantGetters(clazz) ) {

                if ( reflector.isVersionAttributeGetter(method) ) {
                    Object getterResult = safeInvoke(method, object);
                    String attributeName = reflector.getAttributeName(method);

                    ExpectedAttributeValue expected = new ExpectedAttributeValue();
                    AttributeValue currentValue = getSimpleAttributeValue(method, getterResult);
                    expected.setExists(currentValue != null);
                    if ( currentValue != null )
                        expected.setValue(currentValue);
                    expectedValues.put(attributeName, expected);
                    break;
                }
            }
        }

        db.deleteItem(applyUserAgent(new DeleteItemRequest().withKey(objectKey).withTableName(tableName).withExpected(expectedValues)));
    }
1050053
public void deleteObject(Object object)
    {
        PersistenceBroker broker = null;
        try
        {
            broker = getBroker();
            broker.delete(object);
        }
        finally
        {
            if (broker != null) broker.close();
        }
    }
345980
public Map<String, CFMetaData> getKeyspaceMetaData(String keyspaceName)
    {
        assert keyspaceName != null;
        KSMetaData ksm = keyspaces.get(keyspaceName);
        assert ksm != null;
        return ksm.cfMetaData();
    }
886026
ValidationResult cleanObjectKey(String name) {
        ValidationResult vr = new ValidationResult();
        name = name.trim();
        for (String x : objectKeyCharsNotAllowed)
            name = name.replace(x, "");

        if (name.length() > Constants.MAX_KEY_LENGTH) {
            name = name.substring(0, Constants.MAX_KEY_LENGTH-1);
            vr.setErrorDesc(name.trim() + "... exceeds the limit of "+ Constants.MAX_KEY_LENGTH + " characters. Trimmed");
            vr.setErrorCode(520);
        }

        vr.setObject(name.trim());

        return vr;
    }