Search in sources :

Example 1 with WriteOnlyManyEntriesCommand

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

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

the class WriteOnlyManyEntriesHelper method copyForBackup.

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

Aggregations

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