Class ExtendedStatisticRpcManager
java.lang.Object
org.infinispan.extendedstats.wrappers.ExtendedStatisticRpcManager
- All Implemented Interfaces:
RpcManager
Takes statistics about the RPC invocations.
- Since:
- 6.0
- Author:
- Roberto Palmieri, Sebastiano Peluso, Diego Didona, Pedro Ruivo
-
Constructor Summary
ConstructorDescriptionExtendedStatisticRpcManager
(RpcManager actual, CacheStatisticManager cacheStatisticManager, TimeService timeService, StreamingMarshaller marshaller) -
Method Summary
Modifier and TypeMethodDescription<T> T
blocking
(CompletionStage<T> request) Block on a request and return its result.Returns the address associated with this RpcManager or null if not part of the cluster.Returns members of a cluster scoped to the cache owning this RpcManager.int
Returns the current topology id.<T> CompletionStage<T>
invokeCommand
(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) 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, RpcOptions rpcOptions) Invoke a command on a single node and pass the response to aResponseCollector
.<T> CompletionStage<T>
invokeCommandOnAll
(ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) 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, RpcOptions rpcOptions) 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, RpcOptions rpcOptions) Invoke a command on a collection of nodes and pass the responses to aResponseCollector
.invokeRemotelyAsync
(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options) Invokes a command on remote nodes.<O> XSiteResponse<O>
invokeXSite
(org.infinispan.xsite.XSiteBackup backup, XSiteCacheRequest<O> command) Sends theXSiteCacheRequest
to a remote site.void
sendTo
(Address destination, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the destination using the specifiedDeliverOrder
.void
sendToAll
(ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the entire cluster.void
sendToMany
(Collection<Address> destinations, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Asynchronously sends theReplicableCommand
to the set of destination using the specifiedDeliverOrder
.
-
Constructor Details
-
ExtendedStatisticRpcManager
public ExtendedStatisticRpcManager(RpcManager actual, CacheStatisticManager cacheStatisticManager, TimeService timeService, StreamingMarshaller marshaller)
-
-
Method Details
-
invokeCommand
public <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) Description copied from interface:RpcManager
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 andResponseCollector.finish()
is called directly.- Specified by:
invokeCommand
in interfaceRpcManager
-
invokeCommand
public <T> CompletionStage<T> invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) Description copied from interface:RpcManager
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.- Specified by:
invokeCommand
in interfaceRpcManager
-
invokeCommandOnAll
public <T> CompletionStage<T> invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) Description copied from interface:RpcManager
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.- Specified by:
invokeCommandOnAll
in interfaceRpcManager
-
invokeCommandStaggered
public <T> CompletionStage<T> invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions) Description copied from interface:RpcManager
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 ifResponseCollector.addResponse(Address, Response)
returns a non-null
value. The command is only executed on the remote nodes.- Specified by:
invokeCommandStaggered
in interfaceRpcManager
-
invokeCommands
public <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address, ReplicableCommand> commandGenerator, ResponseCollector<T> collector, RpcOptions rpcOptions) Description copied from interface:RpcManager
Invoke different commands on a collection of nodes and pass the responses to aResponseCollector
. The command is only executed on the remote nodes and it is not executed in the local node even if it is in thetargets
.- Specified by:
invokeCommands
in interfaceRpcManager
-
blocking
Description copied from interface:RpcManager
Block on a request and return its result.- Specified by:
blocking
in interfaceRpcManager
-
invokeRemotelyAsync
public CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options) Description copied from interface:RpcManager
Invokes a command on remote nodes.- Specified by:
invokeRemotelyAsync
in interfaceRpcManager
- Parameters:
recipients
- A list of nodes, ornull
to invoke the command on all the members of the clusterrpc
- The command to invokeoptions
- The invocation options- Returns:
- A future that, when completed, returns the responses from the remote nodes.
-
sendTo
public void sendTo(Address destination, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Description copied from interface:RpcManager
Asynchronously sends theReplicableCommand
to the destination using the specifiedDeliverOrder
.- Specified by:
sendTo
in interfaceRpcManager
- Parameters:
destination
- the destination'sAddress
.command
- theReplicableCommand
to send.deliverOrder
- theDeliverOrder
to use.
-
sendToMany
public void sendToMany(Collection<Address> destinations, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Description copied from interface:RpcManager
Asynchronously sends theReplicableCommand
to the set of destination using the specifiedDeliverOrder
.- Specified by:
sendToMany
in interfaceRpcManager
- Parameters:
destinations
- the collection of destination'sAddress
. Ifnull
, it sends to all the members in the cluster.command
- theReplicableCommand
to send.deliverOrder
- theDeliverOrder
to use.
-
sendToAll
public void sendToAll(ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder) Description copied from interface:RpcManager
Asynchronously sends theReplicableCommand
to the entire cluster.- Specified by:
sendToAll
in interfaceRpcManager
-
invokeXSite
public <O> XSiteResponse<O> invokeXSite(org.infinispan.xsite.XSiteBackup backup, XSiteCacheRequest<O> command) Description copied from interface:RpcManager
Sends theXSiteCacheRequest
to a remote site.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
.- Specified by:
invokeXSite
in interfaceRpcManager
- Parameters:
backup
- The site to where the command is sent.command
- The command to send.- Returns:
- A
XSiteResponse
that is completed when the request is completed.
-
getTransport
- Specified by:
getTransport
in interfaceRpcManager
- Returns:
- a reference to the underlying transport.
-
getMembers
Description copied from interface:RpcManager
Returns members of a cluster scoped to the cache owning this RpcManager. Note that this List is always a subset ofTransport.getMembers()
- Specified by:
getMembers
in interfaceRpcManager
- Returns:
- a list of cache scoped cluster members
-
getAddress
Description copied from interface:RpcManager
Returns the address associated with this RpcManager or null if not part of the cluster.- Specified by:
getAddress
in interfaceRpcManager
-
getTopologyId
public int getTopologyId()Description copied from interface:RpcManager
Returns the current topology id. As opposed to the viewId which is updated whenever the cluster changes, the topologyId is updated when a new cache instance is started or removed - this doesn't necessarily coincide with a node being added/removed to the cluster.- Specified by:
getTopologyId
in interfaceRpcManager
-
getSyncRpcOptions
- Specified by:
getSyncRpcOptions
in interfaceRpcManager
- Returns:
- The default options for synchronous remote invocations.
-
getTotalSyncRpcOptions
- Specified by:
getTotalSyncRpcOptions
in interfaceRpcManager
- Returns:
- The default options for total order remote invocations.
-