Search in sources :

Example 6 with Tombstone

use of org.hibernate.cache.infinispan.util.Tombstone in project hibernate-orm by hibernate.

the class TombstoneCallInterceptor method visitPutKeyValueCommand.

@Override
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable {
    MVCCEntry e = (MVCCEntry) ctx.lookupEntry(command.getKey());
    if (e == null) {
        return null;
    }
    log.tracef("In cache %s(%d) applying update %s to %s", cache.getName(), region.getLastRegionInvalidation(), command.getValue(), e.getValue());
    try {
        Object value = command.getValue();
        if (value instanceof TombstoneUpdate) {
            return handleTombstoneUpdate(e, (TombstoneUpdate) value, command);
        } else if (value instanceof Tombstone) {
            return handleTombstone(e, (Tombstone) value);
        } else if (value instanceof FutureUpdate) {
            return handleFutureUpdate(e, (FutureUpdate) value, command);
        } else {
            return super.visitPutKeyValueCommand(ctx, command);
        }
    } finally {
        log.tracef("Result is %s", e.getValue());
    }
}
Also used : TombstoneUpdate(org.hibernate.cache.infinispan.util.TombstoneUpdate) Tombstone(org.hibernate.cache.infinispan.util.Tombstone) MVCCEntry(org.infinispan.container.entries.MVCCEntry) FutureUpdate(org.hibernate.cache.infinispan.util.FutureUpdate)

Aggregations

Tombstone (org.hibernate.cache.infinispan.util.Tombstone)6 TombstoneUpdate (org.hibernate.cache.infinispan.util.TombstoneUpdate)2 FutureUpdate (org.hibernate.cache.infinispan.util.FutureUpdate)1 TransactionCoordinator (org.hibernate.resource.transaction.spi.TransactionCoordinator)1 MVCCEntry (org.infinispan.container.entries.MVCCEntry)1