public class SqlConfig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_EXECUTOR_POOL_SIZE
Default number of threads responsible for execution of SQL statements.
|
static int |
DEFAULT_STATEMENT_TIMEOUT_MILLIS
Default timeout in milliseconds that is applied to statements without explicit timeout.
|
Constructor and Description |
---|
SqlConfig() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getExecutorPoolSize()
Gets the number of threads responsible for execution of SQL statements.
|
long |
getStatementTimeoutMillis()
Gets the timeout in milliseconds that is applied to statements without an explicit timeout.
|
int |
hashCode() |
SqlConfig |
setExecutorPoolSize(int executorPoolSize)
Sets the number of threads responsible for execution of SQL statements.
|
SqlConfig |
setStatementTimeoutMillis(long statementTimeoutMillis)
Sets the timeout in milliseconds that is applied to statements without an explicit timeout.
|
String |
toString() |
public static final int DEFAULT_EXECUTOR_POOL_SIZE
public static final int DEFAULT_STATEMENT_TIMEOUT_MILLIS
public int getExecutorPoolSize()
public SqlConfig setExecutorPoolSize(int executorPoolSize)
The default value -1
sets the pool size equal to the number of CPU cores, and should be good enough
for 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 higher than the number of CPU cores because it may decrease the system's overall performance due to excessive context switches.
Defaults to -1
.
executorPoolSize
- number of threads responsible for execution of SQL statementspublic long getStatementTimeoutMillis()
public SqlConfig setStatementTimeoutMillis(long statementTimeoutMillis)
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
.
statementTimeoutMillis
- timeout in millisecondsSqlStatement.setTimeoutMillis(long)
Copyright © 2022 Hazelcast, Inc.. All rights reserved.