Class SqlConfig
public class SqlConfig extends Object
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_EXECUTOR_POOL_SIZE
Default number of threads responsible for execution of SQL statements.static int
DEFAULT_OPERATION_POOL_SIZE
Default number of threads responsible for network operations processing.static int
DEFAULT_STATEMENT_TIMEOUT_MILLIS
Default timeout in milliseconds that is applied to statements without explicit timeout. -
Constructor Summary
Constructors Constructor Description SqlConfig()
-
Method Summary
Modifier and Type Method Description int
getExecutorPoolSize()
Gets the number of threads responsible for execution of SQL statements.int
getOperationPoolSize()
Gets the number of threads responsible for network operations processing.long
getStatementTimeoutMillis()
Gets the timeout in milliseconds that is applied to statements without an explicit timeout.SqlConfig
setExecutorPoolSize(int executorPoolSize)
Sets the number of threads responsible for execution of SQL statements.SqlConfig
setOperationPoolSize(int operationPoolSize)
Sets the number of threads responsible for network operations processing.SqlConfig
setStatementTimeoutMillis(long statementTimeoutMillis)
Sets the timeout in milliseconds that is applied to statements without an explicit timeout.String
toString()
-
Field Details
-
DEFAULT_EXECUTOR_POOL_SIZE
public static final int DEFAULT_EXECUTOR_POOL_SIZEDefault number of threads responsible for execution of SQL statements.- See Also:
- Constant Field Values
-
DEFAULT_OPERATION_POOL_SIZE
public static final int DEFAULT_OPERATION_POOL_SIZEDefault number of threads responsible for network operations processing.- See Also:
- Constant Field Values
-
DEFAULT_STATEMENT_TIMEOUT_MILLIS
public static final int DEFAULT_STATEMENT_TIMEOUT_MILLISDefault timeout in milliseconds that is applied to statements without explicit timeout.- See Also:
- Constant Field Values
-
-
Constructor Details
-
SqlConfig
public SqlConfig()
-
-
Method Details
-
getExecutorPoolSize
public int getExecutorPoolSize()Gets the number of threads responsible for execution of SQL statements.- Returns:
- number of threads responsible for execution of SQL statements
-
setExecutorPoolSize
Sets the number of threads responsible for execution of SQL statements.The default value
-1
sets the pool size equal to the number of CPU cores, and should be good enough for the most workloads.Setting the value to less than the number of CPU cores will limit the degree of parallelism of the SQL subsystem. This may be beneficial if you would like to prioritize other CPU-intensive workloads on the same machine.
It is not recommended to set the value of this parameter greater than the number of CPU cores because it may decrease the system's overall performance due to excessive context switches.
Defaults to
-1
.- Parameters:
executorPoolSize
- number of threads responsible for execution of SQL statements- Returns:
- this instance for chaining
-
getOperationPoolSize
public int getOperationPoolSize()Gets the number of threads responsible for network operations processing.- Returns:
- number of threads responsible for network operations processing
-
setOperationPoolSize
Sets the number of threads responsible for network operations processing.When Hazelcast members execute an SQL statement, they send commands to each other over the network to coordinate the execution. This includes requests to start or stop execution, or a request to process a batch of data. These commands are processed in a separate operation thread pool, to avoid frequent interruption of running SQL fragments.
The default value
-1
sets the pool size equal to the number of CPU cores, and should be good enough for the most workloads.Setting the value to less than the number of CPU cores may improve the overall performance on machines with large CPU count, because it will decrease the number of context switches.
It is not recommended to set the value of this parameter greater than the number of CPU cores because it may decrease the system's overall performance due to excessive context switches.
Defaults to
-1
.- Parameters:
operationPoolSize
- number of threads responsible for network operations processing- Returns:
- this instance for chaining
-
getStatementTimeoutMillis
public long getStatementTimeoutMillis()Gets the timeout in milliseconds that is applied to statements without an explicit timeout.- Returns:
- timeout in milliseconds
-
setStatementTimeoutMillis
Sets the timeout in milliseconds that is applied to statements without an explicit timeout.It is possible to set a timeout through the
SqlStatement.setTimeoutMillis(long)
method. If the statement timeout is not set, then the value of this parameter will be used.Zero value means no timeout. Negative values are prohibited.
Defaults to
DEFAULT_STATEMENT_TIMEOUT_MILLIS
.- Parameters:
statementTimeoutMillis
- timeout in milliseconds- Returns:
- this instance for chaining
- See Also:
SqlStatement.setTimeoutMillis(long)
-
toString
-