Search in sources :

Example 1 with ReadWriteManyEntriesCommand

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

the class MultiEntriesFunctionalBackupWriteCommand method createWriteCommand.

@Override
WriteCommand createWriteCommand() {
    // noinspection unchecked
    AbstractWriteManyCommand cmd = writeOnly ? new WriteOnlyManyEntriesCommand(entries, (BiConsumer) function, params, getCommandInvocationId(), keyDataConversion, valueDataConversion) : new ReadWriteManyEntriesCommand(entries, (BiFunction) function, params, getCommandInvocationId(), keyDataConversion, valueDataConversion);
    cmd.setForwarded(true);
    return cmd;
}
Also used : AbstractWriteManyCommand(org.infinispan.commands.functional.AbstractWriteManyCommand) WriteOnlyManyEntriesCommand(org.infinispan.commands.functional.WriteOnlyManyEntriesCommand) ReadWriteManyEntriesCommand(org.infinispan.commands.functional.ReadWriteManyEntriesCommand) BiFunction(java.util.function.BiFunction) BiConsumer(java.util.function.BiConsumer)

Example 2 with ReadWriteManyEntriesCommand

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

the class ReadWriteManyEntriesHelper method copyForBackup.

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

Aggregations

ReadWriteManyEntriesCommand (org.infinispan.commands.functional.ReadWriteManyEntriesCommand)2 BiConsumer (java.util.function.BiConsumer)1 BiFunction (java.util.function.BiFunction)1 AbstractWriteManyCommand (org.infinispan.commands.functional.AbstractWriteManyCommand)1 WriteOnlyManyEntriesCommand (org.infinispan.commands.functional.WriteOnlyManyEntriesCommand)1 ReadOnlySegmentAwareMap (org.infinispan.distribution.util.ReadOnlySegmentAwareMap)1