Interface Transport
- All Superinterfaces:
Lifecycle
- All Known Implementing Classes:
AbstractDelegatingTransport
,JGroupsTransport
- Since:
- 4.0
- Author:
- Manik Surtani, Galder ZamarreƱo
-
Method Summary
Modifier and TypeMethodDescription<O> XSiteResponse
<O> backupRemotely
(org.infinispan.xsite.XSiteBackup backup, XSiteRequest<O> rpcCommand) Sends a cross-site request to a remote site.void
Checks if thisTransport
is able to perform cross-site requests.default void
Deprecated, for removal: This API element is subject to removal in a future version.Total order support droppedRetrieves the current cache instance's network addressorg.infinispan.util.logging.Log
getLog()
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
default <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
.default <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
.default <T> CompletionStage
<T> invokeCommandOnAll
(Collection<Address> requiredTargets, 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
.default <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
.default <T> CompletionStage
<T> invokeCommands
(Collection<Address> targets, Function<Address, ReplicableCommand> commandGenerator, ResponseCollector<T> responseCollector, long timeout, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Deprecated, for removal: This API element is subject to removal in a future version.Introduced in 9.1, but replaced in 9.2 withinvokeCommands(Collection, Function, ResponseCollector, DeliverOrder, long, TimeUnit)
.default <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
.default <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
(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.Since 9.2, please useinvokeRemotelyAsync(Collection, ReplicableCommand, ResponseMode, long, ResponseFilter, DeliverOrder, boolean)
instead.invokeRemotelyAsync
(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder, boolean anycast) boolean
boolean
Tests whether the transport supports true multicastdefault boolean
boolean
default String
org.infinispan.remoting.transport.raft.RaftManager
void
sendTo
(Address destination, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the destination using the specifiedDeliverOrder
.default void
sendToAll
(ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the entire cluster.void
sendToMany
(Collection<Address> destinations, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the set of destination using the specifiedDeliverOrder
.void
start()
Invoked on component startvoid
stop()
Invoked on component stopwithView
(int expectedViewId)
-
Method Details
-
invokeRemotelyAsync
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 - Throws:
Exception
-
sendTo
void sendTo(Address destination, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Asynchronously sends theReplicableCommand
to the destination using the specifiedDeliverOrder
.- Parameters:
destination
- the destination'sAddress
.rpcCommand
- theReplicableCommand
to send.deliverOrder
- theDeliverOrder
to use.- Throws:
Exception
- if there was problem sending the request.
-
sendToMany
void sendToMany(Collection<Address> destinations, ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Asynchronously sends theReplicableCommand
to the set of destination using the specifiedDeliverOrder
.- Parameters:
destinations
- the collection of destination'sAddress
. Ifnull
, it sends to all the members in the cluster.rpcCommand
- theReplicableCommand
to send.deliverOrder
- theDeliverOrder
to use.- Throws:
Exception
- if there was problem sending the request.
-
sendToAll
@Experimental default void sendToAll(ReplicableCommand rpcCommand, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) throws Exception Asynchronously sends theReplicableCommand
to the entire cluster.- Throws:
Exception
- Since:
- 9.2
-
invokeRemotely
@Deprecated(forRemoval=true, since="8.0") default 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.- Throws:
Exception
-
invokeRemotely
@Deprecated(forRemoval=true, since="9.2") default 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.Since 9.2, please useinvokeRemotelyAsync(Collection, ReplicableCommand, ResponseMode, long, ResponseFilter, DeliverOrder, boolean)
instead.- Throws:
Exception
-
backupRemotely
<O> XSiteResponse<O> backupRemotely(org.infinispan.xsite.XSiteBackup backup, XSiteRequest<O> rpcCommand) Sends 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
, theXSiteResponse
is only completed when the an ACK from the remote site is received. The invoker needs to make sure not to wait for theXSiteResponse
.- Parameters:
backup
- The remote site.rpcCommand
- The command to send.- Returns:
- A
XSiteResponse
that is completed when the request is completed.
-
isCoordinator
boolean isCoordinator()- Returns:
- true if the current Channel is the coordinator of the cluster.
-
getCoordinator
Address getCoordinator()- Returns:
- the Address of the current coordinator.
-
getAddress
Address getAddress()Retrieves the current cache instance's network address- Returns:
- an Address
-
getPhysicalAddresses
Retrieves 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 asgetAddress()
.- Returns:
- an List of Address
-
getMembers
Returns a list of members in the current cluster view.- Returns:
- a list of members. Typically, this would be defensively copied.
-
getMembersPhysicalAddresses
Returns physical addresses of members in the current cluster view.- Returns:
- a list of physical addresses
-
isMulticastCapable
boolean isMulticastCapable()Tests whether the transport supports true multicast- Returns:
- true if the transport supports true multicast
-
checkCrossSiteAvailable
Checks if thisTransport
is able to perform cross-site requests.- Throws:
CacheConfigurationException
- if cross-site isn't available.
-
localSiteName
String localSiteName()- Returns:
- The local site name or
null
if thisTransport
cannot make cross-site requests.
-
localNodeName
- Returns:
- The local node name, defaults to the local node address.
-
start
void start()Description copied from interface:Lifecycle
Invoked on component start -
stop
void stop()Description copied from interface:Lifecycle
Invoked on component stop -
getViewId
int getViewId()- Throws:
CacheException
- if the transport has been stopped.
-
withView
- Returns:
- A
CompletableFuture
that completes when the transport has installed the expected view.
-
getLog
org.infinispan.util.logging.Log getLog() -
checkTotalOrderSupported
Deprecated, for removal: This API element is subject to removal in a future version.Total order support droppedcheck if the transport has configured with total order deliver properties (has the sequencer in JGroups protocol stack. -
getSitesView
Get 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.- Returns:
- set containing the connected sites, or null if no cross site replication has been enabled.
-
isSiteCoordinator
boolean isSiteCoordinator()- Returns:
true
if this node is a cross-site replication coordinator.
-
getRelayNodesAddress
Collection<Address> getRelayNodesAddress()- Returns:
- The current site coordinators
Address
.
-
isPrimaryRelayNode
default boolean isPrimaryRelayNode() -
invokeCommand
@Experimental default <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
.If the target is the local node, the command is never executed and
ResponseCollector.finish()
is called directly.- Since:
- 9.1
-
invokeCommand
@Experimental default <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
.If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.
- Since:
- 9.1
-
invokeCommandOnAll
@Experimental default <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
.The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
- Since:
- 9.1
-
invokeCommandOnAll
@Experimental default <T> CompletionStage<T> invokeCommandOnAll(Collection<Address> requiredTargets, 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
.he command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
- Since:
- 9.3
-
invokeCommandStaggered
@Experimental default <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
.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-null
value.The command is only executed on the remote nodes.
- Since:
- 9.1
-
invokeCommands
@Deprecated(forRemoval=true, since="9.2") default <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address, ReplicableCommand> commandGenerator, ResponseCollector<T> responseCollector, long timeout, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Deprecated, for removal: This API element is subject to removal in a future version.Introduced in 9.1, but replaced in 9.2 withinvokeCommands(Collection, Function, ResponseCollector, DeliverOrder, long, TimeUnit)
.Invoke different commands on a collection of nodes and pass the responses to aResponseCollector
.The command is only executed on the remote nodes.
-
invokeCommands
@Experimental default <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
.The command is only executed on the remote nodes.
- Since:
- 9.2
-
raftManager
org.infinispan.remoting.transport.raft.RaftManager raftManager()- Returns:
- The
RaftManager
instance,
-