Search in sources :

Example 1 with AutoStateTransferResponse

use of org.infinispan.xsite.response.AutoStateTransferResponse in project infinispan by infinispan.

the class XSiteAutoTransferStatusCommand method invokeAsync.

@Override
public CompletionStage<AutoStateTransferResponse> invokeAsync(ComponentRegistry registry) throws Throwable {
    boolean offline = registry.getTakeOfflineManager().running().getSiteState(site) == SiteState.OFFLINE;
    XSiteStateTransferMode mode = registry.getXSiteStateTransferManager().running().stateTransferMode(site);
    return CompletableFuture.completedFuture(new AutoStateTransferResponse(offline, mode));
}
Also used : XSiteStateTransferMode(org.infinispan.configuration.cache.XSiteStateTransferMode) AutoStateTransferResponse(org.infinispan.xsite.response.AutoStateTransferResponse)

Example 2 with AutoStateTransferResponse

use of org.infinispan.xsite.response.AutoStateTransferResponse in project infinispan by infinispan.

the class XSiteStateTransferManagerImpl method isStateTransferRequired.

private CompletionStage<Boolean> isStateTransferRequired(RemoteSiteStatus status) {
    final String site = status.getSiteName();
    AutoStateTransferResponseCollector collector = new AutoStateTransferResponseCollector(takeOfflineManager.getSiteState(site) == SiteState.OFFLINE, status.stateTransferMode());
    XSiteAutoTransferStatusCommand cmd = commandsFactory.buildXSiteAutoTransferStatusCommand(site);
    return rpcManager.invokeCommandOnAll(cmd, collector, rpcManager.getSyncRpcOptions()).thenApply(AutoStateTransferResponse::canDoAutomaticStateTransfer);
}
Also used : AutoStateTransferResponseCollector(org.infinispan.xsite.response.AutoStateTransferResponseCollector) AutoStateTransferResponse(org.infinispan.xsite.response.AutoStateTransferResponse) XSiteAutoTransferStatusCommand(org.infinispan.xsite.commands.XSiteAutoTransferStatusCommand)

Aggregations

AutoStateTransferResponse (org.infinispan.xsite.response.AutoStateTransferResponse)2 XSiteStateTransferMode (org.infinispan.configuration.cache.XSiteStateTransferMode)1 XSiteAutoTransferStatusCommand (org.infinispan.xsite.commands.XSiteAutoTransferStatusCommand)1 AutoStateTransferResponseCollector (org.infinispan.xsite.response.AutoStateTransferResponseCollector)1