Search in sources :

Example 1 with ResponseCollector

use of org.infinispan.remoting.transport.ResponseCollector in project infinispan by infinispan.

the class DistAsyncFuncTest method createCacheManagers.

@Override
protected void createCacheManagers() throws Throwable {
    super.createCacheManagers();
    r1 = new ReplListener(c1, true, true);
    r2 = new ReplListener(c2, true, true);
    r3 = new ReplListener(c3, true, true);
    r4 = new ReplListener(c4, true, true);
    r = new ReplListener[] { r1, r2, r3, r4 };
    listenerLookup = new HashMap<>();
    for (ReplListener rl : r) listenerLookup.put(rl.getCache().getCacheManager().getAddress(), rl);
    for (Cache c : caches) {
        TestingUtil.wrapComponent(c, RpcManager.class, original -> new AbstractDelegatingRpcManager(original) {

            @Override
            protected <T> CompletionStage<T> performRequest(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, Function<ResponseCollector<T>, CompletionStage<T>> invoker, RpcOptions rpcOptions) {
                if (command instanceof SingleRpcCommand) {
                    command = ((SingleRpcCommand) command).getCommand();
                }
                if (command instanceof InvalidateL1Command) {
                    InvalidateL1Command invalidateL1Command = (InvalidateL1Command) command;
                    log.tracef("Sending invalidation %s to %s", command, targets);
                    Collection<Address> realTargets = targets != null ? targets : cacheAddresses;
                    for (Address target : realTargets) {
                        expectedL1Invalidations.computeIfAbsent(target, ignored -> Collections.synchronizedList(new ArrayList<>())).add(invalidateL1Command);
                    }
                }
                return super.performRequest(targets, command, collector, invoker, rpcOptions);
            }
        });
    }
}
Also used : Address(org.infinispan.remoting.transport.Address) ReplicableCommand(org.infinispan.commands.ReplicableCommand) ArrayList(java.util.ArrayList) InvalidateL1Command(org.infinispan.commands.write.InvalidateL1Command) SingleRpcCommand(org.infinispan.commands.remote.SingleRpcCommand) AbstractDelegatingRpcManager(org.infinispan.util.AbstractDelegatingRpcManager) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) RpcOptions(org.infinispan.remoting.rpc.RpcOptions) Collection(java.util.Collection) ReplListener(org.infinispan.test.ReplListener) CompletionStage(java.util.concurrent.CompletionStage) Cache(org.infinispan.Cache)

Example 2 with ResponseCollector

use of org.infinispan.remoting.transport.ResponseCollector in project infinispan by infinispan.

the class ScatteredDistributionInterceptor method handleReadCommand.

