Search in sources :

Example 1 with WriteManyCommandHelper

use of org.infinispan.interceptors.distribution.WriteManyCommandHelper in project infinispan by infinispan.

the class AnchoredDistributionInterceptor method handleReadWriteManyCommand.

@Override
protected <C extends WriteCommand, Container, Item> Object handleReadWriteManyCommand(InvocationContext ctx, C command, WriteManyCommandHelper<C, Item, Container> helper) throws Exception {
    WriteManyCommandHelper wrappedHelper = new AbstractDelegatingWriteManyCommandHelper(helper) {

        @Override
        public WriteCommand copyForBackup(WriteCommand cmd, LocalizedCacheTopology topology, Address target, IntSet segments) {
            WriteCommand backupCommand = helper.copyForBackup(cmd, topology, target, segments);
            CommandCopier commandCopier = new CommandCopier(ctx, backupCommand);
            return (WriteCommand) commandCopier.apply(target);
        }
    };
    return super.handleReadWriteManyCommand(ctx, command, wrappedHelper);
}
Also used : WriteCommand(org.infinispan.commands.write.WriteCommand) AbstractDataWriteCommand(org.infinispan.commands.write.AbstractDataWriteCommand) DataWriteCommand(org.infinispan.commands.write.DataWriteCommand) Address(org.infinispan.remoting.transport.Address) IntSet(org.infinispan.commons.util.IntSet) LocalizedCacheTopology(org.infinispan.distribution.LocalizedCacheTopology) WriteManyCommandHelper(org.infinispan.interceptors.distribution.WriteManyCommandHelper)

Aggregations

AbstractDataWriteCommand (org.infinispan.commands.write.AbstractDataWriteCommand)1 DataWriteCommand (org.infinispan.commands.write.DataWriteCommand)1 WriteCommand (org.infinispan.commands.write.WriteCommand)1 IntSet (org.infinispan.commons.util.IntSet)1 LocalizedCacheTopology (org.infinispan.distribution.LocalizedCacheTopology)1 WriteManyCommandHelper (org.infinispan.interceptors.distribution.WriteManyCommandHelper)1 Address (org.infinispan.remoting.transport.Address)1