Class AbstractDelegatingTransport
- Since:
- 6.0
- Author:
- Pedro Ruivo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackupRemotely(Collection<org.infinispan.xsite.XSiteBackup> backups, XSiteRequest<?> rpcCommand) <O> XSiteResponse<O>backupRemotely(org.infinispan.xsite.XSiteBackup backup, XSiteRequest<O> rpcCommand) Sends a cross-site request to a remote site.voidChecks if thisTransportis able to perform cross-site requests.Retrieves the current cache instance's network addressorg.infinispan.util.logging.LoggetLog()Returns a list of members in the current cluster view.Returns physical addresses of members in the current cluster view.Retrieves the current cache instance's physical network addresses.Get the view of interconnected sites.int<T> CompletionStage<T>invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Invoke a command on a collection of node and pass the responses to aResponseCollector.<T> CompletionStage<T>invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Invoke a command on a single node and pass the response to aResponseCollector.<T> CompletionStage<T>invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Invoke a command on all the nodes in the cluster and pass the responses to aResponseCollector.<T> CompletionStage<T>invokeCommands(Collection<Address> targets, Function<Address, ReplicableCommand> commandGenerator, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit timeUnit) Invoke different commands on a collection of nodes and pass the responses to aResponseCollector.<T> CompletionStage<T>invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Invoke a command on a collection of nodes and pass the responses to aResponseCollector.invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) Deprecated, for removal: This API element is subject to removal in a future version.invokeRemotely(Map<Address, ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter, boolean totalOrder, boolean anycast) Deprecated, for removal: This API element is subject to removal in a future version.invokeRemotely(Map<Address, ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) Deprecated, for removal: This API element is subject to removal in a future version.invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) booleanbooleanTests whether the transport supports true multicastbooleanorg.infinispan.remoting.transport.raft.RaftManagervoidsendTo(Address destination, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommandto the destination using the specifiedDeliverOrder.voidsendToAll(ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommandto the entire cluster.voidsendToMany(Collection<Address> destinations, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommandto the set of destination using the specifiedDeliverOrder.voidstart()Invoked on component startvoidstop()Invoked on component stopvoidwaitForView(int viewId) Deprecated, for removal: This API element is subject to removal in a future version.withView(int expectedViewId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.remoting.transport.Transport
checkTotalOrderSupported, invokeCommandOnAll, invokeCommands, isPrimaryRelayNode, localNodeName
-
Field Details
-
actual
-
-
Constructor Details
-
AbstractDelegatingTransport
-
-
Method Details
-
invokeRemotely
@Deprecated(forRemoval=true) public Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:TransportInvokes an RPC call on other caches in the cluster.- Specified by:
invokeRemotelyin interfaceTransport- Parameters:
recipients- a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.rpcCommand- the cache command to invokemode- the response mode to usetimeout- a timeout after which to throw a replication exception. implementations.responseFilter- a response filter with which to filter out failed/unwanted/invalid responses.deliverOrder- theDeliverOrder.anycast- used when istrue, it means that it must use TOA instead of TOB.- Returns:
- a map of responses from each member contacted.
- Throws:
Exception- in the event of problems.
-
invokeRemotely
@Deprecated(forRemoval=true) public Map<Address,Response> invokeRemotely(Map<Address, ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter, boolean totalOrder, boolean anycast) throws ExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Specified by:
invokeRemotelyin interfaceTransport- Throws:
Exception
-
invokeRemotely
@Deprecated(forRemoval=true) public Map<Address,Response> invokeRemotely(Map<Address, ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) throws ExceptionDeprecated, for removal: This API element is subject to removal in a future version.- Specified by:
invokeRemotelyin interfaceTransport- Throws:
Exception
-
invokeRemotelyAsync
public CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) throws Exception - Specified by:
invokeRemotelyAsyncin interfaceTransport- Throws:
Exception
-
sendTo
public void sendTo(Address destination, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Description copied from interface:TransportAsynchronously sends theReplicableCommandto the destination using the specifiedDeliverOrder.- Specified by:
sendToin interfaceTransport- Parameters:
destination- the destination'sAddress.rpcCommand- theReplicableCommandto send.deliverOrder- theDeliverOrderto use.- Throws:
Exception- if there was problem sending the request.
-
sendToMany
public void sendToMany(Collection<Address> destinations, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Description copied from interface:TransportAsynchronously sends theReplicableCommandto the set of destination using the specifiedDeliverOrder.- Specified by:
sendToManyin interfaceTransport- Parameters:
destinations- the collection of destination'sAddress. Ifnull, it sends to all the members in the cluster.rpcCommand- theReplicableCommandto send.deliverOrder- theDeliverOrderto use.- Throws:
Exception- if there was problem sending the request.
-
sendToAll
public void sendToAll(ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Description copied from interface:TransportAsynchronously sends theReplicableCommandto the entire cluster. -
backupRemotely
public BackupResponse backupRemotely(Collection<org.infinispan.xsite.XSiteBackup> backups, XSiteRequest<?> rpcCommand) throws Exception - Specified by:
backupRemotelyin interfaceTransport- Throws:
Exception
-
backupRemotely
public <O> XSiteResponse<O> backupRemotely(org.infinispan.xsite.XSiteBackup backup, XSiteRequest<O> rpcCommand) Description copied from interface:TransportSends a cross-site request to a remote site.Currently, no reply values are supported. Or the request completes successfully or it throws an
Exception.If
XSiteBackup.isSync()returnsfalse, theXSiteResponseis only completed when the an ACK from the remote site is received. The invoker needs to make sure not to wait for theXSiteResponse.- Specified by:
backupRemotelyin interfaceTransport- Parameters:
backup- The remote site.rpcCommand- The command to send.- Returns:
- A
XSiteResponsethat is completed when the request is completed.
-
isCoordinator
public boolean isCoordinator()- Specified by:
isCoordinatorin interfaceTransport- Returns:
- true if the current Channel is the coordinator of the cluster.
-
getCoordinator
- Specified by:
getCoordinatorin interfaceTransport- Returns:
- the Address of the current coordinator.
-
getAddress
Description copied from interface:TransportRetrieves the current cache instance's network address- Specified by:
getAddressin interfaceTransport- Returns:
- an Address
-
getPhysicalAddresses
Description copied from interface:TransportRetrieves the current cache instance's physical network addresses. Some implementations might differentiate between logical and physical addresses in which case, this method allows clients to query the physical ones associated with the logical address. Implementations where logical and physical address are the same will simply return a single entry List that contains the same Address asTransport.getAddress().- Specified by:
getPhysicalAddressesin interfaceTransport- Returns:
- an List of Address
-
getMembers
Description copied from interface:TransportReturns a list of members in the current cluster view.- Specified by:
getMembersin interfaceTransport- Returns:
- a list of members. Typically, this would be defensively copied.
-
getMembersPhysicalAddresses
Description copied from interface:TransportReturns physical addresses of members in the current cluster view.- Specified by:
getMembersPhysicalAddressesin interfaceTransport- Returns:
- a list of physical addresses
-
isMulticastCapable
public boolean isMulticastCapable()Description copied from interface:TransportTests whether the transport supports true multicast- Specified by:
isMulticastCapablein interfaceTransport- Returns:
- true if the transport supports true multicast
-
checkCrossSiteAvailable
Description copied from interface:TransportChecks if thisTransportis able to perform cross-site requests.- Specified by:
checkCrossSiteAvailablein interfaceTransport- Throws:
CacheConfigurationException- if cross-site isn't available.
-
localSiteName
- Specified by:
localSiteNamein interfaceTransport- Returns:
- The local site name or
nullif thisTransportcannot make cross-site requests.
-
start
public void start()Description copied from interface:LifecycleInvoked on component start -
stop
public void stop()Description copied from interface:LifecycleInvoked on component stop -
getViewId
public int getViewId() -
withView
- Specified by:
withViewin interfaceTransport- Returns:
- A
CompletableFuturethat completes when the transport has installed the expected view.
-
waitForView
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
waitForViewin interfaceTransport- Throws:
InterruptedException
-
getLog
public org.infinispan.util.logging.Log getLog() -
getDelegate
-
getSitesView
Description copied from interface:TransportGet the view of interconnected sites. If no cross site replication has been configured, this method returns null. Inspecting the site view can be useful to see if the different sites have managed to join each other, which is pre-requisite to get cross replication working.- Specified by:
getSitesViewin interfaceTransport- Returns:
- set containing the connected sites, or null if no cross site replication has been enabled.
-
isSiteCoordinator
public boolean isSiteCoordinator()- Specified by:
isSiteCoordinatorin interfaceTransport- Returns:
trueif this node is a cross-site replication coordinator.
-
getRelayNodesAddress
- Specified by:
getRelayNodesAddressin interfaceTransport- Returns:
- The current site coordinators
Address.
-
invokeCommand
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Description copied from interface:TransportInvoke a command on a single node and pass the response to aResponseCollector.If the target is the local node, the command is never executed and
ResponseCollector.finish()is called directly.- Specified by:
invokeCommandin interfaceTransport
-
invokeCommand
public <T> CompletionStage<T> invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Description copied from interface:TransportInvoke a command on a collection of node and pass the responses to aResponseCollector.If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.
- Specified by:
invokeCommandin interfaceTransport
-
invokeCommandOnAll
public <T> CompletionStage<T> invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Description copied from interface:TransportInvoke a command on all the nodes in the cluster and pass the responses to aResponseCollector.The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
- Specified by:
invokeCommandOnAllin interfaceTransport
-
invokeCommandStaggered
public <T> CompletionStage<T> invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit unit) Description copied from interface:TransportInvoke a command on a collection of nodes and pass the responses to aResponseCollector.The command is only sent immediately to the first target, and there is an implementation-dependent delay before sending the command to each target. There is no delay if the target responds or leaves the cluster. The remaining targets are skipped if
ResponseCollector.addResponse(Address, Response)returns a non-nullvalue.The command is only executed on the remote nodes.
- Specified by:
invokeCommandStaggeredin interfaceTransport
-
invokeCommands
public <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address, ReplicableCommand> commandGenerator, ResponseCollector<T> collector, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, long timeout, TimeUnit timeUnit) Description copied from interface:TransportInvoke different commands on a collection of nodes and pass the responses to aResponseCollector.The command is only executed on the remote nodes.
- Specified by:
invokeCommandsin interfaceTransport
-
raftManager
public org.infinispan.remoting.transport.raft.RaftManager raftManager()- Specified by:
raftManagerin interfaceTransport- Returns:
- The
RaftManagerinstance,
-