private Object handleReadCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable {
    LocalizedCacheTopology cacheTopology = checkTopology(command);
    // SKIP_OWNERSHIP_CHECK is added when the entry is prefetched from remote node
    // TODO [rvansa]: local lookup and hinted read, see improvements in package-info
    CacheEntry entry = ctx.lookupEntry(command.getKey());
    if (entry != null) {
        return invokeNext(ctx, command);
    }
    DistributionInfo info = cacheTopology.getSegmentDistribution(command.getSegment());
    if (info.isPrimary()) {
        if (log.isTraceEnabled()) {
            log.tracef("In topology %d this is primary owner", cacheTopology.getTopologyId());
        }
        return invokeNext(ctx, command);
    } else if (command.hasAnyFlag(FlagBitSets.SKIP_OWNERSHIP_CHECK)) {
        if (log.isTraceEnabled()) {
            log.trace("Ignoring ownership");
        }
        return invokeNext(ctx, command);
    } else if (info.primary() == null) {
        throw OutdatedTopologyException.RETRY_NEXT_TOPOLOGY;
    } else if (ctx.isOriginLocal()) {
        if (isLocalModeForced(command) || command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP)) {
            entryFactory.wrapExternalEntry(ctx, command.getKey(), NullCacheEntry.getInstance(), false, false);
            return invokeNext(ctx, command);
        }
        ClusteredGetCommand clusteredGetCommand = cf.buildClusteredGetCommand(command.getKey(), info.segmentId(), command.getFlagsBitSet());
        clusteredGetCommand.setTopologyId(command.getTopologyId());
        ResponseCollector<Response> collector = PassthroughSingleResponseCollector.INSTANCE;
        CompletionStage<Response> rpcFuture = rpcManager.invokeCommand(info.primary(), clusteredGetCommand, collector, rpcManager.getSyncRpcOptions());
        Object key = clusteredGetCommand.getKey();
        return asyncInvokeNext(ctx, command, rpcFuture.thenAccept(response -> {
            if (response.isSuccessful()) {
                InternalCacheValue value = (InternalCacheValue) ((SuccessfulResponse) response).getResponseValue();
                if (value != null) {
                    InternalCacheEntry cacheEntry = value.toInternalCacheEntry(key);
                    entryFactory.wrapExternalEntry(ctx, key, cacheEntry, true, false);
                } else {
                    entryFactory.wrapExternalEntry(ctx, key, NullCacheEntry.getInstance(), false, false);
                }
            } else if (response instanceof UnsureResponse) {
                throw OutdatedTopologyException.RETRY_NEXT_TOPOLOGY;
            } else if (response instanceof CacheNotFoundResponse) {
                throw AllOwnersLostException.INSTANCE;
            } else if (response instanceof ExceptionResponse) {
                throw ResponseCollectors.wrapRemoteException(info.primary(), ((ExceptionResponse) response).getException());
            } else {
                throw new IllegalArgumentException("Unexpected response " + response);
            }
        }));
    } else {
        return UnsureResponse.INSTANCE;
    }
}
Also used : ExceptionResponse(org.infinispan.remoting.responses.ExceptionResponse) CacheNotFoundResponse(org.infinispan.remoting.responses.CacheNotFoundResponse) UnsureResponse(org.infinispan.remoting.responses.UnsureResponse) LocalizedCacheTopology(org.infinispan.distribution.LocalizedCacheTopology) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) CacheEntry(org.infinispan.container.entries.CacheEntry) NullCacheEntry(org.infinispan.container.entries.NullCacheEntry) MetadataImmortalCacheEntry(org.infinispan.container.entries.metadata.MetadataImmortalCacheEntry) ClusteredGetCommand(org.infinispan.commands.remote.ClusteredGetCommand) DistributionInfo(org.infinispan.distribution.DistributionInfo) InternalCacheValue(org.infinispan.container.entries.InternalCacheValue) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) MapResponseCollector(org.infinispan.remoting.transport.impl.MapResponseCollector) PassthroughSingleResponseCollector(org.infinispan.remoting.transport.impl.PassthroughSingleResponseCollector) SingleResponseCollector(org.infinispan.remoting.transport.impl.SingleResponseCollector) SingletonMapResponseCollector(org.infinispan.remoting.transport.impl.SingletonMapResponseCollector) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) CompletionStage(java.util.concurrent.CompletionStage) AggregateCompletionStage(org.infinispan.util.concurrent.AggregateCompletionStage)

Example 3 with ResponseCollector

use of org.infinispan.remoting.transport.ResponseCollector in project infinispan by infinispan.

the class AllClusterExecutor method executeRunnable.

