Package com.hazelcast.client.config
Class ClientTpcConfig
java.lang.Object
com.hazelcast.client.config.ClientTpcConfig
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Gets the connection count.int
hashCode()
boolean
Returns if the TPC-aware mode is enabled.setConnectionCount
(int connectionCount) Sets the number of connections to TPC ports offered by a Hazelcast member.setEnabled
(boolean enabled) Enables or disables the TPC-aware mode.toString()
-
Constructor Details
-
ClientTpcConfig
public ClientTpcConfig() -
ClientTpcConfig
-
-
Method Details
-
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
Enables or disables the TPC-aware mode.When enabled, the configuration option set by the
ClusterRoutingConfig.setRoutingMode(RoutingMode)
} is ignored.- Parameters:
enabled
- flag to enable or disable TPC-aware mode- Returns:
- this configuration for chaining.
- Since:
- 5.3
-
setConnectionCount
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
-
hashCode
public int hashCode() -
toString
-