public class RpcManagerImpl extends Object implements RpcManager
Transport
implementation,
and is used to set up the transport and provide lifecycle and dependency hooks into external transport
implementations.Constructor and Description |
---|
RpcManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
broadcastRpcCommand(ReplicableCommand rpc,
boolean sync)
Broadcasts an RPC command to the entire cluster.
|
void |
broadcastRpcCommand(ReplicableCommand rpc,
boolean sync,
boolean usePriorityQueue)
Broadcasts an RPC command to the entire cluster.
|
void |
broadcastRpcCommandInFuture(ReplicableCommand rpc,
boolean usePriorityQueue,
NotifyingNotifiableFuture<Object> l)
The same as
RpcManager.broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean, boolean) except that
the task is passed to the transport executor and a Future is returned. |
void |
broadcastRpcCommandInFuture(ReplicableCommand rpc,
NotifyingNotifiableFuture<Object> l)
The same as
RpcManager.broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean) except that the task
is passed to the transport executor and a Future is returned. |
Address |
getAddress()
Returns the address associated with this RpcManager or null if not part of the cluster.
|
long |
getAverageReplicationTime() |
String |
getCommittedViewAsString() |
RpcOptions |
getDefaultRpcOptions(boolean sync)
|
RpcOptions |
getDefaultRpcOptions(boolean sync,
boolean fifoOrder)
Builds a RpcOptions based on the parameters
|
List<Address> |
getMembers()
Returns members of a cluster scoped to the cache owning this RpcManager.
|
String |
getPendingViewAsString() |
long |
getReplicationCount() |
long |
getReplicationFailures() |
RpcOptionsBuilder |
getRpcOptionsBuilder(ResponseMode responseMode)
This method is equivalent to
getRpcOptionsBuilder(responseMode, true) |
RpcOptionsBuilder |
getRpcOptionsBuilder(ResponseMode responseMode,
boolean fifoOrder) |
String |
getSuccessRatio() |
double |
getSuccessRatioFloatingPoint() |
int |
getTopologyId()
Returns the current topology id.
|
Transport |
getTransport() |
void |
injectDependencies(Transport t,
Cache cache,
Configuration cfg,
ReplicationQueue replicationQueue,
CommandsFactory cf,
ExecutorService e,
LocalTopologyManager localTopologyManager,
StateTransferManager stateTransferManager,
TimeService timeService) |
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpc,
boolean sync)
Broadcasts an RPC command to a specified set of recipients
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpc,
boolean sync,
boolean usePriorityQueue)
Broadcasts an RPC command to a specified set of recipients
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpc,
boolean sync,
boolean usePriorityQueue,
long timeout) |
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout)
Invokes an RPC call on other caches in the cluster.
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
boolean usePriorityQueue)
Invokes an RPC call on other caches in the cluster.
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter)
Invokes an RPC call on other caches in the cluster.
|
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options)
Invokes an RPC call on other caches in the cluster.
|
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
boolean usePriorityQueue,
NotifyingNotifiableFuture<Object> l)
The same as
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean)
except that the task is passed to the transport executor and a Future is returned. |
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
boolean usePriorityQueue,
NotifyingNotifiableFuture<Object> l,
long timeout)
The same as
#invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture) except that you can specify a timeout. |
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
boolean usePriorityQueue,
NotifyingNotifiableFuture<Object> l,
long timeout,
boolean ignoreLeavers)
The same as
#invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture, long) except that you can specify a response mode. |
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
NotifyingNotifiableFuture<Object> l)
The same as
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean)
except that the task is passed to the transport executor and a Future is returned. |
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options,
NotifyingNotifiableFuture<Object> future)
The same as
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, RpcOptions)
except that the task is passed to the transport executor and a Future is returned. |
boolean |
isStatisticsEnabled() |
void |
resetStatistics() |
void |
setStatisticsEnabled(boolean statisticsEnabled)
Deprecated.
We already have an attribute, we shouldn't have an operation for the same thing.
|
void |
setTransport(Transport t) |
public void injectDependencies(Transport t, Cache cache, Configuration cfg, ReplicationQueue replicationQueue, CommandsFactory cf, ExecutorService e, LocalTopologyManager localTopologyManager, StateTransferManager stateTransferManager, TimeService timeService)
public String getCommittedViewAsString()
public String getPendingViewAsString()
public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter)
RpcManager
invokeRemotely
in interface RpcManager
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.usePriorityQueue
- if true, a priority queue is used to deliver messages. May not be supported by all
implementations.responseFilter
- a response filter with which to filter out failed/unwanted/invalid responses.public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, boolean usePriorityQueue)
RpcManager
invokeRemotely
in interface RpcManager
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.usePriorityQueue
- if true, a priority queue is used to deliver messages. May not be supported by all
implementations.public final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout)
RpcManager
invokeRemotely
in interface RpcManager
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.public final void broadcastRpcCommand(ReplicableCommand rpc, boolean sync) throws RpcException
RpcManager
broadcastRpcCommand
in interface RpcManager
rpc
- command to execute remotelysync
- if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.RpcException
- in the event of problemspublic final void broadcastRpcCommand(ReplicableCommand rpc, boolean sync, boolean usePriorityQueue) throws RpcException
RpcManager
broadcastRpcCommand
in interface RpcManager
rpc
- command to execute remotelysync
- if true, the transport will operate in sync mode. Otherwise, it will operate in async
mode.usePriorityQueue
- if true, a priority queue is usedRpcException
- in the event of problemspublic final void broadcastRpcCommandInFuture(ReplicableCommand rpc, NotifyingNotifiableFuture<Object> l)
RpcManager
RpcManager.broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean)
except that the task
is passed to the transport executor and a Future is returned. The transport always deals with this
synchronously.broadcastRpcCommandInFuture
in interface RpcManager
rpc
- command to execute remotelyl
- the future which will be passed back to the userpublic final void broadcastRpcCommandInFuture(ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l)
RpcManager
RpcManager.broadcastRpcCommand(org.infinispan.commands.ReplicableCommand, boolean, boolean)
except that
the task is passed to the transport executor and a Future is returned. The transport always deals with this
synchronously.broadcastRpcCommandInFuture
in interface RpcManager
rpc
- command to execute remotelyusePriorityQueue
- if true, a priority queue is usedl
- the future which will be passed back to the userpublic final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync) throws RpcException
RpcManager
invokeRemotely
in interface RpcManager
recipients
- recipients to invoke remote command onrpc
- command to execute remotelysync
- if true, the transport will operate in sync mode. Otherwise, it will operate in async mode.RpcException
- in the event of problemspublic final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue) throws RpcException
RpcManager
invokeRemotely
in interface RpcManager
recipients
- recipients to invoke remote command onrpc
- command to execute remotelysync
- if true, the transport will operate in sync mode. Otherwise, it will operate in async
mode.usePriorityQueue
- if true, a priority queue is usedRpcException
- in the event of problemspublic final Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue, long timeout) throws RpcException
RpcException
public final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, NotifyingNotifiableFuture<Object> l)
RpcManager
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean)
except that the task is passed to the transport executor and a Future is returned. The transport always deals
with this synchronously.invokeRemotelyInFuture
in interface RpcManager
recipients
- recipients to invoke remote call onrpc
- command to execute remotelyl
- the future which will be passed back to the userpublic final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l)
RpcManager
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, boolean)
except that the task is passed to the transport executor and a Future is returned. The transport always deals
with this synchronously.invokeRemotelyInFuture
in interface RpcManager
recipients
- recipients to invoke remote call onrpc
- command to execute remotelyusePriorityQueue
- if true, a priority queue is usedl
- the future which will be passed back to the userpublic final void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l, long timeout)
RpcManager
#invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture)
except that you can specify a timeout.invokeRemotelyInFuture
in interface RpcManager
recipients
- recipients to invoke remote call onrpc
- command to execute remotelyusePriorityQueue
- if true, a priority queue is usedl
- the future which will be passed back to the usertimeout
- after which to give up (in millis)public void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, boolean usePriorityQueue, NotifyingNotifiableFuture<Object> l, long timeout, boolean ignoreLeavers)
RpcManager
#invokeRemotelyInFuture(java.util.Collection, org.infinispan.commands.ReplicableCommand,
boolean, org.infinispan.util.concurrent.NotifyingNotifiableFuture, long)
except that you can specify a response mode.invokeRemotelyInFuture
in interface RpcManager
recipients
- recipients to invoke remote call onrpc
- command to execute remotelyusePriorityQueue
- if true, a priority queue is usedl
- the future which will be passed back to the usertimeout
- after which to give up (in millis)ignoreLeavers
- if true
, recipients that leave or have already left the cluster are ignored
if false
, a SuspectException
is thrown when a leave is detectedpublic Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options)
RpcManager
invokeRemotely
in interface RpcManager
recipients
- a list of Addresses to invoke the call on. If this is null
, the call is broadcast to the
entire cluster.rpc
- command to execute remotely.options
- it configures the invocation. The same instance can be re-used since RpcManager
does
not change it. Any change in RpcOptions
during a remote invocation can lead to
unpredictable behavior.public void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options, NotifyingNotifiableFuture<Object> future)
RpcManager
RpcManager.invokeRemotely(java.util.Collection, org.infinispan.commands.ReplicableCommand, RpcOptions)
except that the task is passed to the transport executor and a Future is returned. The transport always deals
with this synchronously.invokeRemotelyInFuture
in interface RpcManager
recipients
- recipients to invoke remote call on. If this is null
, the call is broadcast to the
entire cluster.rpc
- command to execute remotely.options
- it configures the invocation. The same instance can be re-used since RpcManager
does
not change it. Any change in RpcOptions
during a remote invocation can lead to
unpredictable behavior.future
- the future which will be passed back to the user.public Transport getTransport()
getTransport
in interface RpcManager
public void resetStatistics()
public long getReplicationCount()
public long getReplicationFailures()
public boolean isStatisticsEnabled()
@Deprecated public void setStatisticsEnabled(boolean statisticsEnabled)
public String getSuccessRatio()
public double getSuccessRatioFloatingPoint()
public long getAverageReplicationTime()
public void setTransport(Transport t)
public Address getAddress()
RpcManager
getAddress
in interface RpcManager
public int getTopologyId()
RpcManager
getTopologyId
in interface RpcManager
public RpcOptionsBuilder getRpcOptionsBuilder(ResponseMode responseMode)
RpcManager
getRpcOptionsBuilder(responseMode, true)
getRpcOptionsBuilder
in interface RpcManager
RpcOptionsBuilder
with the default options, the response mode set by
and FIFO deliver order.public RpcOptionsBuilder getRpcOptionsBuilder(ResponseMode responseMode, boolean fifoOrder)
getRpcOptionsBuilder
in interface RpcManager
RpcOptionsBuilder
with the default options, the response mode set by
and the deliver order as fifo if the is true
.public RpcOptions getDefaultRpcOptions(boolean sync)
RpcManager
RpcManager.getDefaultRpcOptions(boolean, boolean)
.
It is equivalent to getDefaultRpcOptions(sync, true)
getDefaultRpcOptions
in interface RpcManager
sync
- true
for Synchronous RpcOptionspublic RpcOptions getDefaultRpcOptions(boolean sync, boolean fifoOrder)
RpcManager
getDefaultRpcOptions
in interface RpcManager
sync
- true
for Synchronous RpcOptionspublic List<Address> getMembers()
RpcManager
Transport.getMembers()
getMembers
in interface RpcManager
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.