private CompletableFuture<?> executeRunnable(Runnable runnable) {
    CompletableFuture<?> localFuture = startLocalInvocation(runnable);
    List<Address> targets = getRealTargets(false);
    int size = targets.size();
    CompletableFuture<?> remoteFuture;
    if (size == 1) {
        Address target = targets.get(0);
        if (log.isTraceEnabled()) {
            log.tracef("Submitting runnable to single remote node - JGroups Address %s", target);
        }
        remoteFuture = new CompletableFuture<>();
        ReplicableCommand command = new ReplicableRunnableCommand(runnable);
        CompletionStage<Response> request = transport.invokeCommand(target, command, PassthroughSingleResponseCollector.INSTANCE, DeliverOrder.NONE, time, unit);
        request.handle((r, t) -> {
            if (t != null) {
                remoteFuture.completeExceptionally(t);
            } else {
                consumeResponse(r, target, remoteFuture::completeExceptionally);
                // This won't override exception if there was one
                remoteFuture.complete(null);
            }
            return null;
        });
    } else if (size > 1) {
        remoteFuture = new CompletableFuture<>();
        ReplicableCommand command = new ReplicableRunnableCommand(runnable);
        ResponseCollector<Map<Address, Response>> collector = new PassthroughMapResponseCollector(targets.size());
        CompletionStage<Map<Address, Response>> request = transport.invokeCommand(targets, command, collector, DeliverOrder.NONE, time, unit);
        request.handle((r, t) -> {
            if (t != null) {
                remoteFuture.completeExceptionally(t);
            } else {
                r.forEach((key, value) -> consumeResponse(value, key, remoteFuture::completeExceptionally));
                remoteFuture.complete(null);
            }
            return null;
        });
    } else if (localFuture != null) {
        return localFuture;
    } else {
        return CompletableFutures.completedExceptionFuture(new SuspectException("No available nodes!"));
    }
    // remoteFuture is guaranteed to be non null at this point
    if (localFuture != null) {
        CompletableFuture<Void> future = new CompletableFuture<>();
        CompletableFuture.allOf(localFuture, remoteFuture).whenComplete((v, t) -> {
            if (t != null) {
                if (t instanceof CompletionException) {
                    future.completeExceptionally(t.getCause());
                } else {
                    future.completeExceptionally(t);
                }
            } else {
                future.complete(null);
            }
        });
        return future;
    }
    return remoteFuture;
}
Also used : TimeoutException(org.infinispan.util.concurrent.TimeoutException) LogFactory(org.infinispan.util.logging.LogFactory) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) PassthroughSingleResponseCollector(org.infinispan.remoting.transport.impl.PassthroughSingleResponseCollector) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) CompletableFutures(org.infinispan.util.concurrent.CompletableFutures) ClusterExecutor(org.infinispan.manager.ClusterExecutor) Map(java.util.Map) Log(org.infinispan.util.logging.Log) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Address(org.infinispan.remoting.transport.Address) Response(org.infinispan.remoting.responses.Response) TriConsumer(org.infinispan.util.function.TriConsumer) CompletableFutures.asCompletionException(org.infinispan.util.concurrent.CompletableFutures.asCompletionException) ReplicableCommand(org.infinispan.commands.ReplicableCommand) Transport(org.infinispan.remoting.transport.Transport) Executor(java.util.concurrent.Executor) Predicate(java.util.function.Predicate) CompletionException(java.util.concurrent.CompletionException) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) CompletionStage(java.util.concurrent.CompletionStage) PassthroughMapResponseCollector(org.infinispan.remoting.transport.impl.PassthroughMapResponseCollector) DeliverOrder(org.infinispan.remoting.inboundhandler.DeliverOrder) SuspectException(org.infinispan.remoting.transport.jgroups.SuspectException) Address(org.infinispan.remoting.transport.Address) ReplicableCommand(org.infinispan.commands.ReplicableCommand) SuspectException(org.infinispan.remoting.transport.jgroups.SuspectException) Response(org.infinispan.remoting.responses.Response) PassthroughMapResponseCollector(org.infinispan.remoting.transport.impl.PassthroughMapResponseCollector) CompletableFuture(java.util.concurrent.CompletableFuture) PassthroughSingleResponseCollector(org.infinispan.remoting.transport.impl.PassthroughSingleResponseCollector) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) PassthroughMapResponseCollector(org.infinispan.remoting.transport.impl.PassthroughMapResponseCollector) CompletableFutures.asCompletionException(org.infinispan.util.concurrent.CompletableFutures.asCompletionException) CompletionException(java.util.concurrent.CompletionException) CompletionStage(java.util.concurrent.CompletionStage)

Example 4 with ResponseCollector

use of org.infinispan.remoting.transport.ResponseCollector in project infinispan by infinispan.

the class ScatteredDistributionInterceptor method visitReadOnlyKeyCommand.

