Search in sources :

Example 1 with ReadWriteManyCommand

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

the class MultiKeyFunctionalBackupWriteCommand method createWriteCommand.

@Override
WriteCommand createWriteCommand() {
    // noinspection unchecked
    AbstractWriteManyCommand cmd = writeOnly ? new WriteOnlyManyCommand(keys, (Consumer) function, params, getCommandInvocationId(), keyDataConversion, valueDataConversion) : new ReadWriteManyCommand(keys, (Function) function, params, getCommandInvocationId(), keyDataConversion, valueDataConversion);
    cmd.setForwarded(true);
    return cmd;
}
Also used : AbstractWriteManyCommand(org.infinispan.commands.functional.AbstractWriteManyCommand) Function(java.util.function.Function) Consumer(java.util.function.Consumer) ReadWriteManyCommand(org.infinispan.commands.functional.ReadWriteManyCommand) WriteOnlyManyCommand(org.infinispan.commands.functional.WriteOnlyManyCommand)

Example 2 with ReadWriteManyCommand

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

the class ReadWriteManyHelper method copyForBackup.

@Override
public ReadWriteManyCommand copyForBackup(ReadWriteManyCommand cmd, LocalizedCacheTopology topology, Address target, IntSet segments) {
    ReadWriteManyCommand copy = new ReadWriteManyCommand(cmd).withKeys(new ReadOnlySegmentAwareCollection(cmd.getAffectedKeys(), topology, segments));
    copy.setForwarded(true);
    return copy;
}
Also used : ReadWriteManyCommand(org.infinispan.commands.functional.ReadWriteManyCommand) ReadOnlySegmentAwareCollection(org.infinispan.distribution.util.ReadOnlySegmentAwareCollection)

Aggregations

ReadWriteManyCommand (org.infinispan.commands.functional.ReadWriteManyCommand)2 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 AbstractWriteManyCommand (org.infinispan.commands.functional.AbstractWriteManyCommand)1 WriteOnlyManyCommand (org.infinispan.commands.functional.WriteOnlyManyCommand)1 ReadOnlySegmentAwareCollection (org.infinispan.distribution.util.ReadOnlySegmentAwareCollection)1