use of org.infinispan.statetransfer.StateProvider in project infinispan by infinispan.
the class StateTransferGetListenersCommand method invokeAsync.
@Override
public CompletionStage<Collection<ClusterListenerReplicateCallable<Object, Object>>> invokeAsync(ComponentRegistry registry) throws Throwable {
StateProvider stateProvider = registry.getStateTransferManager().getStateProvider();
Collection<ClusterListenerReplicateCallable<Object, Object>> listeners = stateProvider.getClusterListenersToInstall();
return CompletableFuture.completedFuture(listeners);
}
use of org.infinispan.statetransfer.StateProvider in project infinispan by infinispan.
the class ConflictResolutionStartCommand method invokeAsync.
@Override
public CompletionStage<?> invokeAsync(ComponentRegistry registry) throws Throwable {
StateProvider stateProvider = registry.getStateTransferManager().getStateProvider();
stateProvider.startOutboundTransfer(origin, topologyId, segments, false);
return CompletableFutures.completedNull();
}
use of org.infinispan.statetransfer.StateProvider in project infinispan by infinispan.
the class StateTransferCancelCommand method invokeAsync.
@Override
public CompletionStage<?> invokeAsync(ComponentRegistry registry) throws Throwable {
StateProvider stateProvider = registry.getStateTransferManager().getStateProvider();
stateProvider.cancelOutboundTransfer(origin, topologyId, segments);
return CompletableFutures.completedNull();
}
use of org.infinispan.statetransfer.StateProvider in project infinispan by infinispan.
the class StateTransferStartCommand method invokeAsync.
@Override
public CompletionStage<?> invokeAsync(ComponentRegistry registry) throws Throwable {
StateProvider stateProvider = registry.getStateTransferManager().getStateProvider();
stateProvider.startOutboundTransfer(origin, topologyId, segments, true);
return CompletableFutures.completedNull();
}
use of org.infinispan.statetransfer.StateProvider in project infinispan by infinispan.
the class AbstractClusterListenerDistAddListenerTest method waitUntilRequestingListeners.
protected void waitUntilRequestingListeners(final Cache<?, ?> cache, final CheckPoint checkPoint) {
StateProvider sp = TestingUtil.extractComponent(cache, StateProvider.class);
final Answer<Object> forwardedAnswer = AdditionalAnswers.delegatesTo(sp);
StateProvider mockProvider = mock(StateProvider.class, withSettings().defaultAnswer(forwardedAnswer));
doAnswer(invocation -> {
// Wait for main thread to sync up
checkPoint.trigger("pre_cluster_listeners_invoked_" + cache);
// Now wait until main thread lets us through
checkPoint.awaitStrict("pre_cluster_listeners_release_" + cache, 10, TimeUnit.SECONDS);
try {
return forwardedAnswer.answer(invocation);
} finally {
// Wait for main thread to sync up
checkPoint.trigger("post_cluster_listeners_invoked_" + cache);
// Now wait until main thread lets us through
checkPoint.awaitStrict("post_cluster_listeners_release_" + cache, 10, TimeUnit.SECONDS);
}
}).when(mockProvider).getClusterListenersToInstall();
TestingUtil.replaceComponent(cache, StateProvider.class, mockProvider, true);
}
Aggregations