Package com.yahoo.messagebus.network.rpc
Class RPCNetworkParams
- java.lang.Object
-
- com.yahoo.messagebus.network.rpc.RPCNetworkParams
-
public class RPCNetworkParams extends java.lang.Object
To facilitate several configuration parameters to theRPCNetwork
constructor, all parameters are held by this class. This class has reasonable default values for each parameter.- Author:
- Simon Thoresen Hult
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RPCNetworkParams.Optimization
-
Constructor Summary
Constructors Constructor Description RPCNetworkParams()
Constructs a new instance of this class with reasonable default values.RPCNetworkParams(RPCNetworkParams params)
Implements the copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getConnectionExpireSecs()
Returns the number of seconds before an idle network connection expires.Identity
getIdentity()
Returns the identity to use for the network.int
getListenPort()
Returns the port to listen to.int
getMaxInputBufferSize()
Returns the maximum input buffer size allowed for the underlying FNET connection.java.lang.String
getSlobrokConfigId()
Returns the config id of the slobrok config.com.yahoo.cloud.config.SlobroksConfig
getSlobroksConfig()
Returns the 'slobroks' config, if set, otherwise null.RPCNetworkParams
setConnectionExpireSecs(double secs)
Sets the number of seconds before an idle network connection expires.RPCNetworkParams
setIdentity(Identity identity)
Sets the identity to use for the network.RPCNetworkParams
setListenPort(int listenPort)
Sets the port to listen to.RPCNetworkParams
setNumNetworkThreads(int numNetworkThreads)
RPCNetworkParams
setNumTargetsPerSpec(int numTargetsPerSpec)
RPCNetworkParams
setOptimization(RPCNetworkParams.Optimization optimization)
RPCNetworkParams
setSlobrokConfigId(java.lang.String slobrokConfigId)
Sets the config id of the slobrok config.RPCNetworkParams
setSlobroksConfig(com.yahoo.cloud.config.SlobroksConfig slobroksConfig)
Sets the 'slobroks' config object.
-
-
-
Constructor Detail
-
RPCNetworkParams
public RPCNetworkParams()
Constructs a new instance of this class with reasonable default values.
-
RPCNetworkParams
public RPCNetworkParams(RPCNetworkParams params)
Implements the copy constructor.- Parameters:
params
- The object to copy.
-
-
Method Detail
-
getIdentity
public Identity getIdentity()
Returns the identity to use for the network.- Returns:
- The identity.
-
setIdentity
public RPCNetworkParams setIdentity(Identity identity)
Sets the identity to use for the network.- Parameters:
identity
- The new identity.- Returns:
- This, to allow chaining.
-
getSlobrokConfigId
public java.lang.String getSlobrokConfigId()
Returns the config id of the slobrok config.- Returns:
- The config id.
-
setSlobrokConfigId
public RPCNetworkParams setSlobrokConfigId(java.lang.String slobrokConfigId)
Sets the config id of the slobrok config. Setting this to null string will revert to the default slobrok config identifier.- Parameters:
slobrokConfigId
- The new config id.- Returns:
- This, to allow chaining.
-
getSlobroksConfig
public com.yahoo.cloud.config.SlobroksConfig getSlobroksConfig()
Returns the 'slobroks' config, if set, otherwise null.- Returns:
- The 'slobroks' config, if set, otherwise null.
-
setSlobroksConfig
public RPCNetworkParams setSlobroksConfig(com.yahoo.cloud.config.SlobroksConfig slobroksConfig)
Sets the 'slobroks' config object. Setting this to null will revert to self-subscribing usinggetSlobrokConfigId()
.- Parameters:
slobroksConfig
- the new slobroks config to use, or null.- Returns:
- This, to allow chaining.
-
getListenPort
public int getListenPort()
Returns the port to listen to.- Returns:
- The port.
-
setListenPort
public RPCNetworkParams setListenPort(int listenPort)
Sets the port to listen to.- Parameters:
listenPort
- The new port.- Returns:
- This, to allow chaining.
-
getConnectionExpireSecs
public double getConnectionExpireSecs()
Returns the number of seconds before an idle network connection expires.- Returns:
- The number of seconds.
-
setConnectionExpireSecs
public RPCNetworkParams setConnectionExpireSecs(double secs)
Sets the number of seconds before an idle network connection expires.- Parameters:
secs
- The number of seconds.- Returns:
- This, to allow chaining.
-
setNumTargetsPerSpec
public RPCNetworkParams setNumTargetsPerSpec(int numTargetsPerSpec)
-
setNumNetworkThreads
public RPCNetworkParams setNumNetworkThreads(int numNetworkThreads)
-
setOptimization
public RPCNetworkParams setOptimization(RPCNetworkParams.Optimization optimization)
-
getMaxInputBufferSize
public int getMaxInputBufferSize()
Returns the maximum input buffer size allowed for the underlying FNET connection.- Returns:
- The maximum number of bytes.
-
-