Package org.infinispan.commands.write

Examples of org.infinispan.commands.write.InvalidateCommand


   public RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags) {
      return new RemoveCommand(key, value, notifier, flags);
   }

   public InvalidateCommand buildInvalidateCommand(Object... keys) {
      return new InvalidateCommand(notifier, keys);
   }
View Full Code Here


            if (src.getCommand() != null)
               initializeReplicableCommand(src.getCommand(), false);

            break;
         case InvalidateCommand.COMMAND_ID:
            InvalidateCommand ic = (InvalidateCommand) c;
            ic.init(notifier);
            break;
         case InvalidateL1Command.COMMAND_ID:
            InvalidateL1Command ilc = (InvalidateL1Command) c;
            ilc.init(configuration, distributionManager, notifier, dataContainer);
            break;
View Full Code Here

   }

   private NotifyingNotifiableFuture<Object> flushL1Cache(int numCallRecipients, Collection<Object> keys, Object retval) {
      if (isL1CacheEnabled && rpcManager.getTransport().getMembers().size() > numCallRecipients) {
         if (trace) log.trace("Invalidating L1 caches");
         InvalidateCommand ic = cf.buildInvalidateFromL1Command(false, keys);
         NotifyingNotifiableFuture<Object> future = new AggregatingNotifyingFutureImpl(retval, 2);
         rpcManager.broadcastRpcCommandInFuture(ic, future);
         return future;
      } else {
         if (trace) log.trace("Not performing invalidation! isL1CacheEnabled? {0} numCallRecipients={1}", isL1CacheEnabled, numCallRecipients);
View Full Code Here

   protected Object invalidateAcrossCluster(boolean synchronous, InvocationContext ctx, Object[] keys, boolean useFuture,
                                            final Object retvalForFuture) throws Throwable {
      if (!isLocalModeForced(ctx)) {
         // increment invalidations counter if statistics maintained
         incrementInvalidations();
         final InvalidateCommand command = commandsFactory.buildInvalidateCommand(keys);
         if (log.isDebugEnabled())
            log.debug("Cache [" + rpcManager.getTransport().getAddress() + "] replicating " + command);
         // voila, invalidated!
         if (useFuture) {
            NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(retvalForFuture);
View Full Code Here

      invalidations.keySet().removeAll(doNotInvalidate);
      Set<Future> futures = new HashSet<Future>();

      for (Map.Entry<Address, Set<Object>> e : invalidations.entrySet()) {
         InvalidateCommand ic = cf.buildInvalidateFromL1Command(true, e.getValue().toArray());
         NotifyingNotifiableFuture f = new NotifyingFutureImpl(null);
         rpcManager.invokeRemotelyInFuture(Collections.singletonList(e.getKey()), ic, true, f);
         futures.add(f);
      }
View Full Code Here

      }
   }

   private void invalidateKeys(Collection<Address> oldCacheSet, Collection<Address> newCacheSet, List<Object> keysToRemove) {
      try {
         InvalidateCommand invalidateCmd = cf.buildInvalidateFromL1Command(true, keysToRemove);
         InvocationContext ctx = icc.createNonTxInvocationContext();
         ctx.setFlags(Flag.CACHE_MODE_LOCAL, Flag.SKIP_LOCKING);
         interceptorChain.invoke(ctx, invalidateCmd);

         if (trace) {
View Full Code Here

   }

   private NotifyingNotifiableFuture<Object> flushL1Cache(int numCallRecipients, Object[] keys, boolean useFuture, Object retval, boolean sync) {
      if (isL1CacheEnabled && numCallRecipients > 0 && rpcManager.getTransport().getMembers().size() > numCallRecipients) {
         if (trace) log.trace("Invalidating L1 caches");
         InvalidateCommand ic = cf.buildInvalidateFromL1Command(keys);
         if (useFuture) {
            NotifyingNotifiableFuture<Object> future = new AggregatingNotifyingFutureImpl(retval, 2);
            rpcManager.broadcastRpcCommandInFuture(ic, future);
            return future;
         } else {
View Full Code Here

   protected Object invalidateAcrossCluster(boolean synchronous, InvocationContext ctx, Object[] keys, boolean useFuture,
                                            final Object retvalForFuture) throws Throwable {
      if (!isLocalModeForced(ctx)) {
         // increment invalidations counter if statistics maintained
         incrementInvalidations();
         final InvalidateCommand command = commandsFactory.buildInvalidateCommand(keys);
         if (log.isDebugEnabled())
            log.debug("Cache [" + rpcManager.getTransport().getAddress() + "] replicating " + command);
         // voila, invalidated!
         if (useFuture) {
            NotifyingNotifiableFuture<Object> future = new NotifyingFutureImpl(retvalForFuture);
View Full Code Here

   public RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags) {
      return new RemoveCommand(key, value, notifier, flags);
   }

   public InvalidateCommand buildInvalidateCommand(Object... keys) {
      return new InvalidateCommand(notifier, keys);
   }
View Full Code Here

            if (src.getCommand() != null)
               initializeReplicableCommand(src.getCommand(), false);

            break;
         case InvalidateCommand.COMMAND_ID:
            InvalidateCommand ic = (InvalidateCommand) c;
            ic.init(notifier);
            break;
         case InvalidateL1Command.COMMAND_ID:
            InvalidateL1Command ilc = (InvalidateL1Command) c;
            ilc.init(configuration, distributionManager, notifier, dataContainer);
            break;
View Full Code Here

TOP

Related Classes of org.infinispan.commands.write.InvalidateCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.