Class SqlConfiguration
- java.lang.Object
-
- org.apache.ignite.configuration.SqlConfiguration
-
public class SqlConfiguration extends Object
The configuration of the SQL query subsystem.
-
-
Field Summary
Fields Modifier and Type Field Description static longDFLT_LONG_QRY_WARN_TIMEOUTDefault timeout after which long query warning will be printed.static longDFLT_QRY_TIMEOUTDefault query timeout.static intDFLT_SQL_PLAN_HISTORY_SIZEDefault SQL plan history size.static intDFLT_SQL_QUERY_HISTORY_SIZEDefault SQL query history size.
-
Constructor Summary
Constructors Constructor Description SqlConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetDefaultQueryTimeout()Deprecated.Since 2.9.longgetLongQueryWarningTimeout()Gets timeout in milliseconds after which long query warning will be printed.QueryEngineConfiguration[]getQueryEnginesConfiguration()Gets query engines configuration.intgetSqlPlanHistorySize()Number of SQL plan history elements to keep in memory.intgetSqlQueryHistorySize()Number of SQL query history elements to keep in memory.String[]getSqlSchemas()Gets SQL schemas to be created on node startup.booleanisValidationEnabled()Returns whether Ignite validates cache keys and values against the declared SQL schema before applying DML operations such asINSERT,MERGE,UPDATEand cache API calls that modify data.SqlConfigurationsetDefaultQueryTimeout(long dfltQryTimeout)Deprecated.Since 2.9.SqlConfigurationsetLongQueryWarningTimeout(long longQryWarnTimeout)Sets timeout in milliseconds after which long query warning will be printed.SqlConfigurationsetQueryEnginesConfiguration(QueryEngineConfiguration... enginesConfiguration)Sets query engines configuration.SqlConfigurationsetSqlPlanHistorySize(int size)Sets number of SQL plan history elements kept in memory.SqlConfigurationsetSqlQueryHistorySize(int size)Sets number of SQL query history elements kept in memory.SqlConfigurationsetSqlSchemas(String... sqlSchemas)Sets SQL schemas to be created on node startup.SqlConfigurationsetValidationEnabled(boolean validationEnabled)Enables or disables validation of cache keys and values against the SQL schema.StringtoString()
-
-
-
Field Detail
-
DFLT_SQL_QUERY_HISTORY_SIZE
public static final int DFLT_SQL_QUERY_HISTORY_SIZE
Default SQL query history size.- See Also:
- Constant Field Values
-
DFLT_SQL_PLAN_HISTORY_SIZE
public static final int DFLT_SQL_PLAN_HISTORY_SIZE
Default SQL plan history size.- See Also:
- Constant Field Values
-
DFLT_QRY_TIMEOUT
public static final long DFLT_QRY_TIMEOUT
Default query timeout.- See Also:
- Constant Field Values
-
DFLT_LONG_QRY_WARN_TIMEOUT
public static final long DFLT_LONG_QRY_WARN_TIMEOUT
Default timeout after which long query warning will be printed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultQueryTimeout
@Deprecated public long getDefaultQueryTimeout()
Deprecated.Since 2.9. Please use distributed default query timeout.Defines the default query timeout. Defaults toDFLT_QRY_TIMEOUT.0means there is no timeout (this is a default value)- Returns:
- Default query timeout.
-
setDefaultQueryTimeout
@Deprecated public SqlConfiguration setDefaultQueryTimeout(long dfltQryTimeout)
Deprecated.Since 2.9. Please use distributed default query timeout.Sets timeout in milliseconds for default query timeout.0means there is no timeout (this is a default value)- Parameters:
dfltQryTimeout- Timeout in milliseconds.- Returns:
thisfor chaining.
-
getSqlQueryHistorySize
public int getSqlQueryHistorySize()
Number of SQL query history elements to keep in memory. If not provided, then default valueDFLT_SQL_QUERY_HISTORY_SIZEis used. If provided value is less or equals 0, then gathering SQL query history will be switched off.- Returns:
- SQL query history size.
-
setSqlQueryHistorySize
public SqlConfiguration setSqlQueryHistorySize(int size)
Sets number of SQL query history elements kept in memory. If not explicitly set, then default value isDFLT_SQL_QUERY_HISTORY_SIZE.- Parameters:
size- Number of SQL query history elements kept in memory.- Returns:
thisfor chaining.
-
getSqlPlanHistorySize
public int getSqlPlanHistorySize()
Number of SQL plan history elements to keep in memory. If not provided, then default value-1applies when the indexing module is in use andDFLT_SQL_PLAN_HISTORY_SIZEis used for other engines. If provided value is less or equals 0, then gathering SQL plan history will be switched off.- Returns:
- SQL plan history size.
-
setSqlPlanHistorySize
public SqlConfiguration setSqlPlanHistorySize(int size)
Sets number of SQL plan history elements kept in memory. If not explicitly set, then default value-1applies when the indexing module is in use andDFLT_SQL_PLAN_HISTORY_SIZEis used for other engines.- Parameters:
size- Number of SQL plan history elements kept in memory.- Returns:
thisfor chaining.
-
getSqlSchemas
public String[] getSqlSchemas()
Gets SQL schemas to be created on node startup.See
setSqlSchemas(String...)for more information.- Returns:
- SQL schemas to be created on node startup.
-
setSqlSchemas
public SqlConfiguration setSqlSchemas(String... sqlSchemas)
Sets SQL schemas to be created on node startup. Schemas are created on local node only and are not propagated to other cluster nodes. Created schemas cannot be dropped.By default schema names are case-insensitive, i.e.
my_schemaandMy_Schemarepresents the same object. Use quotes to enforce case sensitivity (e.g."My_Schema").Property is ignored if
ignite-indexingmodule is not in classpath.- Parameters:
sqlSchemas- SQL schemas to be created on node startup.- Returns:
thisfor chaining.
-
getLongQueryWarningTimeout
public long getLongQueryWarningTimeout()
Gets timeout in milliseconds after which long query warning will be printed.- Returns:
- Timeout in milliseconds.
-
setLongQueryWarningTimeout
public SqlConfiguration setLongQueryWarningTimeout(long longQryWarnTimeout)
Sets timeout in milliseconds after which long query warning will be printed.- Parameters:
longQryWarnTimeout- Timeout in milliseconds.- Returns:
thisfor chaining.
-
isValidationEnabled
public boolean isValidationEnabled()
Returns whether Ignite validates cache keys and values against the declared SQL schema before applying DML operations such asINSERT,MERGE,UPDATEand cache API calls that modify data. When enabled, Ignite checks that each property uses a runtime type compatible with the column definition (including for non-indexed columns). Violations raise an IgniteSQLException for SQL operations or a CacheException for cache API updates.- Returns:
trueif key and value validation against the SQL schema is enabled;falseotherwise.
-
setValidationEnabled
public SqlConfiguration setValidationEnabled(boolean validationEnabled)
Enables or disables validation of cache keys and values against the SQL schema.- Parameters:
validationEnabled-trueto validate key and value objects against the SQL schema and reject data that violates declared types or constraints;falseto skip these checks. The default value isfalse.- Returns:
thisfor chaining.
-
setQueryEnginesConfiguration
public SqlConfiguration setQueryEnginesConfiguration(QueryEngineConfiguration... enginesConfiguration)
Sets query engines configuration.There are several engines to execute SQL queries can be configured. If configured more than one engine, exact engine to execute the query can be chosen in run-time by
queryEngineJDBC connection property or byQUERY_ENGINE('engineName')SQL query hint. If no query engine is explicitly chosen, default query engine will be used (seeQueryEngineConfiguration.setDefault(boolean)).When this property is not set, the query engine cannot be chosen in run-time, and the engine provided by the ignite-indexing module will be used for all queries.
- Parameters:
enginesConfiguration- Query engines configuration.- Returns:
thisfor chaining.
-
getQueryEnginesConfiguration
public QueryEngineConfiguration[] getQueryEnginesConfiguration()
Gets query engines configuration.- Returns:
- Query engines configuration.
-
-