@Override
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable {
    Object key = command.getKey();
    CacheEntry entry = ctx.lookupEntry(key);
    if (entry != null) {
        // the entry is owned locally (it is NullCacheEntry if it was not found), no need to go remote
        return invokeNext(ctx, command);
    }
    if (!ctx.isOriginLocal()) {
        return UnsureResponse.INSTANCE;
    }
    if (isLocalModeForced(command) || command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP)) {
        if (ctx.lookupEntry(command.getKey()) == null) {
            entryFactory.wrapExternalEntry(ctx, command.getKey(), NullCacheEntry.getInstance(), false, false);
        }
        return invokeNext(ctx, command);
    }
    DistributionInfo info = checkTopology(command).getDistribution(command.getKey());
    if (info.primary() == null) {
        throw AllOwnersLostException.INSTANCE;
    }
    ResponseCollector<Response> collector = PassthroughSingleResponseCollector.INSTANCE;
    CompletionStage<Response> rpc = rpcManager.invokeCommand(info.primary(), command, collector, rpcManager.getSyncRpcOptions());
    return asyncValue(rpc.thenApply(response -> {
        if (response.isSuccessful()) {
            return ((SuccessfulResponse) response).getResponseValue();
        } else if (response instanceof UnsureResponse) {
            throw OutdatedTopologyException.RETRY_NEXT_TOPOLOGY;
        } else if (response instanceof CacheNotFoundResponse) {
            throw AllOwnersLostException.INSTANCE;
        } else if (response instanceof ExceptionResponse) {
            throw ResponseCollectors.wrapRemoteException(info.primary(), ((ExceptionResponse) response).getException());
        } else {
            throw new IllegalArgumentException("Unexpected response " + response);
        }
    }));
}
Also used : CacheNotFoundResponse(org.infinispan.remoting.responses.CacheNotFoundResponse) UnsuccessfulResponse(org.infinispan.remoting.responses.UnsuccessfulResponse) SuccessfulResponse(org.infinispan.remoting.responses.SuccessfulResponse) ExceptionResponse(org.infinispan.remoting.responses.ExceptionResponse) ValidResponse(org.infinispan.remoting.responses.ValidResponse) UnsureResponse(org.infinispan.remoting.responses.UnsureResponse) Response(org.infinispan.remoting.responses.Response) WriteCommand(org.infinispan.commands.write.WriteCommand) Arrays(java.util.Arrays) GetCacheEntryCommand(org.infinispan.commands.read.GetCacheEntryCommand) CacheNotFoundResponse(org.infinispan.remoting.responses.CacheNotFoundResponse) LogFactory(org.infinispan.util.logging.LogFactory) RemoteMetadata(org.infinispan.container.entries.RemoteMetadata) ClusteredGetAllCommand(org.infinispan.commands.remote.ClusteredGetAllCommand) Map(java.util.Map) RemoveCommand(org.infinispan.commands.write.RemoveCommand) ConsistentHash(org.infinispan.distribution.ch.ConsistentHash) EmbeddedMetadata(org.infinispan.metadata.EmbeddedMetadata) ReadWriteManyEntriesCommand(org.infinispan.commands.functional.ReadWriteManyEntriesCommand) UnsuccessfulResponse(org.infinispan.remoting.responses.UnsuccessfulResponse) Set(java.util.Set) GroupManager(org.infinispan.distribution.group.impl.GroupManager) CacheTopology(org.infinispan.topology.CacheTopology) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) DONT_LOAD(org.infinispan.commands.VisitableCommand.LoadType.DONT_LOAD) CompletionStage(java.util.concurrent.CompletionStage) Stream(java.util.stream.Stream) SuccessfulResponse(org.infinispan.remoting.responses.SuccessfulResponse) InternalCacheValue(org.infinispan.container.entries.InternalCacheValue) AbstractVisitor(org.infinispan.commands.AbstractVisitor) ArrayCollector(org.infinispan.commons.util.ArrayCollector) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) CacheEntryRemoved(org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved) PersistenceManager(org.infinispan.persistence.manager.PersistenceManager) ComputeCommand(org.infinispan.commands.write.ComputeCommand) MetadataAwareCommand(org.infinispan.commands.MetadataAwareCommand) EvictionManager(org.infinispan.eviction.EvictionManager) ReadOnlyKeyCommand(org.infinispan.commands.functional.ReadOnlyKeyCommand) ArrayList(java.util.ArrayList) WriteOnlyManyEntriesCommand(org.infinispan.commands.functional.WriteOnlyManyEntriesCommand) Start(org.infinispan.factories.annotations.Start) MapResponseCollector(org.infinispan.remoting.transport.impl.MapResponseCollector) PassthroughSingleResponseCollector(org.infinispan.remoting.transport.impl.PassthroughSingleResponseCollector) SingleResponseCollector(org.infinispan.remoting.transport.impl.SingleResponseCollector) DataWriteCommand(org.infinispan.commands.write.DataWriteCommand) FunctionalNotifier(org.infinispan.functional.impl.FunctionalNotifier) ValueMatcher(org.infinispan.commands.write.ValueMatcher) ClearCommand(org.infinispan.commands.write.ClearCommand) Address(org.infinispan.remoting.transport.Address) ExceptionResponse(org.infinispan.remoting.responses.ExceptionResponse) CacheEntry(org.infinispan.container.entries.CacheEntry) NotifyHelper(org.infinispan.notifications.cachelistener.NotifyHelper) WriteOnlyKeyValueCommand(org.infinispan.commands.functional.WriteOnlyKeyValueCommand) ValidResponse(org.infinispan.remoting.responses.ValidResponse) CacheNotifier(org.infinispan.notifications.cachelistener.CacheNotifier) Inject(org.infinispan.factories.annotations.Inject) ReadWriteKeyCommand(org.infinispan.commands.functional.ReadWriteKeyCommand) ReadWriteManyCommand(org.infinispan.commands.functional.ReadWriteManyCommand) NullCacheEntry(org.infinispan.container.entries.NullCacheEntry) AggregateCompletionStage(org.infinispan.util.concurrent.AggregateCompletionStage) ReplaceCommand(org.infinispan.commands.write.ReplaceCommand) EntryVersion(org.infinispan.container.versioning.EntryVersion) UnsureResponse(org.infinispan.remoting.responses.UnsureResponse) MultiTargetCollector(org.infinispan.util.concurrent.CommandAckCollector.MultiTargetCollector) GetKeysInGroupCommand(org.infinispan.commands.remote.GetKeysInGroupCommand) ActivationManager(org.infinispan.eviction.impl.ActivationManager) RepeatableReadEntry(org.infinispan.container.entries.RepeatableReadEntry) InvocationContext(org.infinispan.context.InvocationContext) CompletableFutures(org.infinispan.util.concurrent.CompletableFutures) OutdatedTopologyException(org.infinispan.statetransfer.OutdatedTopologyException) RpcOptions(org.infinispan.remoting.rpc.RpcOptions) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ReadWriteKeyValueCommand(org.infinispan.commands.functional.ReadWriteKeyValueCommand) MetadataImmortalCacheEntry(org.infinispan.container.entries.metadata.MetadataImmortalCacheEntry) DataOperationOrderer(org.infinispan.util.concurrent.DataOperationOrderer) InequalVersionComparisonResult(org.infinispan.container.versioning.InequalVersionComparisonResult) InvocationSuccessFunction(org.infinispan.interceptors.InvocationSuccessFunction) List(java.util.List) SingletonMapResponseCollector(org.infinispan.remoting.transport.impl.SingletonMapResponseCollector) InvocationFinallyAction(org.infinispan.interceptors.InvocationFinallyAction) PutKeyValueCommand(org.infinispan.commands.write.PutKeyValueCommand) FlagAffectedCommand(org.infinispan.commands.FlagAffectedCommand) TopologyAffectedCommand(org.infinispan.commands.TopologyAffectedCommand) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Metadata(org.infinispan.metadata.Metadata) CompletionStages(org.infinispan.util.concurrent.CompletionStages) GetAllCommand(org.infinispan.commands.read.GetAllCommand) Function(java.util.function.Function) AllOwnersLostException(org.infinispan.statetransfer.AllOwnersLostException) FlagBitSets(org.infinispan.context.impl.FlagBitSets) KeyPartitioner(org.infinispan.distribution.ch.KeyPartitioner) ClusteredGetCommand(org.infinispan.commands.remote.ClusteredGetCommand) IracPutKeyValueCommand(org.infinispan.commands.write.IracPutKeyValueCommand) Log(org.infinispan.util.logging.Log) AbstractDataCommand(org.infinispan.commands.read.AbstractDataCommand) SegmentSpecificCommand(org.infinispan.commands.SegmentSpecificCommand) MetadataImmortalCacheValue(org.infinispan.container.entries.metadata.MetadataImmortalCacheValue) ResponseCollectors(org.infinispan.remoting.transport.ResponseCollectors) Response(org.infinispan.remoting.responses.Response) ClusteringInterceptor(org.infinispan.interceptors.impl.ClusteringInterceptor) GetKeyValueCommand(org.infinispan.commands.read.GetKeyValueCommand) CacheException(org.infinispan.commons.CacheException) Iterator(java.util.Iterator) EvictCommand(org.infinispan.commands.write.EvictCommand) WriteOnlyManyCommand(org.infinispan.commands.functional.WriteOnlyManyCommand) PutMapCommand(org.infinispan.commands.write.PutMapCommand) ReadOnlyManyCommand(org.infinispan.commands.functional.ReadOnlyManyCommand) ComputeIfAbsentCommand(org.infinispan.commands.write.ComputeIfAbsentCommand) LocalizedCacheTopology(org.infinispan.distribution.LocalizedCacheTopology) Configuration(org.infinispan.configuration.cache.Configuration) DistributionInfo(org.infinispan.distribution.DistributionInfo) Operation(org.infinispan.util.concurrent.DataOperationOrderer.Operation) WriteOnlyKeyCommand(org.infinispan.commands.functional.WriteOnlyKeyCommand) VisitableCommand(org.infinispan.commands.VisitableCommand) DeliverOrder(org.infinispan.remoting.inboundhandler.DeliverOrder) Collections(java.util.Collections) TimeService(org.infinispan.commons.time.TimeService) ScatteredVersionManager(org.infinispan.scattered.ScatteredVersionManager) ExceptionResponse(org.infinispan.remoting.responses.ExceptionResponse) CacheNotFoundResponse(org.infinispan.remoting.responses.CacheNotFoundResponse) UnsureResponse(org.infinispan.remoting.responses.UnsureResponse) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) CacheEntry(org.infinispan.container.entries.CacheEntry) NullCacheEntry(org.infinispan.container.entries.NullCacheEntry) MetadataImmortalCacheEntry(org.infinispan.container.entries.metadata.MetadataImmortalCacheEntry) DistributionInfo(org.infinispan.distribution.DistributionInfo)

