public class RpcManagerImpl extends Object implements RpcManager, JmxStatisticsExposer
Transport
implementation,
and is used to set up the transport and provide lifecycle and dependency hooks into external transport
implementations.Constructor and Description |
---|
RpcManagerImpl() |
public void injectDependencies(Transport t, Configuration cfg, ReplicationQueue replicationQueue, CommandsFactory cf, StateTransferManager stateTransferManager, TimeService timeService)
public String getCommittedViewAsString()
public String getPendingViewAsString()
public CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options)
RpcManager
invokeRemotelyAsync
in interface RpcManager
recipients
- A list of nodes, or null
to invoke the command on all the members of the clusterrpc
- The command to invokeoptions
- The invocation optionsprotected <T> T rethrowAsCacheException(Throwable throwable)
public 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 Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcs, RpcOptions options)
invokeRemotely
in interface RpcManager
public void invokeRemotelyInFuture(NotifyingNotifiableFuture<Map<Address,Response>> future, Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options)
invokeRemotelyInFuture
in interface RpcManager
public void invokeRemotelyInFuture(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options, NotifyingNotifiableFuture<Object> future)
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()
JmxStatisticsExposer
resetStatistics
in interface JmxStatisticsExposer
public long getReplicationCount()
public long getReplicationFailures()
public boolean isStatisticsEnabled()
public boolean getStatisticsEnabled()
JmxStatisticsExposer
getStatisticsEnabled
in interface JmxStatisticsExposer
@Deprecated public void setStatisticsEnabled(boolean statisticsEnabled)
JmxStatisticsExposer
setStatisticsEnabled
in interface JmxStatisticsExposer
statisticsEnabled
- true if statistics should be capturedpublic 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
RpcOptionsBuilder
.
The RpcOptionsBuilder
is configured with the ResponseMode
and with
DeliverOrder.NONE
if the ResponseMode
is synchronous otherwise, with DeliverOrder.PER_SENDER
if asynchronous.getRpcOptionsBuilder
in interface RpcManager
responseMode
- the ResponseMode
.RpcOptionsBuilder
with the default options. The response and deliver mode are set as
described.public RpcOptionsBuilder getRpcOptionsBuilder(ResponseMode responseMode, DeliverOrder deliverOrder)
RpcManager
RpcOptionsBuilder
.getRpcOptionsBuilder
in interface RpcManager
responseMode
- the ResponseMode
.deliverOrder
- the DeliverOrder
.RpcOptionsBuilder
with the default options and the response mode and deliver mode set by the
parameters.public RpcOptions getDefaultRpcOptions(boolean sync)
RpcManager
RpcOptionsBuilder
.
The RpcOptionsBuilder
is configured with DeliverOrder.NONE
if the is true
otherwise, with
DeliverOrder.PER_SENDER
.getDefaultRpcOptions
in interface RpcManager
sync
- true
for Synchronous RpcOptionspublic RpcOptions getDefaultRpcOptions(boolean sync, DeliverOrder deliverOrder)
RpcManager
RpcOptionsBuilder
.getDefaultRpcOptions
in interface RpcManager
sync
- true
for Synchronous RpcOptionsdeliverOrder
- the DeliverOrder
to use.public List<Address> getMembers()
RpcManager
Transport.getMembers()
getMembers
in interface RpcManager
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.