Package com.hazelcast.client.config
Class ClientTpcConfig
- java.lang.Object
-
- com.hazelcast.client.config.ClientTpcConfig
-
@Beta public final class ClientTpcConfig extends java.lang.Object
Contains client configurations for TPC.TPC is the next generation Hazelcast that uses thread-per-core model.
TPC-aware clients will connect to the TPC ports depending on the configured number of connections.
- Since:
- 5.3
-
-
Constructor Summary
Constructors Constructor Description ClientTpcConfig()
ClientTpcConfig(ClientTpcConfig tpcConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getConnectionCount()
Gets the connection count.int
hashCode()
boolean
isEnabled()
Returns if the TPC-aware mode is enabled.ClientTpcConfig
setConnectionCount(int connectionCount)
Sets the number of connections to TPC ports offered by a Hazelcast member.ClientTpcConfig
setEnabled(boolean enabled)
Enables or disables the TPC-aware mode.java.lang.String
toString()
-
-
-
Constructor Detail
-
ClientTpcConfig
public ClientTpcConfig()
-
ClientTpcConfig
public ClientTpcConfig(@Nonnull ClientTpcConfig tpcConfig)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Returns if the TPC-aware mode is enabled.- Returns:
true
if the TPC-aware mode is enabled,false
otherwise.- Since:
- 5.3
-
setEnabled
public ClientTpcConfig setEnabled(boolean enabled)
Enables or disables the TPC-aware mode.When enabled, the configuration option set by the
ClientNetworkConfig.setSmartRouting(boolean)
is ignored.- Parameters:
enabled
- flag to enable or disable TPC-aware mode- Returns:
- this configuration for chaining.
- Since:
- 5.3
-
setConnectionCount
public ClientTpcConfig setConnectionCount(int connectionCount)
Sets the number of connections to TPC ports offered by a Hazelcast member.- If set to a negative value, an IllegalArgumentException will be thrown.
- If set to 0, the client will connect to every TPC port.
- If set to the same number as returned by the server, the client will connect to every TPC port.
- If set to a number larger than 0 and smaller than the number of returned TPC ports, the client will randomize the list of ports and make the configured number of connections.
- If set to a number larger than the number of TPC ports, the client will connect to each tpc port (has same effect as configuring 0)
- Parameters:
connectionCount
- throws IllegalArgumentException when connectionCount is negative.- Since:
- 5.4
-
getConnectionCount
public int getConnectionCount()
Gets the connection count.- Returns:
- the number of connections.
- Since:
- 5.4
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-