Skip to content

Commit

Permalink
ISPN-7872 Fix functional command handling in StateTransferInterceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
rvansa authored and danberindei committed Jun 19, 2017
1 parent 151b28b commit 8534a2a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
Expand Up @@ -11,6 +11,8 @@
import org.infinispan.commands.FlagAffectedCommand; import org.infinispan.commands.FlagAffectedCommand;
import org.infinispan.commands.TopologyAffectedCommand; import org.infinispan.commands.TopologyAffectedCommand;
import org.infinispan.commands.VisitableCommand; import org.infinispan.commands.VisitableCommand;
import org.infinispan.commands.functional.ReadOnlyKeyCommand;
import org.infinispan.commands.functional.ReadOnlyManyCommand;
import org.infinispan.commands.read.GetAllCommand; import org.infinispan.commands.read.GetAllCommand;
import org.infinispan.commands.read.GetCacheEntryCommand; import org.infinispan.commands.read.GetCacheEntryCommand;
import org.infinispan.commands.read.GetKeyValueCommand; import org.infinispan.commands.read.GetKeyValueCommand;
Expand Down Expand Up @@ -253,6 +255,16 @@ protected boolean isLocalOnly(FlagAffectedCommand command) {
return command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL); return command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL);
} }


@Override
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable {
return handleReadCommand(ctx, command);
}

@Override
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable {
return handleReadCommand(ctx, command);
}

protected abstract Log getLog(); protected abstract Log getLog();


private static class CancellableRetry<T extends VisitableCommand> implements BiFunction<Void, Throwable, Void>, Runnable { private static class CancellableRetry<T extends VisitableCommand> implements BiFunction<Void, Throwable, Void>, Runnable {
Expand Down
Expand Up @@ -6,10 +6,14 @@
import org.infinispan.commands.TopologyAffectedCommand; import org.infinispan.commands.TopologyAffectedCommand;
import org.infinispan.commands.VisitableCommand; import org.infinispan.commands.VisitableCommand;
import org.infinispan.commands.control.LockControlCommand; import org.infinispan.commands.control.LockControlCommand;
import org.infinispan.commands.functional.ReadOnlyKeyCommand;
import org.infinispan.commands.functional.ReadOnlyManyCommand;
import org.infinispan.commands.functional.ReadWriteKeyCommand; import org.infinispan.commands.functional.ReadWriteKeyCommand;
import org.infinispan.commands.functional.ReadWriteKeyValueCommand; import org.infinispan.commands.functional.ReadWriteKeyValueCommand;
import org.infinispan.commands.functional.ReadWriteManyCommand;
import org.infinispan.commands.functional.ReadWriteManyEntriesCommand;
import org.infinispan.commands.functional.WriteOnlyKeyCommand;
import org.infinispan.commands.functional.WriteOnlyKeyValueCommand;
import org.infinispan.commands.functional.WriteOnlyManyCommand;
import org.infinispan.commands.functional.WriteOnlyManyEntriesCommand;
import org.infinispan.commands.tx.CommitCommand; import org.infinispan.commands.tx.CommitCommand;
import org.infinispan.commands.tx.PrepareCommand; import org.infinispan.commands.tx.PrepareCommand;
import org.infinispan.commands.tx.RollbackCommand; import org.infinispan.commands.tx.RollbackCommand;
Expand Down Expand Up @@ -160,13 +164,33 @@ public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyComman
} }


@Override @Override
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable { public Object visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) throws Throwable {
return handleReadCommand(ctx, command); return handleWriteCommand(ctx, command);
}

@Override
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, WriteOnlyManyEntriesCommand command) throws Throwable {
return handleWriteCommand(ctx, command);
}

@Override
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, WriteOnlyKeyValueCommand command) throws Throwable {
return handleWriteCommand(ctx, command);
} }


@Override @Override
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable { public Object visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) throws Throwable {
return handleReadCommand(ctx, command); return handleWriteCommand(ctx, command);
}

@Override
public Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) throws Throwable {
return handleWriteCommand(ctx, command);
}

@Override
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable {
return handleWriteCommand(ctx, command);
} }


/** /**
Expand Down

0 comments on commit 8534a2a

Please sign in to comment.