Search in sources :

Example 1 with WriteOnlyManyCommand

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

the class WriteOnlyManyHelper method copyForBackup.

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

Example 2 with WriteOnlyManyCommand

use of org.infinispan.commands.functional.WriteOnlyManyCommand 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)

Aggregations

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