Search in sources :

Example 1 with ReadWriteKeyValueCommand

use of org.infinispan.commands.functional.ReadWriteKeyValueCommand in project infinispan by infinispan.

the class SingleKeyFunctionalBackupWriteCommand method createWriteCommand.

@Override
WriteCommand createWriteCommand() {
    switch(operation) {
        case READ_WRITE:
            // noinspection unchecked
            return new ReadWriteKeyCommand(key, (Function) function, segmentId, getCommandInvocationId(), MATCH_ALWAYS, params, keyDataConversion, valueDataConversion);
        case READ_WRITE_KEY_VALUE:
            // noinspection unchecked
            ReadWriteKeyValueCommand cmd = new ReadWriteKeyValueCommand(key, value, (BiFunction) function, segmentId, getCommandInvocationId(), MATCH_ALWAYS, params, keyDataConversion, valueDataConversion);
            cmd.setPrevValueAndMetadata(prevValue, prevMetadata);
            return cmd;
        case WRITE_ONLY:
            // noinspection unchecked
            return new WriteOnlyKeyCommand(key, (Consumer) function, segmentId, getCommandInvocationId(), MATCH_ALWAYS, params, keyDataConversion, valueDataConversion);
        case WRITE_ONLY_KEY_VALUE:
            // noinspection unchecked
            return new WriteOnlyKeyValueCommand(key, value, (BiConsumer) function, segmentId, getCommandInvocationId(), MATCH_ALWAYS, params, keyDataConversion, valueDataConversion);
        default:
            throw new IllegalStateException("Unknown operation " + operation);
    }
}
Also used : ReadWriteKeyCommand(org.infinispan.commands.functional.ReadWriteKeyCommand) ReadWriteKeyValueCommand(org.infinispan.commands.functional.ReadWriteKeyValueCommand) WriteOnlyKeyCommand(org.infinispan.commands.functional.WriteOnlyKeyCommand) WriteOnlyKeyValueCommand(org.infinispan.commands.functional.WriteOnlyKeyValueCommand)

Aggregations

ReadWriteKeyCommand (org.infinispan.commands.functional.ReadWriteKeyCommand)1 ReadWriteKeyValueCommand (org.infinispan.commands.functional.ReadWriteKeyValueCommand)1 WriteOnlyKeyCommand (org.infinispan.commands.functional.WriteOnlyKeyCommand)1 WriteOnlyKeyValueCommand (org.infinispan.commands.functional.WriteOnlyKeyValueCommand)1