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() |
Modifier and Type | Method and Description |
---|---|
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)
Creates a new
RpcOptionsBuilder . |
RpcOptions |
getDefaultRpcOptions(boolean sync,
DeliverOrder deliverOrder)
Creates a new
RpcOptionsBuilder . |
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)
Creates a new
RpcOptionsBuilder . |
RpcOptionsBuilder |
getRpcOptionsBuilder(ResponseMode responseMode,
DeliverOrder deliverOrder)
Creates a new
RpcOptionsBuilder . |
boolean |
getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured.
|
String |
getSuccessRatio() |
double |
getSuccessRatioFloatingPoint() |
int |
getTopologyId()
Returns the current topology id.
|
Transport |
getTransport() |
void |
injectDependencies(Transport t,
Configuration cfg,
ReplicationQueue replicationQueue,
CommandsFactory cf,
StateTransferManager stateTransferManager,
TimeService timeService) |
Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options)
Invokes an RPC call on other caches in the cluster.
|
Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcs,
RpcOptions options) |
CompletableFuture<Map<Address,Response>> |
invokeRemotelyAsync(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options)
Invokes a command on remote nodes.
|
void |
invokeRemotelyInFuture(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options,
org.infinispan.commons.util.concurrent.NotifyingNotifiableFuture<Object> future) |
void |
invokeRemotelyInFuture(org.infinispan.commons.util.concurrent.NotifyingNotifiableFuture<Map<Address,Response>> future,
Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options) |
boolean |
isStatisticsEnabled() |
void |
resetStatistics()
Resets an interceptor's cache statistics
|
protected <T> T |
rethrowAsCacheException(Throwable throwable) |
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, 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(org.infinispan.commons.util.concurrent.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, org.infinispan.commons.util.concurrent.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 © 2018 JBoss, a division of Red Hat. All rights reserved.