Example 5 with ResponseCollector

use of org.infinispan.remoting.transport.ResponseCollector in project infinispan by infinispan.

the class DefaultIracManager method createAndSendBatch.

private Completable createAndSendBatch(Address dst, Collection<? extends IracManagerKeyState> batch) {
    if (log.isTraceEnabled()) {
        log.tracef("Sending state response to %s. Batch=%s", dst, Util.toStr(batch));
    }
    RpcOptions rpcOptions = rpcManager.getSyncRpcOptions();
    ResponseCollector<Void> rspCollector = ignoreLeavers();
    IracStateResponseCommand cmd = commandsFactory.buildIracStateResponseCommand(batch.size());
    for (IracManagerKeyState state : batch) {
        IracMetadata tombstone = iracTombstoneManager.getTombstone(state.getKey());
        cmd.add(state, tombstone);
    }
    return Completable.fromCompletionStage(rpcManager.invokeCommand(dst, cmd, rspCollector, rpcOptions).exceptionally(throwable -> {
        if (log.isTraceEnabled()) {
            log.tracef(throwable, "Batch sent to %s failed! Batch=%s", dst, Util.toStr(batch));
        }
        return null;
    }));
}
Also used : JmxStatisticsExposer(org.infinispan.jmx.JmxStatisticsExposer) XSiteResponse(org.infinispan.remoting.transport.XSiteResponse) ComponentName(org.infinispan.factories.annotations.ComponentName) LogFactory(org.infinispan.util.logging.LogFactory) XSiteState(org.infinispan.xsite.statetransfer.XSiteState) VoidResponseCollector.ignoreLeavers(org.infinispan.remoting.transport.impl.VoidResponseCollector.ignoreLeavers) IracTouchKeyCommand(org.infinispan.commands.irac.IracTouchKeyCommand) KnownComponentNames(org.infinispan.factories.KnownComponentNames) SiteState(org.infinispan.xsite.status.SiteState) Scopes(org.infinispan.factories.scopes.Scopes) MBean(org.infinispan.jmx.annotations.MBean) CompletableFutures(org.infinispan.util.concurrent.CompletableFutures) ManagedOperation(org.infinispan.jmx.annotations.ManagedOperation) Map(java.util.Map) Scope(org.infinispan.factories.scopes.Scope) RpcOptions(org.infinispan.remoting.rpc.RpcOptions) XSiteBackup(org.infinispan.xsite.XSiteBackup) IracMetadata(org.infinispan.metadata.impl.IracMetadata) CommandsFactory(org.infinispan.commands.CommandsFactory) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CacheTopology(org.infinispan.topology.CacheTopology) Collectors(java.util.stream.Collectors) ResponseCollector(org.infinispan.remoting.transport.ResponseCollector) Objects(java.util.Objects) IntSet(org.infinispan.commons.util.IntSet) CompletionStage(java.util.concurrent.CompletionStage) MeasurementType(org.infinispan.jmx.annotations.MeasurementType) IracCleanupKeyCommand(org.infinispan.commands.irac.IracCleanupKeyCommand) ExponentialBackOffImpl(org.infinispan.util.ExponentialBackOffImpl) IntSets.mutableCopyFrom(org.infinispan.commons.util.IntSets.mutableCopyFrom) LongAdder(java.util.concurrent.atomic.LongAdder) InternalCacheEntry(org.infinispan.container.entries.InternalCacheEntry) BackupConfiguration(org.infinispan.configuration.cache.BackupConfiguration) XSiteStateTransferConfiguration(org.infinispan.configuration.cache.XSiteStateTransferConfiguration) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) CompletionStages(org.infinispan.util.concurrent.CompletionStages) DataType(org.infinispan.jmx.annotations.DataType) Function(java.util.function.Function) Start(org.infinispan.factories.annotations.Start) IracTombstoneManager(org.infinispan.container.versioning.irac.IracTombstoneManager) Log(org.infinispan.util.logging.Log) TakeOfflineManager(org.infinispan.xsite.status.TakeOfflineManager) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ClusteringDependentLogic(org.infinispan.interceptors.locking.ClusteringDependentLogic) Address(org.infinispan.remoting.transport.Address) IntSets.mutableEmptySet(org.infinispan.commons.util.IntSets.mutableEmptySet) Transport(org.infinispan.remoting.transport.Transport) XSiteReplicateCommand(org.infinispan.xsite.XSiteReplicateCommand) Flowable(io.reactivex.rxjava3.core.Flowable) Executor(java.util.concurrent.Executor) Util(org.infinispan.commons.util.Util) RpcManager(org.infinispan.remoting.rpc.RpcManager) Completable(io.reactivex.rxjava3.core.Completable) Inject(org.infinispan.factories.annotations.Inject) PrimitiveIterator(java.util.PrimitiveIterator) CacheRpcCommand(org.infinispan.commands.remote.CacheRpcCommand) ManagedAttribute(org.infinispan.jmx.annotations.ManagedAttribute) LocalizedCacheTopology(org.infinispan.distribution.LocalizedCacheTopology) Configuration(org.infinispan.configuration.cache.Configuration) DistributionInfo(org.infinispan.distribution.DistributionInfo) IracStateResponseCommand(org.infinispan.commands.irac.IracStateResponseCommand) DeliverOrder(org.infinispan.remoting.inboundhandler.DeliverOrder) ExponentialBackOff(org.infinispan.util.ExponentialBackOff) AggregateCompletionStage(org.infinispan.util.concurrent.AggregateCompletionStage) RpcOptions(org.infinispan.remoting.rpc.RpcOptions) IracMetadata(org.infinispan.metadata.impl.IracMetadata) IracStateResponseCommand(org.infinispan.commands.irac.IracStateResponseCommand)

Aggregations

CompletionStage (java.util.concurrent.CompletionStage)5 ResponseCollector (org.infinispan.remoting.transport.ResponseCollector)5 Address (org.infinispan.remoting.transport.Address)4 Collection (java.util.Collection)3 Map (java.util.Map)3 CompletableFuture (java.util.concurrent.CompletableFuture)3 Function (java.util.function.Function)3 InternalCacheEntry (org.infinispan.container.entries.InternalCacheEntry)3 DistributionInfo (org.infinispan.distribution.DistributionInfo)3 LocalizedCacheTopology (org.infinispan.distribution.LocalizedCacheTopology)3 DeliverOrder (org.infinispan.remoting.inboundhandler.DeliverOrder)3 RpcOptions (org.infinispan.remoting.rpc.RpcOptions)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Executor (java.util.concurrent.Executor)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)2 Predicate (java.util.function.Predicate)2 ReplicableCommand (org.infinispan.commands.ReplicableCommand)2 Configuration (org.infinispan.configuration.cache.Configuration)2