Class StateTransferInterceptor

  • All Implemented Interfaces:
    org.infinispan.commands.Visitor, AsyncInterceptor

    public class StateTransferInterceptor
    extends org.infinispan.interceptors.impl.BaseStateTransferInterceptor
    This interceptor has two tasks:
    1. If the command's topology id is higher than the current topology id, wait for the node to receive transaction data for the new topology id.
    2. If the topology id changed during a command's execution, retry the command, but only on the originator (which replicates it to the new owners).
    If the cache is configured with asynchronous replication, owners cannot signal to the originator that they saw a new topology, so instead each owner forwards the command to all the other owners in the new topology.
    Author:
    anistor@redhat.com
    • Constructor Detail

      • StateTransferInterceptor

        public StateTransferInterceptor()
    • Method Detail

      • visitPrepareCommand

        public java.lang.Object visitPrepareCommand​(org.infinispan.context.impl.TxInvocationContext ctx,
                                                    org.infinispan.commands.tx.PrepareCommand command)
                                             throws java.lang.Throwable
        Specified by:
        visitPrepareCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitPrepareCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitCommitCommand

        public java.lang.Object visitCommitCommand​(org.infinispan.context.impl.TxInvocationContext ctx,
                                                   org.infinispan.commands.tx.CommitCommand command)
                                            throws java.lang.Throwable
        Specified by:
        visitCommitCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitCommitCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitRollbackCommand

        public java.lang.Object visitRollbackCommand​(org.infinispan.context.impl.TxInvocationContext ctx,
                                                     org.infinispan.commands.tx.RollbackCommand command)
                                              throws java.lang.Throwable
        Specified by:
        visitRollbackCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitRollbackCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitLockControlCommand

        public java.lang.Object visitLockControlCommand​(org.infinispan.context.impl.TxInvocationContext ctx,
                                                        org.infinispan.commands.control.LockControlCommand command)
                                                 throws java.lang.Throwable
        Specified by:
        visitLockControlCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitLockControlCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitPutKeyValueCommand

        public java.lang.Object visitPutKeyValueCommand​(InvocationContext ctx,
                                                        org.infinispan.commands.write.PutKeyValueCommand command)
                                                 throws java.lang.Throwable
        Specified by:
        visitPutKeyValueCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitPutKeyValueCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitPutMapCommand

        public java.lang.Object visitPutMapCommand​(InvocationContext ctx,
                                                   org.infinispan.commands.write.PutMapCommand command)
                                            throws java.lang.Throwable
        Specified by:
        visitPutMapCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitPutMapCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitRemoveCommand

        public java.lang.Object visitRemoveCommand​(InvocationContext ctx,
                                                   org.infinispan.commands.write.RemoveCommand command)
                                            throws java.lang.Throwable
        Specified by:
        visitRemoveCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitRemoveCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitReplaceCommand

        public java.lang.Object visitReplaceCommand​(InvocationContext ctx,
                                                    org.infinispan.commands.write.ReplaceCommand command)
                                             throws java.lang.Throwable
        Specified by:
        visitReplaceCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitReplaceCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitComputeCommand

        public java.lang.Object visitComputeCommand​(InvocationContext ctx,
                                                    org.infinispan.commands.write.ComputeCommand command)
                                             throws java.lang.Throwable
        Specified by:
        visitComputeCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitComputeCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitComputeIfAbsentCommand

        public java.lang.Object visitComputeIfAbsentCommand​(InvocationContext ctx,
                                                            org.infinispan.commands.write.ComputeIfAbsentCommand command)
                                                     throws java.lang.Throwable
        Specified by:
        visitComputeIfAbsentCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitComputeIfAbsentCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitClearCommand

        public java.lang.Object visitClearCommand​(InvocationContext ctx,
                                                  org.infinispan.commands.write.ClearCommand command)
                                           throws java.lang.Throwable
        Specified by:
        visitClearCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitClearCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitInvalidateCommand

        public java.lang.Object visitInvalidateCommand​(InvocationContext ctx,
                                                       org.infinispan.commands.write.InvalidateCommand command)
                                                throws java.lang.Throwable
        Specified by:
        visitInvalidateCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitInvalidateCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitInvalidateL1Command

        public java.lang.Object visitInvalidateL1Command​(InvocationContext ctx,
                                                         org.infinispan.commands.write.InvalidateL1Command command)
                                                  throws java.lang.Throwable
        Specified by:
        visitInvalidateL1Command in interface org.infinispan.commands.Visitor
        Overrides:
        visitInvalidateL1Command in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitEvictCommand

        public java.lang.Object visitEvictCommand​(InvocationContext ctx,
                                                  org.infinispan.commands.write.EvictCommand command)
                                           throws java.lang.Throwable
        Specified by:
        visitEvictCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitEvictCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitReadWriteKeyValueCommand

        public java.lang.Object visitReadWriteKeyValueCommand​(InvocationContext ctx,
                                                              org.infinispan.commands.functional.ReadWriteKeyValueCommand command)
                                                       throws java.lang.Throwable
        Specified by:
        visitReadWriteKeyValueCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitReadWriteKeyValueCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitReadWriteKeyCommand

        public java.lang.Object visitReadWriteKeyCommand​(InvocationContext ctx,
                                                         org.infinispan.commands.functional.ReadWriteKeyCommand command)
                                                  throws java.lang.Throwable
        Specified by:
        visitReadWriteKeyCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitReadWriteKeyCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitWriteOnlyKeyCommand

        public java.lang.Object visitWriteOnlyKeyCommand​(InvocationContext ctx,
                                                         org.infinispan.commands.functional.WriteOnlyKeyCommand command)
                                                  throws java.lang.Throwable
        Specified by:
        visitWriteOnlyKeyCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitWriteOnlyKeyCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitWriteOnlyManyEntriesCommand

        public java.lang.Object visitWriteOnlyManyEntriesCommand​(InvocationContext ctx,
                                                                 org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command)
                                                          throws java.lang.Throwable
        Specified by:
        visitWriteOnlyManyEntriesCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitWriteOnlyManyEntriesCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitWriteOnlyKeyValueCommand

        public java.lang.Object visitWriteOnlyKeyValueCommand​(InvocationContext ctx,
                                                              org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)
                                                       throws java.lang.Throwable
        Specified by:
        visitWriteOnlyKeyValueCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitWriteOnlyKeyValueCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitWriteOnlyManyCommand

        public java.lang.Object visitWriteOnlyManyCommand​(InvocationContext ctx,
                                                          org.infinispan.commands.functional.WriteOnlyManyCommand command)
                                                   throws java.lang.Throwable
        Specified by:
        visitWriteOnlyManyCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitWriteOnlyManyCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitReadWriteManyCommand

        public java.lang.Object visitReadWriteManyCommand​(InvocationContext ctx,
                                                          org.infinispan.commands.functional.ReadWriteManyCommand command)
                                                   throws java.lang.Throwable
        Specified by:
        visitReadWriteManyCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitReadWriteManyCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • visitReadWriteManyEntriesCommand

        public java.lang.Object visitReadWriteManyEntriesCommand​(InvocationContext ctx,
                                                                 org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)
                                                          throws java.lang.Throwable
        Specified by:
        visitReadWriteManyEntriesCommand in interface org.infinispan.commands.Visitor
        Overrides:
        visitReadWriteManyEntriesCommand in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • handleDefault

        public java.lang.Object handleDefault​(InvocationContext ctx,
                                              org.infinispan.commands.VisitableCommand command)
                                       throws java.lang.Throwable
        Overrides:
        handleDefault in class DDAsyncInterceptor
        Throws:
        java.lang.Throwable
      • getLog

        protected org.infinispan.util.logging.Log getLog()
        Specified by:
        getLog in class org.infinispan.interceptors.impl.BaseStateTransferInterceptor